Compiling /Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/src/../lisp/buff-menu.el wd=/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/lisp; subdirs=`(cd $wd; find . -type d -print)`; for file in $subdirs; do case $file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; *) wins="$wins $wd/$file" ;; esac; done; \ echo Directories: $wins; \ EMACSLOADPATH=/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/lisp LC_ALL=C ../src/bootstrap-emacs -batch --no-site-file --multibyte -l autoload --eval '(setq generated-autoload-file "/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/lisp/loaddefs.el")' -f batch-update-autoloads $wins make[2]: *** [compile-onefile] Segmentation Fault make[2]: *** [compile-onefile] Segmentation Fault make[2]: Leaving directory `/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/lisp' % src/bootstrap-emacs Segmentation fault % file src/bootstrap-emacs src/bootstrap-emacs: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped % truss src/bootstrap-emacs execve("src/bootstrap-emacs", 0x08046D28, 0x08046D30) argc = 1 open("/usr/lib/ld.so.1", O_RDONLY) = 3 fxstat(2, 3, 0x08046BE0) = 0 mmap(0x00000000, 218196, PROT_READ|PROT_EXEC, MAP_SHARED, 3, 0) = 0xFEE9F000 mmap(0x00000000, 241664, PROT_READ|PROT_EXEC, MAP_SHARED, 3, 0) = 0xFEE63000 munmap(0xFEE63000, 241664) = 0 mmap(0x00000000, 307200, PROT_READ|PROT_EXEC, MAP_SHARED, 3, 0) = 0xFEE53000 munmap(0xFEE53000, 53248) = 0 mmap(0xFEE60000, 160502, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xFEE60000 munmap(0xFEE88000, 65536) = 0 mmap(0xFEE98000, 10328, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 163840) = 0xFEE98000 open("/dev/zero", O_RDWR) = 4 mmap(0xFEE9A000, 2136, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFEE9A000 munmap(0xFEE9B000, 12288) = 0 close(3) = 0 resolvepath("/usr/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14 getcwd("/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1", 1003) = 0 resolvepath("/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/src/bootstrap-emacs", "/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/src/bootstrap-emacs", 1023) = 93 mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFF0000 stat64("/Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r2/work/emacs-23.1/src/bootstrap-emacs", 0x08046AC0) = 0 open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT sysconfig(_CONFIG_PAGESIZE) = 4096 close(4) = 0 Incurred fault #6, FLTBOUNDS %pc = 0x00030003 siginfo: SIGSEGV SEGV_MAPERR addr=0x00030003 Received signal #11, SIGSEGV [default] siginfo: SIGSEGV SEGV_MAPERR addr=0x00030003 % ls -la src/bootstrap-emacs -rwxr-xr-x 1 x sys 9741300 Nov 24 21:23 src/bootstrap-emacs
I'm getting the same (similar ?) error with emacs 23.2 (although I couldn't find the bootstrap-emacs file to investigate further). # emerge --info Portage 2.1.8.3 (hardened/linux/x86/10.0, gcc-4.4.4, glibc-2.11.2-r0, 2.6.30 i686) ================================================================= System uname: Linux-2.6.30-i686-Intel-R-_Core-TM-2_CPU_E7400_@_2.80GHz-with-gentoo-2.0.1 Timestamp of tree: Tue, 21 Sep 2010 14:45:01 +0000 app-shells/bash: 4.1_p7 dev-lang/python: 2.6.5-r3, 3.1.2-r4 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.4.3-r4 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.65-r1 sys-devel/automake: 1.9.6-r2, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.3.4, 4.4.4-r2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.30-r1 ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://91.121.125.139/gentoo-distfiles/ http://91.121.125.139/gentoo-distfiles/ http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en fr" MAKEOPTS="-j3 -s" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="acl apache2 berkdb bzip2 calendar cli cracklib crypt cups curl cxx dri emacs gd gdbm glibc-omitfp hardened iconv json modules mudflap mysql ncurses nls nptl nptlonly openmp pam pcntl pcre perl pg-intdatetime pic png posix postgres pppd python readline reflection session sqlite sqlite3 ssl sysfs tcpd unicode urandom x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en fr" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Created attachment 248381 [details] build log build log
(In reply to comment #1) > I'm getting the same (similar ?) error with emacs 23.2 (although I couldn't > find the bootstrap-emacs file to investigate further). Runtime problems like this are hard to debug. I cannot reproduce the failure here, and without a stack trace there's nothing that could give me a clue where to start.
Created attachment 248399 [details] build log without makeopts="-j3 -s" Here's a stack trace (added ggdb and removed fomit-frame-pointer from CFLAGS to get it). Hopefully that gives you a hint about what is wrong. In any case, I'll try to give it a closer look tomorrow if I have time, but I never looked into the guts of emacs. Thanks in advance. # gdb ./src/temacs GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (gdb) run --batch --load loadup bootstrap Starting program: /var/tmp/portage/app-editors/emacs-23.2/work/emacs-23.2/src/temacs --batch --load loadup bootstrap Executing new program: /var/tmp/portage/app-editors/emacs-23.2/work/emacs-23.2/src/temacs Program received signal SIGSEGV, Segmentation fault. 0x080a2784 in Fdefine_charset_internal (nargs=17, args=0xbfffef10) at charset.c:1285 1285 val = Fcons (XCAR (tail), XCDR (tail)); (gdb) bt #0 0x080a2784 in Fdefine_charset_internal (nargs=17, args=0xbfffef10) at charset.c:1285 #1 0x080a322e in define_charset_internal (name=<value optimized out>, dimension=<value optimized out>, code_space=0x81c7f6d "", min_code=0, max_code=1114111, iso_final=-1, iso_revision=0, emacs_mule_id=-1, ascii_compatible=1, supplementary=0, code_offset=0) at charset.c:1358 #2 0x080a375a in syms_of_charset () at charset.c:2443 #3 0x080dc81a in main (argc=5, argv=0xbffff3f4) at emacs.c:1386 (gdb) bt full #0 0x080a2784 in Fdefine_charset_internal (nargs=17, args=0xbfffef10) at charset.c:1285 tail = 48 attrs = 138211349 val = <value optimized out> hash_code = 34541176 hash_table = <value optimized out> i = <value optimized out> j = <value optimized out> charset = {id = 2, hash_index = 2, dimension = 3, code_space = {0, 255, 256, 256, 0, 255, 256, 65536, 0, 16, 17, 1114112, 0, 0, 1, 1114112}, code_space_mask = 0xb7f3ffb8 "malloc_consolidate", code_linear_p = 1, iso_chars_96 = 0, iso_final = -1, iso_revision = 0, emacs_mule_id = -1, ascii_compatible_p = 1, supplementary_p = 0, compact_codes_p = 0, method = CHARSET_METHOD_OFFSET, min_code = 0, max_code = 1114111, char_index_offset = 0, min_char = 0, max_char = 1114111, invalid_code = 1114112, fast_map = '?' <repeats 96 times>, '\0' <repeats 93 times>, code_offset = 0, unified_p = 0} id = 2 dimension = <value optimized out> new_definition_p = 1 nchars = 138029792 #1 0x080a322e in define_charset_internal (name=<value optimized out>, dimension=<value optimized out>, code_space=0x81c7f6d "", min_code=0, max_code=1114111, iso_final=-1, iso_revision=0, emacs_mule_id=-1, ascii_compatible=1, supplementary=0, code_offset=0) at charset.c:1358 args = {138164714, 12, 138211269, 0, 4456444, 138119370, 0, 138119370, 138119418, 138119370, 138119370, 0, 138119370, 138119370, 138119370, 138119370, 138109086} plist = {138165482, 138164714, 138165506, 12, 138165530, 138211269, 138165554, 138119370, 138165578, 138119370, 138165602, 138119418, 138165626, 0} val = <value optimized out> i = <value optimized out> #2 0x080a375a in syms_of_charset () at charset.c:2443 No locals. #3 0x080dc81a in main (argc=5, argv=0xbffff3f4) at emacs.c:1386 dummy = -1207962364 stack_bottom_variable = 0 '\0' do_initial_setlocale = 1 skip_args = 1 rlim = {rlim_cur = 8388608, rlim_max = 18446744073709551615} no_loadup = 2 junk = 0x0 dname_arg = 0x0 (gdb)
(In reply to comment #4) > (gdb) bt > #0 0x080a2784 in Fdefine_charset_internal (nargs=17, args=0xbfffef10) at > charset.c:1285 > #1 0x080a322e in define_charset_internal (name=<value optimized out>, > dimension=<value optimized out>, code_space=0x81c7f6d "", min_code=0, > max_code=1114111, iso_final=-1, > iso_revision=0, emacs_mule_id=-1, ascii_compatible=1, supplementary=0, > code_offset=0) at charset.c:1358 > #2 0x080a375a in syms_of_charset () at charset.c:2443 > #3 0x080dc81a in main (argc=5, argv=0xbffff3f4) at emacs.c:1386 This looks very similar to bug 285778.
Concerning the original Solaris issue, that could be this upstream bug: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4559> (And again, I prefer a gdb stack trace to strace/truss output. ;-)
Bugs #285778 and upstream 4559 do look similar, but none of the suggestions in those bugs seem to help. * I do not have --fstack-protector-all (or anything fancy) in my CFLAGS (unless the hardened profile adds it for me) * switching off address space randomization does nothing * config.guess guesses my config right * manually downloading the tarball and running "./configure --without-x;make" fails in the same maner One thing to note about my setup is that I migrated to the hardened profile about two weeks ago. I did however "emerge -e system" (which includes emacs) and a lot of other packages since then. I did find a workaround however : via gcc-config, change to a non-hardened compiler (i686-pc-linux-gnu-4.4.4-vanilla instead of i686-pc-linux-gnu-4.4.4). Emerge emacs works with that compiler. But this isn't a very satisfying solution.
Also seeing this on hardened using gcc-4.4.3-r3. Switching to the hardenednossp variant of gcc allows the compile to succeed. The ssp variants add -fstack-protector-all to the default arguments, so that is presumably what is causing this.
Does it compile properly if you add a line "filter-flags -fstack-protector-all" to src_configure?
(In reply to comment #9) > Does it compile properly if you add a line "filter-flags -fstack-protector-all" > to src_configure? > No, no change. Guess my speculation was incorrect, then.
(In reply to comment #10) > (In reply to comment #9) > > Does it compile properly if you add a line "filter-flags -fstack-protector-all" > > to src_configure? > > > > No, no change. Guess my speculation was incorrect, then. > Actually, it looks like "filter-flags -fstack-protector-all" does nothing with gcc newer than 4.1 (because it tries to add the nonexistent -fno-stack-protector-all flag). Adding "filter-flags -fstack-protector" does let emacs compile.
The emacs ebuilds used to "filter-flags -fstack-protector-all" previously (you still find it in the emacs-21* ebuilds). Looks like we have to re-add this, until upstream provides us with a real solution. Could you please report the x86 (or amd64?) issue upstream, too?
(In reply to comment #12) > Could you please report the x86 (or amd64?) issue upstream, too? > Done. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7186
Created attachment 250157 [details, diff] simple patch fixing the problem Also submitted to upstream bug.
(In reply to comment #12) > The emacs ebuilds used to "filter-flags -fstack-protector-all" previously This should of course read "filter-flags -fstack-protector" (without -all).
(In reply to comment #14) > Created an attachment (id=250157) [details] > simple patch fixing the problem Hm, src/m/sparc.h always defines NO_ARG_ARRAY, therefore I'm still not convinced that the Solaris and Linux/x86 bugs are the same issue. @Prefix team: Does adding "filter-flags -fstack-protector" fix the problem on Solaris?
solaris case here is on intel don't think the issues are the same dropping CFLAGS back to "-pipe" also exhibits the same behaviour Starting program: /Library/Gentoo/var/tmp/portage/app-editors/emacs-23.1-r3/work/emacs-23.1/src/bootstrap-emacs Cannot access memory at address 0x74a118ec (gdb)
I believe that the Solaris and x86/hardened bugs are separate issues. Let's reserve this bug for the original Solaris problem. The x86/hardened issue will be handled in bug 285778.
Recently, I've added further CFLAGS filtering to the emacs:23 ebuilds. Maybe it's worthwhile to test this again.
[ebuild NS ] app-editors/emacs-23.3 [22.3-r4] USE="X xpm -Xaw3d (-alsa) (-aqua) -dbus -gconf -gif (-gpm) -gtk -gzip-el (-hesiod) -jpeg -kerberos (-m17n-lib) -motif -png -sound -source -svg -tiff -toolkit-scroll-bars -xft" 37,785 kB ... make[2]: *** [autoloads] Error 139 make[2]: *** [compile-onefile] Segmentation Fault So, unfortunately still same problem.
I've managed to emerge emacs-23.4.2 (GNU Emacs 23.4.2), it sort of works too.
ok, on Sparc it still segfaults.
(In reply to comment #22) > ok, on Sparc it still segfaults. Have you tried the advice given in the upstream bug: | Passing an explicit "--build=x86_64-pc-solaris2.10" to the configure script | or setting CC="<compiler> -m64" solves the issue.
(In reply to comment #23) > (In reply to comment #22) > > ok, on Sparc it still segfaults. > > Have you tried the advice given in the upstream bug: > | Passing an explicit "--build=x86_64-pc-solaris2.10" to the configure script > | or setting CC="<compiler> -m64" solves the issue. This is Sparc, so how can any of this advice be of any use. Besides, doesn't portage do this already?
(In reply to comment #24) > This is Sparc, so how can any of this advice be of any use. Besides, > doesn't portage do this already? Yes, I was getting confused of the different issues all collected here. As this bug was about Solaris on Intel originally (as is the upstream bug <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4559>), maybe it would be better to close it and open a new bug for the Sparc issue?
In my opinion this was about *any* solaris, on *any* architecture emacs SIGILL during compile. It looks like upstream has fixed this for intel archs now, so we can reduce. I'll have to do some proper verification before concluding that intel-based Solaris is fixed now.
Verified to build on Solaris 10/x86, crashes on Solaris 10/x64 and OpenIndiana/x64.
subject fix, sorry
SIGILL points pretty much into the direction of an alignment error, but I think we can safely say noone cares enough at this point.