Please help: Convert crashes every 1000 images or so
Posted: 2011-06-09T07:35:35-07:00
Hi,
I have a python script that is processing 6,240 14-bit TIFs, each one has to be made into 32 new images (8-bit exposure ranges), which are later enfused with Enfuse (also via command line).
Unfortunately, ImageMagick "convert" command crashes every 500-1000 images or so, it just freezes the entire python script. I have to control-C to kill the current convert command, then the script continues to run until the next error.
I am not running out of system memory. However, occasionally I get a convert malloc error when it freezes, but not always:
convert(64216,0x7fff70cdbca0) malloc: *** error for object 0x100b00488: incorrect checksum for freed object - object was probably modified after being freed.
I can re-run the script any number of times to have it create only the ones it failed to make the first time. But that is troublesome because I have to check on it and babysit it every couple hours hit control-C.
What is the fix or a more permanent workaround? Code details are below. It will always freeze right after the "print" statement, activity monitor shows that "convert" command is continuing to run at 80% CPU, but it will stay like that for hours until I control-C it to kill that individual convert command. The image is never created. The next image is created just fine. And then the script continues to run.
many thanks,
jmil
SYSTEM DETAILS:
Version: ImageMagick 6.7.0-0 2011-06-07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL
OS X 10.6.7
Shell processing, from python script.
rangeBottomTemp = 0
rangeTopTemp = 1
for i in range(32):
if (rangeBottomTemp < rangeTopTemp):
rangeTopTemp = rangeBottomTemp + binningRange
print "You have set the linear-stretch range for image \"" + str(i) + "\" to be " + str(rangeBottomTemp) + " and " + str(rangeTopTemp) + ", respectively"
os.system("convert -quiet \"" + file + "\" -level " + str(rangeBottomTemp) + "," + str(rangeTopTemp) + " -depth 8 -colorspace Gray " + newDir + "\"/" + file[:-4] + "/" + file[:-4] + "_UniformBrightness_"+ str(i) + ".tif\" " )
rangeBottomTemp = rangeTopTemp - binningRange / 2
I have a python script that is processing 6,240 14-bit TIFs, each one has to be made into 32 new images (8-bit exposure ranges), which are later enfused with Enfuse (also via command line).
Unfortunately, ImageMagick "convert" command crashes every 500-1000 images or so, it just freezes the entire python script. I have to control-C to kill the current convert command, then the script continues to run until the next error.
I am not running out of system memory. However, occasionally I get a convert malloc error when it freezes, but not always:
convert(64216,0x7fff70cdbca0) malloc: *** error for object 0x100b00488: incorrect checksum for freed object - object was probably modified after being freed.
I can re-run the script any number of times to have it create only the ones it failed to make the first time. But that is troublesome because I have to check on it and babysit it every couple hours hit control-C.
What is the fix or a more permanent workaround? Code details are below. It will always freeze right after the "print" statement, activity monitor shows that "convert" command is continuing to run at 80% CPU, but it will stay like that for hours until I control-C it to kill that individual convert command. The image is never created. The next image is created just fine. And then the script continues to run.
many thanks,
jmil
SYSTEM DETAILS:
Version: ImageMagick 6.7.0-0 2011-06-07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL
OS X 10.6.7
Shell processing, from python script.
rangeBottomTemp = 0
rangeTopTemp = 1
for i in range(32):
if (rangeBottomTemp < rangeTopTemp):
rangeTopTemp = rangeBottomTemp + binningRange
print "You have set the linear-stretch range for image \"" + str(i) + "\" to be " + str(rangeBottomTemp) + " and " + str(rangeTopTemp) + ", respectively"
os.system("convert -quiet \"" + file + "\" -level " + str(rangeBottomTemp) + "," + str(rangeTopTemp) + " -depth 8 -colorspace Gray " + newDir + "\"/" + file[:-4] + "/" + file[:-4] + "_UniformBrightness_"+ str(i) + ".tif\" " )
rangeBottomTemp = rangeTopTemp - binningRange / 2