Crash when the image module builds an error

Bug #866937 reported by Gabriel Petrovay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
David Graf

Bug Description

The following code is from the image module source code. The last line crashes:

from: modules\com\zorba-xquery\www\modules\image\image.xq.src\image_function.cpp:56

  // constuct error QName
  String lNamespace = "http://www.zorba-xquery.com/modules/image/error";
  String lLocalname = "err:IM001";
  Item lQName;
  Iterator_t lDummyIterator;
  aDynamicContext->getVariable(lNamespace, lLocalname, lQName, lDummyIterator);

and this crashes because of the following fragment in src\api\dynamiccontextimpl.cpp:172

  if (var == NULL)
  {
    ZORBA_ERROR_DESC_OSS(XPST0008,
                         "Failed to set the value of variable {"
                         << inVarUri << "}" << inVarLocalName
                         << " because no such variable was found");
  }

Does this mean wrong API usage in the image module?

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

aImage.read(lBlob);
throws
"Magick: no decode delegate for this image format `' @ error/blob.c/BlobToImage/349"

and this causes the error that crashez Zorba revealing the segfault

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Please remove the code tagged with bug 3192723 which eliminates these tests from: test\rbkt\Queries\CMakeLists.txt

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Replacing "err:IM001" with "IM001" fixes some of the problems. Also with all the optional DLL's (jpeg, tiff, png, etc.) some more tests pass.

now, the remaining failing tests crash in basic.cpp:206:
lBlankImage.magick(lType.c_str()); // Set output format

Updated the lits of removed tests in r10014.

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Setting the path to the ImageMagick-6.6.7-Q8 dir instead of copying DLL;s in the required dll dir path does not help correcting these problems.

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Before I used IM 6.6.7 and got those segfaults and failures.

Now, I used the same ImageMagick version (6.6.3) as on Paloalto and I don't get segmentation faults anymore. Now the following tests faillures:
test/rbkt/zorba/image/animation (Failed)
test/rbkt/zorba/image/basic (Failed)
test/rbkt/zorba/image/basic_equals (Failed)
test/rbkt/zorba/image/basic_exif (Failed)
test/rbkt/zorba/image/basic_height (Failed)
test/rbkt/zorba/image/basic_type (Failed)
test/rbkt/zorba/image/basic_width (Failed)
test/rbkt/zorba/image/manipulation_1 (Failed)
test/rbkt/zorba/image/manipulation_2 (Failed)
test/rbkt/zorba/image/manipulation_3 (Failed)
test/rbkt/zorba/image/manipulation_4 (Failed)
test/rbkt/zorba/image/manipulation_5 (Failed)
test/rbkt/zorba/image/paint_1 (Failed)
test/rbkt/zorba/image/paint_2 (Failed)
test/rbkt/zorba/image/paint_3 (Failed)
test/rbkt/zorba/image/paint_4 (Failed)
test/rbkt/zorba/image/paint_5 (Failed)
test/rbkt/zorba/image/paint_6 (Failed)

Weird!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.