Threads and MagickWand
Posted: 2009-01-15T05:24:56-07:00
Hi!
I'm developing an app that dones an image treatment and it shows the result in a browser following the next path:
http(browser) -> Apache -> Java Module -> JNA -> my Magickwand program.
And then it returns the result to the browser.
The problem is that when I run concurrent threads it fails and lost responses. I've config ImageMagick-6.4.8-3 with '--enable-threads=posix' so I dont understand where could be the problem. The stack trace that returns Java is:
Stack: [0x044b1000,0x04502000), sp=0x044fc744, free space=301k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x048a341c
C 0x048a5cb8
C [libMagickCore.so.1+0x52945] WriteImage+0x531
C [libMagickCore.so.1+0x2913c] ImageToBlob+0x1c4
C [libMagickWand.so.1+0x95f99] MagickGetImageBlob+0x55
C [libMagickWand.so.1+0x5c262] MagickWriteImageBlob+0x1e
C [libWrapWand.so+0xe6f] ImageAnnotate+0x23d
C [jna9504.tmp+0x10ec7] ffi_call_SYSV+0x17
C [jna9504.tmp+0x10b74] ffi_call+0xb4
C [jna9504.tmp+0x3671]
C [jna9504.tmp+0x3d20] Java_com_sun_jna_Function_invokePointer+0x43
j com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+0
So it looks like it fails in 'MagickWriteImageBlob' function which i'm using in my program...
Any help will be apreciated, thanks!
Best regards.
I'm developing an app that dones an image treatment and it shows the result in a browser following the next path:
http(browser) -> Apache -> Java Module -> JNA -> my Magickwand program.
And then it returns the result to the browser.
The problem is that when I run concurrent threads it fails and lost responses. I've config ImageMagick-6.4.8-3 with '--enable-threads=posix' so I dont understand where could be the problem. The stack trace that returns Java is:
Stack: [0x044b1000,0x04502000), sp=0x044fc744, free space=301k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x048a341c
C 0x048a5cb8
C [libMagickCore.so.1+0x52945] WriteImage+0x531
C [libMagickCore.so.1+0x2913c] ImageToBlob+0x1c4
C [libMagickWand.so.1+0x95f99] MagickGetImageBlob+0x55
C [libMagickWand.so.1+0x5c262] MagickWriteImageBlob+0x1e
C [libWrapWand.so+0xe6f] ImageAnnotate+0x23d
C [jna9504.tmp+0x10ec7] ffi_call_SYSV+0x17
C [jna9504.tmp+0x10b74] ffi_call+0xb4
C [jna9504.tmp+0x3671]
C [jna9504.tmp+0x3d20] Java_com_sun_jna_Function_invokePointer+0x43
j com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+0
So it looks like it fails in 'MagickWriteImageBlob' function which i'm using in my program...
Any help will be apreciated, thanks!
Best regards.