Multithreading assert failed

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mailseth
Posts: 5
Joined: 2010-12-07T18:53:19-07:00
Authentication code: 8675308

Multithreading assert failed

Post by mailseth »

I'm working with remote sensed imagery from the Landsat program. I downloaded it here:
http://edcsns17.cr.usgs.gov/cgi-bin/Ear ... ANDSAT_ETM

I just want to combine some of the images into a RGB image. There seems to be a problem with threading. I set the number of threads to one, and it worked. I thought you guys might be interested in this thread-un-safe behavior. All those "Unknown filed with tag" errors are expected because these are GeoTIFFs.

Code: Select all

GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > convert L71038031_03120010904_B50.TIF L71038031_03120010904_B40.TIF L71038031_03120010904_B20.TIF -channel RGB -combine LE70380312001247EDC00_rgb.tif
Assertion failed: (id < (long) cache_view->number_threads), function GetCacheViewVirtualPixels, file magick/cache-view.c, line 712.
Abort trap
GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > convert L71038031_03120010904_B50.TIF L71038031_03120010904_B40.TIF L71038031_03120010904_B20.TIF -channel RGB -combine LE70380312001247EDC00_rgb.tif
Assertion failed: (id < (long) cache_view->number_threads), function GetCacheViewVirtualPixels, file magick/cache-view.c, line 712.
Assertion failed: (id < (long) cache_view->number_threads), function GetCacheViewVirtualPixels, file magick/cache-view.c, line 712.
Abort trap
GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > export MAGICK_THREAD_LIMIT=1 
GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > convert L71038031_03120010904_B50.TIF L71038031_03120010904_B40.TIF L71038031_03120010904_B20.TIF -channel RGB -combine LE70380312001247EDC00_rgb.tif
convert: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 34737 (0x87b1) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 34737 (0x87b1) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
convert: Unknown field with tag 34737 (0x87b1) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/528.
GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > hostinfo
Mach kernel version:
	 Darwin Kernel Version 10.5.0: Fri Nov  5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386
Kernel configured for up to 16 processors.
8 processors are physically available.
16 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Primary memory available: 16.00 gigabytes
Default processor set: 85 tasks, 378 threads, 16 processors
Load average: 0.00, Mach factor: 15.99
GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > 
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Multithreading assert failed

Post by magick »

Can you post a stack trace? Try
  • gdb convert
    run L71038031_03120010904_B50.TIF L71038031_03120010904_B40.TIF L71038031_03120010904_B20.TIF -channel RGB -combine LE70380312001247EDC00_rgb.tif
    where
and post the results. The stack trace will help us debug the problem.
mailseth
Posts: 5
Joined: 2010-12-07T18:53:19-07:00
Authentication code: 8675308

Re: Multithreading assert failed

Post by mailseth »

Code: Select all

GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > unset MAGICK_THREAD_LIMIT
GRASS 7.0.svn (cache):~/clouds/LE70380312001247EDC00 > gdb convert 
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ...
warning: Could not find object file "/usr/local/libtiff/tiff-4.0.0beta4/libtiff/.libs/libtiff.lax/libport.a/dummy.o" - no debug information available for "dummy.c".

............ done

(gdb) run L71038031_03120010904_B50.TIF L71038031_03120010904_B40.TIF L71038031_03120010904_B20.TIF -channel RGB -combine test_out.tif
Starting program: /usr/local/bin/convert L71038031_03120010904_B50.TIF L71038031_03120010904_B40.TIF L71038031_03120010904_B20.TIF -channel RGB -combine test_out.tif
Reading symbols for shared libraries .+++++++++.++++......................................................... done
Reading symbols for shared libraries . done
Assertion failed: (id < (long) cache_view->number_threads), function GetCacheViewVirtualPixels, file magick/cache-view.c, line 712.
Assertion failed: (id < (long) cache_view->number_threads), function GetCacheViewVirtualPixels, file magick/cache-view.c, line 712.
Assertion failed: (id < (long) cache_view->number_threads), function GetCacheViewVirtualPixels, file magick/cache-view.c, line 712.

Program received signal SIGABRT, Aborted.
0x00000001001057ec in CombineImages.omp_fn.2 ()
(gdb) bt
#0  0x00000001001057ec in CombineImages.omp_fn.2 ()
#1  0x0000000100105259 in CombineImages ()
#2  0x0000000100428098 in MogrifyImageList ()
#3  0x0000000100429c61 in MogrifyImages ()
#4  0x0000000100354bc0 in ConvertImageCommand ()
#5  0x0000000100000c2d in main ()
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Multithreading assert failed

Post by magick »

Your command works for us suggesting it might be a buggy OpenMP implementation on your system. However, we turned off OpenMP for this algorithm in ImageMagick 6.6.6-5 to ensure the algorithm works on your system as well.
Post Reply