openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] IlmImfTest failure with VS2010 debug builds


From: Michael Reinhardt
Subject: [Openexr-devel] IlmImfTest failure with VS2010 debug builds
Date: Mon, 27 May 2013 14:06:25 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

Hi,

I'm using the OpenEXR 2.0.0 version downloaded from the website. The compilation takes place on a Win7 x64 system with VS2010. (I updated the project files.)
In release mode everything works fine. In debug mode, I'm experiencing four failures in the IlmImfTest suite: testAttributes, testDeepScanLineMultipleRead, testCompositeDeepScanLine, testMultiPartSharedAttributes.
Each test fails right at the start.

testAttributes: (String subscript out of range)
I traced this error back to the attempt to read an empty string. It's about reading the second element of the header attribute a15 ("who can spin", "", "straw into", "gold"). The problem is in function "StringVectorAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int size, int version)". In this test, the input buffer is resized to a length of zero. Upon retrieving a pointer to the first element, a debug error is raised from the stl, which is correct behavior.
In order to avoid this problem, I simply skip the reading call when there are no characters to read (see attached patch file "ImfStringVectorAttribute.cpp.patch").

testDeepScanLineMultipleRead: (Vector subscript out of range)
This time it is the test itself that causes the error. The function "static void read_file(const char * filename) [testDeepScanLineMultipleRead.cpp]" can't handle the case when it should read row zero. This scanline does not contain any samples. Therefore, one can't set any pointer to these samples. I adjusted the for-loop, which updates sample_pointers, in order to avoid this glitch. (see attached path file "testDeepScanLineMultipleRead.cpp").

testCompositeDeepScanLine: (Vector subscript out of range)
This error is located at "void CompositeDeepScanLine::readPixels(int start, int end) [ImfCompositeDeepScanLine.cpp:536]". The attempt to read the last sample fails. The calculated index is by one too big. I don't understand this part of the library very well, so I don't try to present a workaround.

testMultiPartSharedAttributes: (Vector subscript out of range)
This error occurs in the testHeaders() subtest. The function "testMultiPartOutputFileForExpectedFailure(const vector<Header> & headers, const string & failMessage="")" is given an empty vector. The attempt to get the first element of the empty vector fails.
(The test for an expected error kills itself. :-D) One can easily catch this case and use a NULL pointer as parameter (see attached path file "testMultiPartSharedAttributes.cpp.patch").

I hope, I could help to kill some bugs. Please correct me, if these fixes don't do what they are intended to do.

Best regards
Michael


-----
visit us at
Digital Signage Europe Expo 2013 / June 12-13 / The Station-Gleisdreieck, Berlin, Germany / booth F.10 infoCOMM13 / June 12-14 / Orange County Convention Center, Orlando, Florida / booth 5453 www.hhi.fraunhofer.de/events

Attachment: ImfStringVectorAttribute.cpp.patch
Description: Text document

Attachment: testMultiPartSharedAttributes.cpp.patch
Description: Text document

Attachment: testDeepScanLineMultipleRead.cpp.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]