Page 1 of 1

MagickReadImageBlob stuck in endless loop

Posted: 2013-05-07T07:25:35-07:00
by gfine
In another tree of this forum I was asking about the proper way to handle a char* image in memory and I feel I ran into a bug in MagickReadImageBlob().

The environment is an embedded DaVinci (DM6446) architecture, using FC6 as the host, and cross compiling all the libraries. The version of IM is 6.8.4-8 (downloaded on April 10th).

Basically an encoder passes a JPEG image in memory as a char*. I have verified the image is valid as the SOI (0xff,0xd8) and EOI (0xff,0xd9) bytes are being passed properly, and that MagickReadImageBlob() seems stuck in an endless loop.

I have asked about MAGICK_DEBUG and where to place it (either in a Makefile or export it in the target or host environment). I have tried adding -DMAGICK_DEBUG to CFLAGS and 'export MAGICK_DEBUG=1' to no avail.

Here is the code I use.

Code: Select all

void Zoom_in_on_image (char  *Image_Buffer; private_image_data_t *Image_struct)
{
MagickBooleanType   status;
MagickWand   *magick_wand;
ExceptionInfo           *exception;
ImageInfo               *image_info;
ExceptionType   an_error;
int       j=0;
size_t      iLen=0, iSize=0;
unsigned char   *IM_Image_Buffer;

// Routine enters with a 
// char * Image_Buffer  ( pointer to the jpeg image)
// and an Image_struct which has data on the image like .img_size, .geometry members
// from an outside encoder 
// The Image structure also has (for the decoder) .data and a .queue members

   iSize = Image_struct.img_size;

   printf("Beginning bytes, [0]=0x%X, [1]=0x%X\n",Image_Buffer[0],Image_Bufferf[1] );
   // *** These bytes are 0xFF and 0xD8 *** which are the right bytes (SOI) for a JPEG

    printf( "last 2 bytes = [0x%X], [0x%X]\n",Image_Buffer[iSize-2],Image_Buffer[iSize-1] );
   // *** These bytes are 0xFF and 0xD9 *** which are the right bytes (EOI) for a JPEG

   // Start of ImageMagicK code
   MagickWandGenesis ();

   magick_wand = NewMagickWand();
   MagickGetException ( magick_wand, &an_error);
   if (an_error)
      printf( "Error in creating wand\n")

   // Clear wand space
   ClearMagickWand (magick_wand);

   // Tell ImageMagick it is a jpeg 
   MagickSetFormat ( magick_wand, "JPG" );

   // Read image into wand
   // The failure is here ****  Seems to be caught in a loop ***** Never gets past this point. *****
   // NOTE: If I use &Image_Buffer it will complain that it is not a jpeg, so I know it passes the JPEG test going into this API. 
   printf( "At ReadImageBlob\n");
   status = MagickReadImageBlob ( magick_wand, Image_Buffer, iSize);
   MagickGetException ( magick_wand, &an_error);
   if (an_error)
   {
      ExceptionType severity;
      char *err = MagickGetException(magick_wand, &severity);
      printf( "ImageMagickReadImageBlob Error:[%s]", err);
      MagickRelinquishMemory(err);
   }
   if (status)
   {
        printf("MagicReadImageBlob returned error=[%d]\n",status);
   }

[ Zoom code goes here, but since I never get past the MagickReadImageBlob, it would be irrelevant  to post it]

   MagickWandTerminus();
Have I happened on a bug or is there some prerequisite I am missing? I use jpegsrc.v9 for libjpeg, and the ./configure shows it is included in the build of the ImageMagick libraries.

Thanks in advance.

Glen

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-07T07:49:46-07:00
by magick
Set MAGICK_DEBUG to 'trace' to see where its hanging. We tried this small code set:

Code: Select all

#include <stdio.h>
#include <sys/timeb.h>
#include <wand/MagickWand.h>

int main() {
  ExceptionInfo *exception;
  MagickBooleanType status;
  MagickWand *wand;
  size_t length;
  unsigned char *blob;

  MagickWandGenesis();
  exception=AcquireExceptionInfo();
  blob=FileToBlob("logo.jpg",~0UL,&length,exception);
  printf("JPEG blob[%p]: %.20g\n",blob,(double) length);
  wand = NewMagickWand();
  status=MagickReadImageBlob(wand, blob, length);
  printf("JPEG blob read: %d (1 means success)\n",status);
  return(0);
}
with ImageMagick 6.8.5-4, the current release, and it ran without complaint. To test, first issue this command:
  • convert logo: logo.jpg
Does this simple test work for you?

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-07T08:54:20-07:00
by gfine
I can not run 'convert' on the target as the target has a space contstraint. But I can build it on the host (for the host) and it see what happens.

I added 'setenv ("MAGICK_DEBUG","trace",1);' to the Zoom code just above the Wand Genesis and got the following:

Code: Select all

2013-05-07T15:33:15+00:00 0:00.280 0.280u 6.8.4 Trace Magick[838]: utility.c/GetPathComponent/1194/Trace
  /usr/local/MyDir/bin/Zoom
2013-05-07T15:33:15+00:00 0:00.380 0.380u 6.8.4 Trace ZoomD[838]: utility.c/GetPathComponent/1194/Trace
  /usr/local/MyDir/bin/Zoom
2013-05-07T15:33:15+00:00 0:00.530 0.530u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  area
2013-05-07T15:33:15+00:00 0:00.530 0.530u 6.8.4 Trace ZoomD[838]: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.530 0.530u 6.8.4 Trace ZoomD[838]: configure.c/GetConfigureOptions/574/Trace
  policy.xml
2013-05-07T15:33:15+00:00 0:00.530 0.530u 6.8.4 Trace ZoomD[838]: configure.c/GetConfigurePaths/662/Trace
  policy.xml
2013-05-07T15:33:15+00:00 0:00.530 0.530u 6.8.4 Trace ZoomD[838]: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.530 0.530u 6.8.4 Trace ZoomD[838]: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.540 0.540u 6.8.4 Trace ZoomD[838]: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.540 0.540u 6.8.4 Trace ZoomD[838]: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.540 0.540u 6.8.4 Trace ZoomD[838]: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.540 0.540u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.540 0.540u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.540 0.540u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.550 0.550u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.550 0.550u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.550 0.550u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.550 0.550u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.550 0.550u 6.8.4 Trace ZoomD[838]: hashmap.c/DestroyLinkedList/422/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.560 0.560u 6.8.4 Trace ZoomD[838]: utility.c/GetPathComponent/1194/Trace
  magick/configure.c
2013-05-07T15:33:15+00:00 0:00.560 0.560u 6.8.4 Trace ZoomD[838]: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.560 0.560u 6.8.4 Trace ZoomD[838]: configure.c/DestroyConfigureOptions/229/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.560 0.560u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.560 0.560u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.560 0.560u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.570 0.570u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.570 0.570u 6.8.4 Trace ZoomD[838]: hashmap.c/DestroyLinkedList/422/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.570 0.570u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  memory
2013-05-07T15:33:15+00:00 0:00.570 0.570u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.570 0.570u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.570 0.570u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.570 0.570u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.580 0.580u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  map
2013-05-07T15:33:15+00:00 0:00.580 0.580u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.580 0.580u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.580 0.580u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.580 0.580u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.580 0.580u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  disk
2013-05-07T15:33:15+00:00 0:00.580 0.580u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.590 0.590u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.590 0.590u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.590 0.590u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:15+00:00 0:00.590 0.590u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  file
2013-05-07T15:33:16+00:00 0:00.930 0.590u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.930 0.590u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.940 0.600u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.940 0.600u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.940 0.600u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  thread
2013-05-07T15:33:16+00:00 0:00.940 0.600u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.940 0.600u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.940 0.600u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.950 0.610u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.950 0.610u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  throttle
2013-05-07T15:33:16+00:00 0:00.950 0.610u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.950 0.610u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.950 0.610u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.950 0.610u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.950 0.610u 6.8.4 Trace ZoomD[838]: policy.c/GetPolicyValue/389/Trace
  time
2013-05-07T15:33:16+00:00 0:00.960 0.620u 6.8.4 Trace ZoomD[838]: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.960 0.620u 6.8.4 Trace ZoomD[838]: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.960 0.620u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T15:33:16+00:00 0:00.960 0.620u 6.8.4 Trace ZoomD[838]: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
Zoom: wand/magick-wand.c:295: MagickGetException: Assertion `wand->signature == 0xabacadabUL' failed.

With the trace on it does return but raises an excpetion in the Zoom process.

Any ideas? Is my image corrupt in some way,shape, or form?

When it is processed directly to my framebuffer decode routine it displays properly.

Downloaded the latest IM (v5.8.5-4) and will see if this will replicate with the newest code.

More later today.

G

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-07T10:23:54-07:00
by gfine
Reproduced on newest version IM (v5.8.5-4).

Debug log identical. Same assert; 'Zoom: wand/magick-wand.c:295: MagickGetException: Assertion `wand->signature == 0xabacadabUL' failed.'


G

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-07T11:46:57-07:00
by magick
Did you run the codeset we provided? Its known to work. You don't need the 'convert' command. You can use any JPEG file, just make sure ou set the correct filename path in the source code, compile, and run.

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-07T14:13:56-07:00
by gfine
Here is the output of the test app.

Code: Select all

/usr/local/MyDir/Test # ./test
2013-05-07T20:57:35+00:00 0:00.020 0.020u 6.8.4 Trace Magick: utility.c/GetPathComponent/1194/Trace
  /usr/local/MyDir/Test/test
2013-05-07T20:57:35+00:00 0:00.030 0.030u 6.8.4 Trace test: utility.c/GetPathComponent/1194/Trace
  /usr/local/MyDir/Test/test
2013-05-07T20:57:35+00:00 0:00.030 0.030u 6.8.4 Trace test: policy.c/GetPolicyValue/389/Trace
  area
2013-05-07T20:57:35+00:00 0:00.030 0.030u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.040 0.040u 6.8.4 Trace test: configure.c/GetConfigureOptions/574/Trace
  policy.xml
2013-05-07T20:57:35+00:00 0:00.040 0.040u 6.8.4 Trace test: configure.c/GetConfigurePaths/662/Trace
  policy.xml
2013-05-07T20:57:35+00:00 0:00.040 0.040u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.040 0.040u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.040 0.040u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.040 0.040u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.050 0.050u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.050 0.050u 6.8.4 Trace test: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.050 0.050u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.050 0.050u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.050 0.050u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.050 0.050u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.060 0.060u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.060 0.060u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.060 0.060u 6.8.4 Trace test: hashmap.c/DestroyLinkedList/422/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.060 0.060u 6.8.4 Trace test: utility.c/GetPathComponent/1194/Trace
  magick/configure.c
2013-05-07T20:57:35+00:00 0:00.060 0.060u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.070 0.070u 6.8.4 Trace test: configure.c/DestroyConfigureOptions/229/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.070 0.070u 6.8.4 Trace test: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.070 0.070u 6.8.4 Trace test: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.070 0.070u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.070 0.070u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.070 0.070u 6.8.4 Trace test: hashmap.c/DestroyLinkedList/422/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.070 0.070u 6.8.4 Trace test: policy.c/GetPolicyValue/389/Trace
  memory
2013-05-07T20:57:35+00:00 0:00.080 0.080u 6.8.4 Trace test: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.080 0.080u 6.8.4 Trace test: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.080 0.080u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.080 0.080u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.080 0.080u 6.8.4 Trace test: policy.c/GetPolicyValue/389/Trace
  map
2013-05-07T20:57:35+00:00 0:00.080 0.080u 6.8.4 Trace test: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.080 0.080u 6.8.4 Trace test: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.090 0.090u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.090 0.090u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.090 0.090u 6.8.4 Trace test: policy.c/GetPolicyValue/389/Trace
  disk
2013-05-07T20:57:35+00:00 0:00.090 0.090u 6.8.4 Trace test: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.090 0.090u 6.8.4 Trace test: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.090 0.090u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.090 0.090u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.440 0.100u 6.8.4 Trace test: policy.c/GetPolicyValue/389/Trace
  file
2013-05-07T20:57:35+00:00 0:00.440 0.100u 6.8.4 Trace test: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.440 0.100u 6.8.4 Trace test: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.440 0.100u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.440 0.100u 6.8.4 Trace test: hashmap.c/GetNextValueInLinkedList/634/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.440 0.100u 6.8.4 Trace test: policy.c/GetPolicyValue/389/Trace
  thread
2013-05-07T20:57:35+00:00 0:00.450 0.110u 6.8.4 Trace test: hashmap.c/IsLinkedListEmpty/1247/Trace
  ...
2013-05-07T20:57:35+00:00 0:00.450 0.110u 6.8.4 Trace test: hashmap.c/ResetLinkedListIterator/1978/Trace
  ...
  ...
  ...
2013-05-07T20:57:56+00:00 0:21.420 2.700u 6.8.4 Trace test: magick.c/GetImageDecoder/151/Trace
  ...
2013-05-07T20:57:56+00:00 0:21.420 2.700u 6.8.4 Trace test: magick.c/GetImageDecoder/151/Trace
  ...
2013-05-07T20:57:56+00:00 0:21.420 2.700u 6.8.4 Trace test: magick.c/GetMagickThreadSupport/754/Trace
  ...
2013-05-07T20:57:56+00:00 0:21.420 2.700u 6.8.4 Trace test: magick.c/GetImageDecoder/151/Trace
  ...
2013-05-07T20:57:56+00:00 0:21.420 2.700u 6.8.4 Trace test: jpeg.c/ReadJPEGImage/998/Trace
  
2013-05-07T20:57:56+00:00 0:21.420 2.700u 6.8.4 Trace test: image.c/AcquireImage/163/Trace
  ...
2013-05-07T20:57:56+00:00 0:21.430 2.710u 6.8.4 Trace test: color.c/QueryMagickColorCompliance/2549/Trace
  #ffffff
2013-05-07T20:57:56+00:00 0:21.430 2.710u 6.8.4 Trace test: color.c/QueryMagickColorCompliance/2549/Trace
  #dfdfdf
2013-05-07T20:57:56+00:00 0:21.430 2.710u 6.8.4 Trace test: color.c/QueryMagickColorCompliance/2549/Trace
  #bdbdbd
2013-05-07T20:57:56+00:00 0:21.430 2.710u 6.8.4 Trace test: color.c/QueryMagickColorCompliance/2549/Trace
  #00000000
2013-05-07T20:57:56+00:00 0:21.430 2.710u 6.8.4 Trace test: blob.c/SetBlobExempt/3684/Trace
  
2013-05-07T20:57:56+00:00 0:21.430 2.710u 6.8.4 Trace test: image.c/SyncImageSettings/3547/Trace
  
2013-05-07T20:57:56+00:00 0:21.440 2.720u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.440 2.720u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.440 2.720u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.440 2.720u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.440 2.720u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.440 2.720u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.440 2.720u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.450 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.450 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.450 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.450 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.450 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:56+00:00 0:21.450 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.110 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.110 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.110 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.110 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.110 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.110 2.730u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.120 2.740u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.120 2.740u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.120 2.740u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.120 2.740u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.120 2.740u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.120 2.740u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.130 2.750u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.130 2.750u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.130 2.750u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.130 2.750u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.130 2.750u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.130 2.750u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.140 2.760u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.140 2.760u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.140 2.760u 6.8.4 Trace test: option.c/ResetImageOptionIterator/2563/Trace
  
2013-05-07T20:57:57+00:00 0:22.140 2.760u 6.8.4 Trace test: option.c/GetNextImageOption/2085/Trace
  
2013-05-07T20:57:57+00:00 0:22.140 2.760u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.140 2.760u 6.8.4 Trace test: option.c/GetImageOption/1823/Trace
  
2013-05-07T20:57:57+00:00 0:22.140 2.760u 6.8.4 Trace test: blob.c/OpenBlob/2356/Trace
  
2013-05-07T20:57:57+00:00 0:22.150 2.770u 6.8.4 Trace test: blob.c/AttachBlob/199/Trace
  ...
2013-05-07T20:57:57+00:00 0:22.160 2.780u 6.8.4 Trace test: artifact.c/GetImageArtifact/273/Trace
  
2013-05-07T20:57:57+00:00 0:22.160 2.780u 6.8.4 Trace test: artifact.c/GetImageArtifact/273/Trace
  
2013-05-07T20:57:57+00:00 0:22.160 2.780u 6.8.4 Trace test: artifact.c/GetImageArtifact/273/Trace
  
2013-05-07T20:57:57+00:00 0:22.160 2.780u 6.8.4 Trace test: artifact.c/GetImageArtifact/273/Trace
  
2013-05-07T20:57:57+00:00 0:22.160 2.780u 6.8.4 Trace test: artifact.c/GetImageArtifact/273/Trace
  
2013-05-07T20:57:57+00:00 0:22.170 2.790u 6.8.4 Trace test: utility.c/GetPathComponent/1194/Trace
  coders/jpeg.c
2013-05-07T20:57:57+00:00 0:22.170 2.790u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...
2013-05-07T20:57:57+00:00 0:22.170 2.790u 6.8.4 Trace test: utility.c/GetPathComponent/1194/Trace
  coders/jpeg.c
2013-05-07T20:57:57+00:00 0:22.180 2.800u 6.8.4 Trace test: hashmap.c/GetLastValueInLinkedList/469/Trace
  ...
2013-05-07T20:57:57+00:00 0:22.180 2.800u 6.8.4 Trace test: hashmap.c/AppendValueToLinkedList/165/Trace
  ...

It stopped outputting at this point. Let it run for 2 minutes and then ^C to end it.

Any thoughts??

G

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-07T16:30:30-07:00
by magick
We cannot reproduce the problem. We tried using your configure command except we did not cross compile and our sample wand code compiled and ran without complaint. The debug trace was not helpful.

Are you using OpenMP or pthreads? If so disable them from the configure script command line. Otherwise we have no more suggestions other than embedding print statements in the code to identify precisely where the program is hanging.

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-08T04:09:11-07:00
by gfine
Is there something to the assert from my app? What event occurs for it to fail the assert?

Is there a requirement from jpegsrc that must be configured in?

In the ./configure for IM I do see a message about it not passing the preprocessor test but passing the compile test for the jpeg test. I'll post it later as I am not onsite at the moment.

Thank you for your help so far.

G

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-08T04:24:24-07:00
by magick
We can help if we can reproduce the problem. Give us exact instructions on reproducing your environment. You might need to provide an ARM processor as well since we do not have access to one. In the mean-time, post your configure.xml file here.

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-08T05:35:18-07:00
by gfine
Here is the configure.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuremap [
<!ELEMENT configuremap (configure)+>
<!ELEMENT configure (#PCDATA)>
<!ATTLIST configure name CDATA #REQUIRED>
<!ATTLIST configure value CDATA #REQUIRED>
]>
<configuremap>
  <configure name="CC" value="/home/software/cross_compiler/toolchain/bin/arm-none-linux-gnueabi-gcc -std=gnu99 -std=gnu99"/>
  <configure name="CFLAGS" value="-I/home/software/cross_compiler/toolchain/include -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"/>
  <configure name="CODER_PATH" value="/home/software/cross_compiler/toolchain/lib/ImageMagick-6.8.5/modules-Q16/coders"/>
  <configure name="CONFIGURE_PATH" value="/home/software/cross_compiler/toolchain/etc/ImageMagick-6/"/>
  <configure name="CONFIGURE" value="./configure  '--prefix=/home/software/cross_compiler/toolchain' 'CC=/home/software/cross_compiler/toolchain/bin/arm-none-linux-gnueabi-gcc' 'CFLAGS=-I/home/software/cross_compiler/toolchain/include' 'CXX=/home/software/cross_compiler/toolchain/bin/arm-none-linux-gnueabi-g++' 'CXXFLAGS=' 'LDFLAGS=-L/home/software/cross_compiler/toolchain/lib' '--host=arm-non-linux-gnueabi' '--target=arm-none-linux-gnueabi' '--includedir=/home/software/cross_compiler/kernels/linux-2.6.18/include' '--oldincludedir=/home/software/cross_compiler/kernels/linux-2.6.18' '--without-freetype' '--without-x' '--without-gs-font-dir' '--without-perl' '--with-jpeg=yes' '--with-jp2=yes' '--without-fontconfig' '--enable-shared=yes' 'host_alias=arm-non-linux-gnueabi' 'target_alias=arm-none-linux-gnueabi'"/>
  <configure name="COPYRIGHT" value="Copyright (C) 1999-2013 ImageMagick Studio LLC"/>
  <configure name="CPPFLAGS" value="-I/home/software/cross_compiler/kernels/linux-2.6.18/include/ImageMagick-6"/>
  <configure name="CXXFLAGS" value="-pthread"/>
  <configure name="CXX" value="/home/software/cross_compiler/toolchain/bin/arm-none-linux-gnueabi-g++"/>
  <configure name="DEFS" value="-DHAVE_CONFIG_H"/>
  <configure name="DELEGATES" value="jpeg ps xml"/>
  <configure name="DISTCHECK_CONFIG_FLAGS" value="'CC=/home/software/cross_compiler/toolchain/bin/arm-none-linux-gnueabi-gcc' 'CFLAGS=-I/home/software/cross_compiler/toolchain/include' 'CXX=/home/software/cross_compiler/toolchain/bin/arm-none-linux-gnueabi-g++' 'LDFLAGS=-L/home/software/cross_compiler/toolchain/lib' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fontconfig=no --with-freetype=no --with-gslib=no --with-fontpath= --with-gs-font-dir=no --with-gvc=no --with-rsvg=no --with-webp=no --with-wmf=no --with-perl=no"/>
  <configure name="DOCUMENTATION_PATH" value="/home/software/cross_compiler/toolchain/share/doc/ImageMagick-6"/>
  <configure name="EXEC-PREFIX" value="/home/software/cross_compiler/toolchain"/>
  <configure name="EXECUTABLE_PATH" value="/home/software/cross_compiler/toolchain/bin"/>
  <configure name="FEATURES" value="DPC"/>
  <configure name="FILTER_PATH" value="/home/software/cross_compiler/toolchain/lib/ImageMagick-6.8.5/modules-Q16/filters"/>
  <configure name="HOST" value="arm-non-linux-gnueabi"/>
  <configure name="INCLUDE_PATH" value="/home/software/cross_compiler/kernels/linux-2.6.18/include/ImageMagick-6"/>
  <configure name="LDFLAGS" value="-L/home/software/cross_compiler/toolchain/lib -L/home/software/cross_compiler/toolchain/lib -L/home/software/cross_compiler/toolchain//lib"/>
  <configure name="LIBRARY_PATH" value="/home/software/cross_compiler/toolchain/lib/ImageMagick-6.8.5"/>
  <configure name="LIBS" value="-lMagickCore -ljpeg -lxml2 -lm -lpthread"/>
  <configure name="LIB_VERSION_NUMBER" value="6,8,5,4"/>
  <configure name="LIB_VERSION" value="0x685"/>
  <configure name="NAME" value="ImageMagick"/>
  <configure name="PCFLAGS" value="-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16"/>
  <configure name="PREFIX" value="/home/software/cross_compiler/toolchain"/>
  <configure name="QuantumDepth" value="16"/>
  <configure name="RELEASE_DATE" value="2013-05-07"/>
  <configure name="SHAREARCH_PATH" value="/home/software/cross_compiler/toolchain/lib/ImageMagick-6.8.5/config-Q16"/>
  <configure name="SHARE_PATH" value="/home/software/cross_compiler/toolchain/share/ImageMagick-6"/>
  <configure name="SVN_REVISION" value="12091" />
  <configure name="TARGET_CPU" value="arm"/>
  <configure name="TARGET_OS" value="linux-gnueabi"/>
  <configure name="TARGET_VENDOR" value="non"/>
  <configure name="VERSION" value="6.8.5"/>
  <configure name="WEBSITE" value="http://www.imagemagick.org"/>
</configuremap>
G

Re: MagickReadImageBlob stuck in endless loop

Posted: 2013-05-08T05:41:06-07:00
by magick
Unfortunately, we can't divine the problem from the configuration details. It shows JPEG support. We're at an impasse unless we can reproduce the problem ourselves and then trace the source of the problem. For our testing, we used ImageMagick 6.8.5-5 and JPEG v9.