"Display" problem with ImageMagick 6.7.0-10: "Segmentation f

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
yshouisir
Posts: 7
Joined: 2011-11-15T00:36:31-07:00
Authentication code: 8675308

"Display" problem with ImageMagick 6.7.0-10: "Segmentation f

Post by yshouisir »

In ImageMagick 6.7.0-10 on MacOS 10.6.8, "display" cannot show an image in X11(2.3.6 Xquartz) window. It gives "Segmentation fault" in the Terminal window. Others such as "convert", "identify", work fine using jpeg-, tiff-, pgm-images but "display" does not. "Make check" results in lines starting with "PASS" for compare-, composite-, convert-, identify- and import-commands. Then the program freezes, i.e. nothing happens. Could you please tell me how to solve this problem? The following is what happens.

(INSTALLATION of ImageMagick)
ImageMagick-6.7.0-10.tar.gz was downlonaded from the net, and was unpacked as follows.
$sudo tar xvfz ImageMagick-6.7.0-10.tar.gz
$cd ImageMagick-6.7.0-10

(LIBRARIES)
Prior to "configure", some deligates libraries were installed as follows.
$sudo port -v install freetype +bytecode
$sudo port -v install librsvg
$sudo port -v install graphviz +gslib +wmf +jbig +jp2 +lcms (-->gslib and lcms were not installed. So installed as follows)
("$sudo port -v install graphviz +gslib +jbig +jp2 +universal" was also tried -->gslib and lcms were not installed yet. )

Then floowing libraries are installed separately.
$sudo port install jpeg
$sudo port install tiff
$sudo port install libpng

(CONFIGURE)
$./configure --prefix=/opt/local
--with-quantum-depth=16
--disable-dependency-tracking
--with-x=yes (--> it is yes)
--with-xincludes=/usr/X11R6/include
(when /X11 was added after /include, "make" stopped due to an error. So /X11 removed)
--with-libraries=/usr/X11R6/lib/
--without-perl (--> no perl)
--enable-hdri (--> it is in HDRI mode)
--with-gslib=yes (--> gslib is installed)
--with-lcms=yes (--> lcms is not installed)
--with-wmf=yes (--> wmf is not installed)

At last, gslib is installed. lcms and wmf are not installed, yet. bzlib, fontconfig, freetype, gvc, jbig, jpeg, jng, jp2, png, rsvg, tiff, x11, xml, zlib are installed.

(MAKE, SUDO MAKE INSTALL)
They went ok.

("DISPLAY" PROBLEM!!)
(1) Typing "display logo.gif" with X11 gives "Segmentation fault". Attempts with images in pgm, tiff, jpeg formats also failed in the same way.
/Applications/ImageMagick/ImageMagick-6.7.0-10/display logo.gif (RETURN)
Segmentation fault.

(2) With X11 running, display-command from the user directory gives "Segmentation fault".
~/Users/MyName/display logo.gif (RETURN)
Segmentation fault.

(3) Without x11 running when I typed "display logo.gif", I got "unable to open ...".
~/Users/MyName/display logo.gif (RETURN)
display: unable to open X server `:0.0' @ error/display.c/DisplayImageCommand/428

(4) I added the following line in ~/.profle file. But the above situations do not change. Typing "$env" ensures that DISPLAY=0.0.
export DISPLAY="0:0"

(5) logo.gif image is fine, i.e. 640x480 8bit 300k, when I checked it with ImageJ. The image was created using CONVERT command.

(6) X11 works fine from GNUplot ver4.4 (Darwin 10.8.0) that is already installed on my Mac.
A graph of sine curve can be displayed wihthout any troubles.


("MAKE CHECK" freezed!!)
I ran "make check". After many lines displayed, it freezed after showing the folloing lines.

PASS test/validate-compare.sh
PASS test/validate-composite.sh
PASS test/validate-convert.sh
PASS test/validate-identify.sh
PASS test/validate-import.sh

****** here, it is freezed. Nothing happens after this ine.

I do not know how to proceed further in order to cure this problem.

Thank you very much for your support in advance!!
yshouisir
Posts: 7
Joined: 2011-11-15T00:36:31-07:00
Authentication code: 8675308

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by yshouisir »

Can anyone guide me toward the solution or give me a hint how to solve this issue? So far I cannot find the same problem with a clear solution on the internet or in this forum.

It seems that my post is out of topic. I apologize if my post is too easy and obvious for the forum participants. Since I am not an expert on computing, it is greatly appreciated if anyone can guide me or give me a hint.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by magick »

The freeze for the validation is ok. You did not wait long enough (there are hundreds of unit tests), it will eventually finish.

Download ImageMagick 6.7.3-8, the latest release. Does it also produce a segmentation fault? If so, try
  • gdb display
    where
and post the output of the where command. It will help us trace the source of the fault.
yshouisir
Posts: 7
Joined: 2011-11-15T00:36:31-07:00
Authentication code: 8675308

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by yshouisir »

Thank you so much for your reply and advice!!!!

Following your advice, I uninstalled ImageMagick-6.7.0-10, and installed 6.7.3-8 exactly as I described above, i.e. "configure" and installing delegates libraries are same. Unfortunately, "display" gave me "segmentation fault" when I typed "display logo.gif" with X11 server running. "unable to open X" also appeared as the above post.

When "gdb display" is typed, the following long messages appeared. You will find the output when "where"
is typed at the end of this list, i.e. it was "No stack".

GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011)
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 "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/alloc.o" - no debug information available for "../../../gcc-4.6.0/libgomp/alloc.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/barrier.o" - no debug information available for "../../../gcc-4.6.0/libgomp/barrier.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/critical.o" - no debug information available for "../../../gcc-4.6.0/libgomp/critical.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/env.o" - no debug information available for "../../../gcc-4.6.0/libgomp/env.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/error.o" - no debug information available for "../../../gcc-4.6.0/libgomp/error.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/iter.o" - no debug information available for "../../../gcc-4.6.0/libgomp/iter.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/iter_ull.o" - no debug information available for "../../../gcc-4.6.0/libgomp/iter_ull.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/loop.o" - no debug information available for "../../../gcc-4.6.0/libgomp/loop.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/loop_ull.o" - no debug information available for "../../../gcc-4.6.0/libgomp/loop_ull.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/ordered.o" - no debug information available for "../../../gcc-4.6.0/libgomp/ordered.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/parallel.o" - no debug information available for "../../../gcc-4.6.0/libgomp/parallel.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/sections.o" - no debug information available for "../../../gcc-4.6.0/libgomp/sections.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/single.o" - no debug information available for "../../../gcc-4.6.0/libgomp/single.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/task.o" - no debug information available for "../../../gcc-4.6.0/libgomp/task.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/team.o" - no debug information available for "../../../gcc-4.6.0/libgomp/team.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/work.o" - no debug information available for "../../../gcc-4.6.0/libgomp/work.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/lock.o" - no debug information available for "../../../gcc-4.6.0/libgomp/config/posix/lock.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/proc.o" - no debug information available for "../../../gcc-4.6.0/libgomp/config/bsd/proc.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/sem.o" - no debug information available for "../../../gcc-4.6.0/libgomp/config/posix/sem.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/bar.o" - no debug information available for "../../../gcc-4.6.0/libgomp/config/posix/bar.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/time.o" - no debug information available for "../../../gcc-4.6.0/libgomp/config/posix/time.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/fortran.o" - no debug information available for "../../../gcc-4.6.0/libgomp/fortran.c".

warning: Could not find object file "/Users/admin/build/x86_64-apple-darwin10.7.0/libgomp/.libs/affinity.o" - no debug information available for "../../../gcc-4.6.0/libgomp/config/posix/affinity.c".
...........................
warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/blocksort.o" - no debug information available for "blocksort.c".

warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/huffman.o" - no debug information available for "huffman.c".

warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/crctable.o" - no debug information available for "crctable.c".

warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/randtable.o" - no debug information available for "randtable.c".

warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/compress.o" - no debug information available for "compress.c".

warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/decompress.o" - no debug information available for "decompress.c".

warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/bzlib.o" - no debug information available for "bzlib.c".
............................ done

(gdb) where
No stack.
(gdb)

I do not understand the above messages. At least I know the output of "where" is "No stack". Could you please guide or give me an advice to solve this issue?
Thank you very much for your support in advance.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by magick »

Before you type 'where', type 'run' to actually run the display program and have it fail. The 'where' command then displays the source of the fault which we can then use to debug the problem.
yshouisir
Posts: 7
Joined: 2011-11-15T00:36:31-07:00
Authentication code: 8675308

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by yshouisir »

Thank you very much for your advice. Now I realize it is a debugger. This is what I get using gdb.

(DISPLAY)
> gdb display
> run
After this, lines of warning appeared as listed in the previous post, and them finished with the following message.
................................................................................................. done
display: unable to open X server `:0.0' @ error/display.c/DisplayImageCommand/428.
Program exited with code 01.
(gdb) where
No stack.

(CONVERT, MOGRIFY, COMPOSITE)
I tested the same procedure for these three commands. Each command finished without any problems as below.
>run
Program exited normally.

Thank you very much for your support in advance.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by magick »

The debugger suggests no faults, you must get a fault before you can get a stack trace. Instead you get "unable to open X server " which means there is also no X server available.
yshouisir
Posts: 7
Joined: 2011-11-15T00:36:31-07:00
Authentication code: 8675308

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by yshouisir »

Thank you very much for your reply and I feel sorry for my easy mistake. This time, X11 was running first by clicking its icon, and then I typed "gdb display" and "run". After showing "....done", some messages appeared as follows. Then "where" command gave the following messages.
................................................................................................. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x000000010145929d in _X11TransWrite ()
(gdb) where
#0 0x000000010145929d in _X11TransWrite ()
#1 0x0000000101451c99 in _XFlushInt ()
#2 0x00000001014526ed in _XReply ()
#3 0x000000010143cf8c in XInternAtom ()
#4 0x00000001001a84a7 in XInitializeWindows (display=0x10182cc00, resource_info=0x7fff5fbfe6e0) at magick/xwindow.c:5152
#5 0x00000001000801a1 in XDisplayImage (display=0x10182cc00, resource_info=<value temporarily unavailable, due to optimizations>, argv=0x101714e30, argc=1, image=0x7fff5fbfe6c0, state=0x7fff5fbfe6c8) at magick/display.c:14415
#6 0x0000000100519f0e in DisplayImageCommand (image_info=0x10184a600, argc=1, argv=0x101714e30, wand_unused_metadata=<value temporarily unavailable, due to optimizations>, exception=0x101714600) at wand/display.c:563
#7 0x000000010056a977 in MagickCommandGenesis (image_info=0x101830200, command=0x100518d30 <DisplayImageCommand>, argc=1, argv=0x7fff5fbffa40, metadata=0x0, exception=0x101714600) at wand/mogrify.c:170
#8 0x0000000100001e86 in DisplayMain [inlined] () at /Applications/ImageMagick/ImageMagick-6.7.3-8/utilities/display.c:89
#9 0x0000000100001e86 in main (argc=1, argv=0x7fff5fbffa40) at utilities/display.c:100
(gdb)

Thank you very much for your support in advance.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by magick »

The fault fails @ XInternAtom () which is not in the ImageMagick but install in the system library, libX11. This could be caused by memory corruption or a bug in libX11. Can you download / install / test the latest ImageMagick release, ImageMagick 6.7.3-10? Does that version work or does it exhibit the same fault?
yshouisir
Posts: 7
Joined: 2011-11-15T00:36:31-07:00
Authentication code: 8675308

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by yshouisir »

Thank you very much for your reply. ImageMagick-6.7.3-8 was uninstalled after "sudo make uninstall" and "sudo make distclean". I donwloaded ImageMagick.tar.gz and unpacked it to get ImageMagick-6.7.3-10. After installation of delegates libraries and configure command, Image-6.7.3-10 was successfully installed.

(1) situation after 6.7.3-10 installation
Unfortunately the fault situation did not change even after this installation.
>display logo.gif
--> unable to open server (without X11 running)
--> segmentation fault (with X11 running)

>gdb display
(gdb)run --> (identical fault message was displayed as in my previous post)
(gdb)where --> (identical fault message was displayed as in my previous post except for one line below)

#8 0x0000000100001e86 in DisplayMain [inlined] () at /Applications/ImageMagick/ImageMagick-6.7.3-10/utilities/display.c:89
The version number was changed from ImageMagick-6.7.3-8 to ImageMagick-6.7.3-10 as it should be.

(2) X11
With X11, GNUplot shows mathematical graphs without problems. To configure, I once used "--x-libraries=/usr/X11R6/include/X11" instead of "--x-libraries=/usr/X11R6/include". I do not know if this could damage the files.

Thank you very much for your support in advance.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by magick »

We wish we could help but we cannot reproduce the problem. We're on Mac OS Lion with ImageMagick 6.7.3-10 and images display without fault or complaint. Fred, can you try it on your Mac and see if you can reproduce this problem?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by fmw42 »

I am on Mac OSX Snow Leopard running IM 6.7.3.10 Q16 (INTEL Mac Mini). I installed all my delegates using MacPorts, except for Xcode tools which I downloaded from Apple Support as the latest version for Snow Leopard. X11 was already installed. I then manually installed IM from source (with appropriate references to /opt to get the delegates), but in /usr/local/bin rather than /opt/local/bin, i.e. I did not use MacPorts to install IM. With this configuration, I have no problem with either

display logo:

or

convert logo: show

I previously added export DISPLAY=:0 into my .profile file
yshouisir
Posts: 7
Joined: 2011-11-15T00:36:31-07:00
Authentication code: 8675308

Re: "Display" problem with ImageMagick 6.7.0-10: "Segmentati

Post by yshouisir »

Finally ImageMagick has started working on my Mac 10.6.8. Now I am using IM6.7.5.
It took such a long time...
Eventually I did clean installation for Mac OS, and found info about IM installation with more simplified options.
Thank you very much for your supports and the wonderful software!!
Post Reply