Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 41612

Summary: Gnumeric segfaults with -Os
Product: Gentoo Linux Reporter: Jonathan Heaney <agent_jdh>
Component: [OLD] GNOMEAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: High    
Version: 1.4   
Hardware: x86   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jonathan Heaney 2004-02-14 18:01:58 UTC
I use -Os in /etc/make.conf, and Gnumeric always produces segfaults when compiled with -Os when moving between cells.  Editing /etc/make.conf to use -O2 then re-rmerging gnumeric results in a binary that works.

Is there any way to force -O to use -O2 in the ebuild.

Thanks.
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2004-02-15 03:13:46 UTC
emerge info? you should always include that in all your bug reports.
Comment 2 Alastair Tse (RETIRED) gentoo-dev 2004-02-15 03:14:16 UTC
and you should also give some more information, like console output, gnumeric version, etc.
Comment 3 Jonathan Heaney 2004-02-15 07:14:58 UTC
The subject of the bug report should have been "Gnumeric segfaults when compiled with -Os"

Gnumeric version 1.2.4 and 1.2.6 both have the same issue.  This has been raised in the forums in the past

http://forums.gentoo.org/viewtopic.php?t=115316&highlight=gnumeric+segfault

When Gnumeric segfaults, it starts bug-buddy, and this is the backtrace/debug output -
Backtrace was generated from '/usr/bin/gnumeric'

(no debugging symbols found)...Using host libthread_db library "/lib/libthread_db.so.1".
(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
0x40b099a8 in waitpid () from /lib/libpthread.so.0
#0  0x40b099a8 in waitpid () from /lib/libpthread.so.0
#1  0x400d7a94 in ?? () from /usr/lib/libgnomeui-2.so.0
#2  0x400a4ce1 in libgnomeui_module_info_get () from /usr/lib/libgnomeui-2.so.0
#3  0xbfffe7bc in ?? ()

I use CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer"

This can be fixed in one of two ways

1.  Modify CFLAGS to ="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"

or 

2. Modify gnumeric ebuild, adding in the line after src_compile:

src_compile() {
        replace-flags "-Os" "-O2"
                                                                                
        econf \

I've tried both, 2. is preferred, both result in a Gnumeric binary that does not segfault when you move out of a cell.
Comment 4 foser (RETIRED) gentoo-dev 2004-02-15 09:44:43 UTC
you should debugbuild gnumeric (add 'inherit debug' on top of the ebuild & lower your CFLAGS) to get a useful backtrace.
Comment 5 Jonathan Heaney 2004-02-15 10:27:02 UTC
OK I added debug to the inherit line in the ebuild, commented out my alteratin to force -Os to -O2, changed my CFLAGS to -Os and nothing else, and ran gnumeric through gdb.  Here's the output:

GNU gdb 6.0
....
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
 
(gdb) run
Starting program: /usr/bin/gnumeric
 
Program received signal SIGSEGV, Segmentation fault.
format_number (result=0x83e71d8, number=6.8307876656754715e-269, col_width=0,
    entry=0x0, date_conv=0x835fad8) at format.c:1414
1414    format.c: No such file or directory.
        in format.c
(gdb)

And running without gdb, here's the bug-buddy backtrace-

Backtrace was generated from '/usr/bin/gnumeric'

Using host libthread_db library "/lib/libthread_db.so.1".
0x40b099a8 in waitpid () from /lib/libpthread.so.0
#0  0x40b099a8 in waitpid () from /lib/libpthread.so.0
#1  0x400d7a94 in ?? () from /usr/lib/libgnomeui-2.so.0
#2  0x400a4ce1 in libgnomeui_module_info_get () from /usr/lib/libgnomeui-2.so.0
#3  0xbfffe5cc in ?? ()
Comment 6 foser (RETIRED) gentoo-dev 2004-02-29 09:57:41 UTC
type 'bt' in gdb after the crash to get a full backtrace, from there we can maybe take it upstream.
Comment 7 Priit Laes (IRC: plaes) 2004-02-29 13:45:27 UTC
It's already reported in upstream: http://bugs.gnome.org/show_bug.cgi?id=128834
And happens on my machine too...
Comment 8 foser (RETIRED) gentoo-dev 2004-03-01 08:38:42 UTC
see thats what we like to know about

closing UPSTREAM, added -Os filter for the time being.