animation.xq test crashes using Windows installer

Bug #1010746 reported by Chris Hillery
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Medium
Rodolfo Ochoa

Bug Description

1. Install Zorba 2.5.0 on Windows using installer from:

  http://www.2shared.com/file/2ksHal6V/zorba-250-win32-x86.html

2. Download the image module source (lp:zorba/image-module) to some directory.

3. cd image-module/test/Queries/image

4. zorba -f -q animation.xq

"zorba.exe has encountered a problem and needs to close" dialog pops up.

Related branches

Chris Hillery (ceejatec)
Changed in zorba:
assignee: Rodolfo Pilas (rodolfo) → Rodolfo Ochoa (rodolfo-ochoa)
Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Image Module is out in Release 2.5
ImageMagick should not be shipped with Module.

Changed in zorba:
importance: Critical → Medium
milestone: 2.5 → none
Changed in zorba:
milestone: none → 2.7
Revision history for this message
Chris Hillery (ceejatec) wrote :

Very soon (certainly before 2.7) we need to figure out how to ship the image module without bundling ImageMagick. That means documenting that the user must install it, and doing the best that we can to find it. Also, the image module should fail gracefully with a clear error if the user tries to run a query using it but it can't find ImageMagick.

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Modules are failing because need the instruction:
InitializeMagick();

after adding this instruction we should not include ImageMagick libraries, we should encourage the user to install latest version of ImageMagick.

Revision history for this message
Chris Hillery (ceejatec) wrote :

That's weird - why do the tests work from ctest, if we're missing a required initialization?

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

From documentation: http://www.imagemagick.org/Magick++/

Please note that under Windows (and possibly the Mac) it is necessary to initialize the ImageMagick library prior to using the Magick++ library. This initialization is performed by passing the path to the ImageMagick DLLs (assumed to be in the same directory as your program) to the InitializeMagick() function call. This is commonly performed by providing the path to your program (argv[0]) as shown in the following example:

int main( ssize_t /*argc*/, char ** argv)
{
  InitializeMagick(*argv);

This initialization step is not required under Unix, Linux, Cygwin, or any other operating environment that supports the notion of "installing" ImageMagick in a known location.

Revision history for this message
Chris Hillery (ceejatec) wrote :

That's... really weird. Are you aware of other tools that work that way on Windows?

Regardless, very interesting. I agree that this call will be necessary to support users installing ImageMagick themselves. I do wonder, however, how we are going to call InitializeMagick() if we need to provide the path to the ImageMagick installation. How are we supposed to find the ImageMagick libraries on the user's system at runtime?

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

From ImageMagick:

If argv is not available use
InitializeMagick("");

http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=9581

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

No, I'm not aware of other tools that work that way yet for Zorba...

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Finally I found the page I want to show:
http://www.graphicsmagick.org/Magick++/

>>>
If you don't have the path to your executable, then pass NULL and usually the library will be found anyway. Besides helping to find the GraphicsMagick DLL/library and configuration files, InitializeMagick() initializes all of the semaphores and data necessary for a multi-threaded program to be completely thread safe. This step used to be optional, but it is now absolutely required. Failure to initialize GraphicsMagick will result in an application crash.

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Ohh.. nevermind, previous page is from another library, anyway, seems that ImageMagick behaves the same way...

Changed in zorba:
status: New → In Progress
Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Well, here are the facts:
- Zorba crashes because we ship an incomplete version of ImageMagick, not because we don't initialize ImageMagick
- If we don't ship ImageMagick we receive a "DLL Load Failed" error, that was a known issue
- What we need is an ImageMagick verification code that checks that ImageMagick is installed, if not, then Zorba throw an error in a more natural way.

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Branch updated, please test

Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
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.