<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>41612</bug_id>
          
          <creation_ts>2004-02-14 18:01 0000</creation_ts>
          <short_desc>Gnumeric segfaults with  -Os</short_desc>
          <delta_ts>2004-03-01 08:38:42 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>GNOME</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>UPSTREAM</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>agent_jdh@yahoo.co.uk</reporter>
          <assigned_to>gnome@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>agent_jdh@yahoo.co.uk</who>
            <bug_when>2004-02-14 18:01:58 0000</bug_when>
            <thetext>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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>liquidx@gentoo.org</who>
            <bug_when>2004-02-15 03:13:46 0000</bug_when>
            <thetext>emerge info? you should always include that in all your bug reports.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>liquidx@gentoo.org</who>
            <bug_when>2004-02-15 03:14:16 0000</bug_when>
            <thetext>and you should also give some more information, like console output, gnumeric version, etc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>agent_jdh@yahoo.co.uk</who>
            <bug_when>2004-02-15 07:14:58 0000</bug_when>
            <thetext>The subject of the bug report should have been &quot;Gnumeric segfaults when compiled with -Os&quot;

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&amp;highlight=gnumeric+segfault

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

(no debugging symbols found)...Using host libthread_db library &quot;/lib/libthread_db.so.1&quot;.
(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=&quot;-march=athlon-xp -Os -pipe -fomit-frame-pointer&quot;

This can be fixed in one of two ways

1.  Modify CFLAGS to =&quot;-march=athlon-xp -O2 -pipe -fomit-frame-pointer&quot;

or 

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

src_compile() {
        replace-flags &quot;-Os&quot; &quot;-O2&quot;
                                                                                
        econf \

I&apos;ve tried both, 2. is preferred, both result in a Gnumeric binary that does not segfault when you move out of a cell.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2004-02-15 09:44:43 0000</bug_when>
            <thetext>you should debugbuild gnumeric (add &apos;inherit debug&apos; on top of the ebuild &amp; lower your CFLAGS) to get a useful backtrace.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>agent_jdh@yahoo.co.uk</who>
            <bug_when>2004-02-15 10:27:02 0000</bug_when>
            <thetext>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&apos;s the output:

GNU gdb 6.0
....
This GDB was configured as &quot;i686-pc-linux-gnu&quot;...Using host libthread_db library &quot;/lib/libthread_db.so.1&quot;.
 
(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&apos;s the bug-buddy backtrace-

Backtrace was generated from &apos;/usr/bin/gnumeric&apos;

Using host libthread_db library &quot;/lib/libthread_db.so.1&quot;.
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 ?? ()
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2004-02-29 09:57:41 0000</bug_when>
            <thetext>type &apos;bt&apos; in gdb after the crash to get a full backtrace, from there we can maybe take it upstream.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plaes@plaes.org</who>
            <bug_when>2004-02-29 13:45:27 0000</bug_when>
            <thetext>It&apos;s already reported in upstream: http://bugs.gnome.org/show_bug.cgi?id=128834
And happens on my machine too...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2004-03-01 08:38:42 0000</bug_when>
            <thetext>see thats what we like to know about

closing UPSTREAM, added -Os filter for the time being.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>