Bug 122542 - chemtool segmentation fault
Summary: chemtool segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: X11 Applications (show other bugs)
Version: Final
Hardware: x86 SUSE Other
: P5 - None : Normal
Target Milestone: ---
Assignee: Michal Marek
QA Contact: Stefan Dirsch
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-10 18:55 UTC by Enrico Licini
Modified: 2005-10-25 11:11 UTC (History)
0 users

See Also:
Found By: Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
ltrace /usr/bin/chemtool (32.63 KB, application/x-bzip2)
2005-10-11 18:55 UTC, Enrico Licini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Enrico Licini 2005-10-10 18:55:44 UTC
The program Chemtool (2D chemical drawing program) gives a  segmentation fault 
at startup due to a missing package (openbabel 
http://openbabel.sourceforge.net/) which is not included in SUSE linux 10.0
Comment 1 Michael Gross 2005-10-11 13:48:34 UTC
Let's suppose the executable of the program is located at
/usr/X11R6/bin/chemtool, then please provide the output of `ldd
/usr/X11R6/bin/chemtool'.

A backtrace (made with gdb or ltrace/strace) would also be helpful. 
For further information, please read: http://bugs.opensuse.org 
Comment 2 Enrico Licini 2005-10-11 18:09:59 UTC
Chemtool is located in /usr/bin/chemtool    
ldd output follows:    
ldd /usr/bin/chemtool    
        linux-gate.so.1 =>  (0xffffe000)    
        libgtk-1.2.so.0 => /opt/gnome/lib/libgtk-1.2.so.0 (0x40030000)    
        libgdk-1.2.so.0 => /opt/gnome/lib/libgdk-1.2.so.0 (0x40186000)    
        libgmodule-1.2.so.0 => /opt/gnome/lib/libgmodule-1.2.so.0 (0x401bf000)    
        libglib-1.2.so.0 => /opt/gnome/lib/libglib-1.2.so.0 (0x401c2000)    
        libdl.so.2 => /lib/libdl.so.2 (0x401e8000)    
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x401ec000)    
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x401f4000)    
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40203000)    
        libm.so.6 => /lib/tls/libm.so.6 (0x402fc000)    
        libc.so.6 => /lib/tls/libc.so.6 (0x40322000)    
        /lib/ld-linux.so.2 (0x40000000)    
    
If you start chemtool from console you get this message:   
  
enrico@dhcppc0:~> chemtool   
sh: babel: command not found   
Consider installing Babel/OpenBabel for file format conversions...   
Segmentation fault   
   
   
    
Comment 3 Michael Gross 2005-10-11 18:28:16 UTC
Every library was found, so this is not a library-problem.
Please attach (!) the output of `ltrace /usr/bin/chemtool'.
Comment 4 Michael Gross 2005-10-11 18:29:27 UTC
It say's `consider' here which indicates that this external command is not
required to run this problem. Let's see where it crashes exactly.
Comment 5 Enrico Licini 2005-10-11 18:55:44 UTC
Created attachment 53763 [details]
ltrace  /usr/bin/chemtool
Comment 6 Michal Marek 2005-10-13 10:32:58 UTC
Ok, I can reproduce it, thanks for the report. I'll try to fix it soon. 
Comment 7 Michal Marek 2005-10-18 13:17:32 UTC
It's caused by a bug in gcc-4.0, which makes things little bit
complicated. A workaround is

a) compile with an older gcc

b) don't compile with -O2

c) apply this patch to the source (note that there isn't any bug in
chemtool, this just avoids the gcc bug):
--- main.c
+++ main.c
@@ -2909,7 +2909,7 @@
   int tmplnum[125];
   char bondnums[15][3];
   char msgtmp[100];
-  const char *fontsizelabel[7]={"8","10","12","14","17","20","24"};
+  static const char *fontsizelabel[7]={"8","10","12","14","17","20","24"};
   GtkWidget *aboutw,*helpw,*helptext;
   GtkWidget *vbox;
   GtkWidget *hbox;

See also the note on authors home page:
http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html
Comment 9 Enrico Licini 2005-10-18 18:20:52 UTC
Thank you!
I changed the summary of this bug to a more generic form.
Can Novel provide an rpm compiled with the patch above?
Comment 11 Michal Marek 2005-10-21 13:59:46 UTC
(In reply to comment #9)
> Can Novel provide an rpm compiled with the patch above?

I don't know whether or not there will be an update for SUSE Linux 10.0,
but you can try the patched package from OpenSUSE:

http://ftp.opensuse.org/pub/opensuse/distribution/SL-OSS-edge/inst-source/suse/i586/chemtool-1.6.7-2.i586.rpm


Comment 12 Andreas Jaeger 2005-10-25 06:26:12 UTC
Let's not do the update for 10.0.  I've opened a bugreport for the GCC issue.

Comment 13 Michal Marek 2005-10-25 11:11:38 UTC
Actually, there was a bug in chemtool (part of stack overwritten), it
just didn't show up until gcc-4.0 on i386. Many thanks to Richard
Guenther for finding the bug. The fixed package should appear in
OpenSUSE edge soon.