[GEM-dev] segfault resulting from conflicts with imageMagick

IOhannes m zmoelnig zmoelnig at iem.at
Tue Mar 3 10:21:14 CET 2009


B. Bogart wrote:
> Hey all,
> 
> I'm writing a gphoto2 interface object for PD.
> 
> For some reason I get segfaults when running functions in my external,
> the backtrace shows these are related to libimageMagick.
> 
> If I don't load Gem my code works as expected.
> 
> I've attached the code.
> 
> The openCam() causes the problem.
> 
> Does anyone see anything in there that would conflict with imageMagick?

seems to be a bug in one of the 2 libraries, unrelated to Gem, as can be 
demonstrated by a simple program:
<code>
#include <gphoto2/gphoto2-camera.h>
int main(int argc, char**argv) {
  Camera *camera=NULL;
  gp_camera_new (&camera);
  gp_camera_init (camera, NULL);
  gp_camera_unref (camera);
  return 0;
}
</code>

compiling the above code against libgphoto2
% cc test.c -o test -I/usr/include/gphoto2 -I/usr/include/libexif   -lc 
-lm -lgphoto2 -lgphoto2_port -lexif -lm -lusb
will work like a charm.

however, linking it (additionally) to ImageMagick++
% cc test.c -o test -I/usr/include/gphoto2 -I/usr/include/libexif   -lc 
-lm -lMagick++ -lWand -lMagick -lgphoto2 -lgphoto2_port -lexif -lm -lusb
will segfault when calling gp_camera_init()


without debugging versions of ImageMagick++ and libgphoto2 there is 
little chance to detect the problem.


fmgasdr
IOhannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20090303/bd941784/attachment.bin>


More information about the GEM-dev mailing list