Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 358177 - app-editors/emacs-23.3 segmentation fault with -fstrict-aliasing
Summary: app-editors/emacs-23.3 segmentation fault with -fstrict-aliasing
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: GNU Emacs project
URL: http://debbugs.gnu.org/cgi/bugreport....
Whiteboard:
Keywords:
Depends on:
Blocks: 915000
  Show dependency tree
 
Reported: 2011-03-10 07:50 UTC by Ulrich Müller
Modified: 2023-10-01 08:48 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,279.90 KB, text/plain)
2011-03-10 07:52 UTC, Ulrich Müller
Details
emerge --info (emerge-info,4.70 KB, text/plain)
2011-03-10 07:52 UTC, Ulrich Müller
Details
gdb backtrace (gdb-backtrace,15.60 KB, text/plain)
2011-03-10 07:53 UTC, Ulrich Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2011-03-10 07:50:57 UTC
Emacs 23.3 built with USE="X Xaw3d -gtk -motif" fails with a
segmentation fault at runtime. This is with -O2 in CFLAGS, on amd64.

The problem disappears when -fno-strict-aliasing is added to CFLAGS.

I've narrowed it down further:
- compile src/xterm.c with -O1,
  compile the rest of the sources with -O2
  => Success
- compile src/xterm.c with -O2,
  compile the rest of the sources with -O1
  => Failure
- compile src/xterm.c with -O2 -fno-strict-aliasing,
  compile the rest of the sources with -O2
  => Success
- compile src/xterm.c with -O1 -fgcse -fstrict-aliasing,
  compile the rest of the sources with -O1
  => Failure
Comment 1 Ulrich Müller gentoo-dev 2011-03-10 07:52:24 UTC
Created attachment 265413 [details]
build log
Comment 2 Ulrich Müller gentoo-dev 2011-03-10 07:52:51 UTC
Created attachment 265415 [details]
emerge --info
Comment 3 Ulrich Müller gentoo-dev 2011-03-10 07:53:33 UTC
Created attachment 265417 [details]
gdb backtrace
Comment 4 Ulrich Müller gentoo-dev 2011-03-10 08:09:00 UTC
FWIW, this happens with all of GCC 4.3.5, 4.4.5, and 4.5.2.
Comment 5 Ulrich Müller gentoo-dev 2011-03-10 08:42:48 UTC
Reported upstream.

I'll add -fno-strict-aliasing as a workaround in the ebuild.
Comment 6 Ulrich Müller gentoo-dev 2023-10-01 08:48:36 UTC
Quoting from the upstream bug <https://debbugs.gnu.org/8217#32>:

... I find that the workaround of adding -fno-strict-aliasing to CFLAGS wasn't present for version 24.1, and there never were any bugs reported to us. This seems to indicate that the problem had disappeared already in early Emacs 24 versions.

However, I also cannot reproduce this any more with Emacs 23.4 and GCC 5.4.0 (nor with GCC 4.9.3). So it may well be that this issue wasn't with Emacs but with GCC.