6.3.5-8: libgomp crash on Redhat 9
Posted: 2007-09-25T04:08:29-07:00
Hi ImageMagick-Team,
I tried some multithreaded conversions using JMagick 6.2.6-0 and ImageMagick 6.3.5-8 and observed problems with Redhat 9 and a libgomp compiled with gcc-4.2.1.
There is no problem if I am converting single-threaded.
But if there is more than one thread I always and immediately get the following problem (a hs_err_pid.log from
the JVM):
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x87b29f3f, pid=32677, tid=278546
#
# Java VM: Java HotSpot(TM) Server VM (1.6.0_02-b05 mixed mode)
# Problematic frame:
# C [libgomp.so.1+0x4f3f]
#
C [libgomp.so.1+0x4f3f]
C [libgomp.so.1+0x45e5] GOMP_parallel_start+0x95
C [libMagick.so.10+0xdd853]
C [libMagick.so.10+0xdef63] ResizeImage+0x3a3
C [libMagick.so.10+0xdf3c5] ZoomImage+0x85
C [libJMagick.so+0xf747] Java_magick_MagickImage_zoomImage+0x8b
j magick.MagickImage.zoomImage(II)Lmagick/MagickImage;+0
I tried the same version with Fedora Core 6 and had no problems.
I investigated further and found out that on Redhat 9 HAVE_TLS (TLS==Thread Local Storage) in libgomp.h is not activated which influences wether libgomp is using pthreads or not.
On Fedora Core 6 HAVE_TLS is activated...
If you investigate further you will see that under the Redhat 9 conditions in
gcc-4.2.1/libgomp/parallel.c there is a code fragment
/* If this is a nested region, and nested regions are disabled, force
this team to use only one thread. */
if (gomp_thread()->ts.team && !gomp_nest_var)
return 1;
and here gomp_thread() seems to return NULL under multithreading which causes the crash.
Next I deacticated HAVE_TLS under Fedora Core 6 and recompiled libgomp.
The result is that I have the same behaviour as with Redhat 9...
So HAVE_TLS seems to be critical for ImageMagick in connection with OpenMP and
multithreading.
The problem is that I cant easily get rid of that Redhat 9-System.
Do you have a solution for that problem ?
E.g. should I recompile libgomp in some way?
Or could disable-openmp or similar help ?
Best Regards,
Frank
I tried some multithreaded conversions using JMagick 6.2.6-0 and ImageMagick 6.3.5-8 and observed problems with Redhat 9 and a libgomp compiled with gcc-4.2.1.
There is no problem if I am converting single-threaded.
But if there is more than one thread I always and immediately get the following problem (a hs_err_pid.log from
the JVM):
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x87b29f3f, pid=32677, tid=278546
#
# Java VM: Java HotSpot(TM) Server VM (1.6.0_02-b05 mixed mode)
# Problematic frame:
# C [libgomp.so.1+0x4f3f]
#
C [libgomp.so.1+0x4f3f]
C [libgomp.so.1+0x45e5] GOMP_parallel_start+0x95
C [libMagick.so.10+0xdd853]
C [libMagick.so.10+0xdef63] ResizeImage+0x3a3
C [libMagick.so.10+0xdf3c5] ZoomImage+0x85
C [libJMagick.so+0xf747] Java_magick_MagickImage_zoomImage+0x8b
j magick.MagickImage.zoomImage(II)Lmagick/MagickImage;+0
I tried the same version with Fedora Core 6 and had no problems.
I investigated further and found out that on Redhat 9 HAVE_TLS (TLS==Thread Local Storage) in libgomp.h is not activated which influences wether libgomp is using pthreads or not.
On Fedora Core 6 HAVE_TLS is activated...
If you investigate further you will see that under the Redhat 9 conditions in
gcc-4.2.1/libgomp/parallel.c there is a code fragment
/* If this is a nested region, and nested regions are disabled, force
this team to use only one thread. */
if (gomp_thread()->ts.team && !gomp_nest_var)
return 1;
and here gomp_thread() seems to return NULL under multithreading which causes the crash.
Next I deacticated HAVE_TLS under Fedora Core 6 and recompiled libgomp.
The result is that I have the same behaviour as with Redhat 9...
So HAVE_TLS seems to be critical for ImageMagick in connection with OpenMP and
multithreading.
The problem is that I cant easily get rid of that Redhat 9-System.
Do you have a solution for that problem ?
E.g. should I recompile libgomp in some way?
Or could disable-openmp or similar help ?
Best Regards,
Frank