Subject: building emacs 24.3 failed with seg fault during ./temacs --batch --load loadup bootstrap
From: Petr Hracek <[email-masked]>
To: [email-masked]
Date: Tue, 19 Mar 2013 10:06:37 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi folks,

I am trying to build up emacs 24.3 but it failed with segmentation fault.
I could not found any reason.

Part of build log is:
gcc -std=gnu99 -nostdlib -Demacs  -I. 
-I/builddir/build/BUILD/emacs-24.3/src -I../lib 
-I/builddir/build/BUILD/emacs-24.3/src/../lib   -pthread 
-I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 
-I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo 
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz 
-I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng15 
-I/usr/include/libdrm -I/usr/include/freetype2    -I/usr/include/alsa   
-pthread -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 
-I/usr/include/cairo -I/usr/include/libpng15 -I/usr/include/pixman-1 
-I/usr/include/freetype2 -I/usr/include/libdrm   -fopenmp 
-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 
-I/usr/include/ImageMagick-6   -I/usr/include/libxml2 
-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -pthread 
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -pthread 
-I/usr/include/gconf/2 -I/usr/include/dbus-1.0 
-I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -I/usr/include/freetype2 
-I/usr/include/freetype2    -MMD -MF deps/.d -MP 
-I/usr/include/p11-kit-1     -DMAIL_USE_LOCKF -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom 
-fasynchronous-unwind-tables   -Wl,-z,relro  -Wl,-znocombreloc  \
   -o temacs pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o dispnew.o 
frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o 
category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o 
xfaces.o xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o xgselect.o 
gtkutil.o emacsgtkfixed.o dbusbind.o emacs.o keyboard.o macros.o 
keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o 
fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o 
undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o 
font.o print.o lread.o syntax.o unexelf.o bytecode.o process.o gnutls.o 
callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o 
textprop.o composite.o xml.o profiler.o     xfont.o ftfont.o xftfont.o 
ftxfont.o  fontset.o fringe.o image.o  terminfo.o lastfile.o    
vm-limit.o ../lib/libgnu.a      -ltiff -ljpeg -lpng -lz -lm   -lgtk-3 
-lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 
-lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0   -lSM 
-lICE -lX11 -lXrender -lXft   -lasound   -lrsvg-2 -lm -lgio-2.0 
-lgdk_pixbuf-2.0 -lcairo -lgobject-2.0 -lglib-2.0 -lMagickWand-6.Q16 -lm 
-lMagickCore-6.Q16    -lrt  -L/lib -ldbus-1    -lxml2      -ltinfo  
-lgio-2.0 -lgobject-2.0 -lglib-2.0   -lgconf-2 -lglib-2.0   
-lgobject-2.0 -lglib-2.0 -lselinux -lfreetype   -lfontconfig   -lotf 
-lfreetype   -lm17n-flt -lm17n-core   -lgnutls   -lpthread   -lm -lgcc 
-lc -lgcc /usr/lib/crtn.o
test "no" = "yes" || \
   test "X" = X ||  -r temacs
cd ../lisp; make -w update-subdirs
make[3]: Entering directory 
`/builddir/build/BUILD/emacs-24.3/build-gtk/lisp'
cd /builddir/build/BUILD/emacs-24.3/lisp; subdirs=`find . -type d 
-print`; for file in $subdirs; do case $file in */.* | */.*/* | */=* | 
*/cedet* ) ;; *) wins="$wins $file" ;; esac; done; \
for file in $wins; do \
    /builddir/build/BUILD/emacs-24.3/build-aux/update-subdirs $file; \
done;
make[3]: Leaving directory `/builddir/build/BUILD/emacs-24.3/build-gtk/lisp'
if test "no" = "yes"; then \
   rm -f bootstrap-emacs; \
   ln temacs bootstrap-emacs; \
else \
   `/bin/pwd`/temacs --batch --load loadup bootstrap || exit 1; \
   test "X" = X ||  -zex emacs; \
   mv -f emacs bootstrap-emacs; \
fi
/bin/sh: line 7:  4672 Segmentation fault      (core dumped) 
`/bin/pwd`/temacs --batch --load loadup bootstrap
make[2]: *** [bootstrap-emacs] Error 1
make[2]: Leaving directory `/builddir/build/BUILD/emacs-24.3/build-gtk/src'
make[1]: *** [src] Error 2
make[1]: Leaving directory `/builddir/build/BUILD/emacs-24.3/build-gtk'

Output from gdb is:
<mock-chroot>[root@kiasportyw src]# gdb temacs
GNU gdb (GDB) Fedora (7.5.50.20130310-13.fc19)
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from 
/builddir/build/BUILD/emacs-24.3/build-gtk/src/temacs...done.
warning: File "/builddir/build/BUILD/emacs-24.3/build-gtk/src/.gdbinit" 
auto-loading has been declined by your `auto-load safe-path' set to 
"$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py".
To enable execution of this file add
     add-auto-load-safe-path 
/builddir/build/BUILD/emacs-24.3/build-gtk/src/.gdbinit
line to your configuration file "/builddir/.gdbinit".
To completely disable this security protection add
     set auto-load safe-path /
line to your configuration file "/builddir/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the 
shell:
     info "(gdb)Auto-loading safe path"
(gdb) set args --batch --load loadup bootstrap
(gdb) b Fmake_vector
Breakpoint 1 at 0x81b9390: file 
/builddir/build/BUILD/emacs-24.3/src/alloc.c, line 3031.
(gdb) b main
Breakpoint 2 at 0x80582c0: file 
/builddir/build/BUILD/emacs-24.3/src/emacs.c, line 663.
(gdb) run
Starting program: /builddir/build/BUILD/emacs-24.3/build-gtk/src/temacs 
--batch --load loadup bootstrap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Missing separate debuginfo for /lib/libgraphite2.so.3
Try: yum --disablerepo='*' --enablerepo='*debug*' install 
/usr/lib/debug/.build-id/19/1902dc8ee4d4ae2413864b662da1f5ede07ce3.debug

Breakpoint 2, main (argc=5, argv=0xbffff704) at 
/builddir/build/BUILD/emacs-24.3/src/emacs.c:663
663    {
Missing separate debuginfos, use: debuginfo-install 
GConf2-3.2.6-2.fc19.i686 ImageMagick-libs-6.8.3.9-1.fc20.i686 
alsa-lib-1.0.26-3.fc19.i686 at-spi2-atk-2.7.91-1.fc19.i686 
at-spi2-core-2.7.91-1.fc19.i686 atk-2.7.91-1.fc19.i686 
bzip2-libs-1.0.6-8.fc19.i686 cairo-1.12.14-1.fc19.i686 
cairo-gobject-1.12.14-1.fc19.i686 dbus-glib-0.100-3.fc19.i686 
dbus-libs-1.6.8-4.fc19.i686 expat-2.1.0-5.fc19.i686 
fontconfig-2.10.91-3.fc19.i686 freetype-2.4.11-2.fc19.i686 
gdk-pixbuf2-2.27.2-1.fc19.i686 glib2-2.35.8-1.fc19.i686 
glibc-2.17-3.fc19.i686 gmp-5.1.1-2.fc19.i686 gnutls-3.1.9-1.fc20.i686 
gtk3-3.7.12-1.fc19.i686 harfbuzz-0.9.13-1.fc19.i686 
jbigkit-libs-2.0-8.fc19.i686 lcms-libs-1.19-9.fc19.i686 
libICE-1.0.8-5.fc19.i686 libSM-1.2.1-5.fc19.i686 
libX11-1.5.99.901-2.fc19.i686 libXau-1.0.6-7.fc19.i686 
libXcomposite-0.4.4-3.fc19.i686 libXcursor-1.1.13-4.fc19.i686 
libXdamage-1.1.4-3.fc19.i686 libXext-1.3.1-4.fc19.i686 
libXfixes-5.0-5.fc19.i686 libXft-2.3.1-4.fc19.i686 libXi-1.7-1.fc19.i686 
libXinerama-1.1.2-4.fc19.i686 libXrandr-1.4.0-3.fc19.i686 
libXrender-0.9.7-4.fc19.i686 libXt-1.1.3-3.fc19.i686 
libXxf86vm-1.1.2-4.fc19.i686 libcroco-0.6.8-2.fc19.i686 
libdrm-2.4.42-2.fc19.i686 libffi-3.0.11-2.fc19.i686 
libgcc-4.8.0-0.17.fc20.i686 libgomp-4.8.0-0.17.fc20.i686 
libicu-50.1.2-5.fc19.i686 libjpeg-turbo-1.2.90-1.fc19.i686 
libotf-0.9.13-2.fc19.i686 libpng-1.5.13-2.fc19.i686 
librsvg2-2.37.0-2.fc19.i686 libselinux-2.1.13-9.fc19.i686 
libstdc++-4.8.0-0.17.fc20.i686 libtasn1-3.2-3.fc19.i686 
libtiff-4.0.3-5.fc19.i686 libtool-ltdl-2.4.2-12.fc19.i686 
libuuid-2.22.2-6.fc19.i686 libwayland-client-1.0.5-1.fc19.i686 
libwayland-cursor-1.0.5-1.fc19.i686 libwayland-server-1.0.5-1.fc19.i686 
libxcb-1.9-2.fc19.i686 libxkbcommon-0.2.0-2.fc19.i686 
libxml2-2.9.0-4.fc19.i686 m17n-lib-1.6.4-7.fc20.i686 
mesa-libEGL-9.1-1.fc19.i686 mesa-libGL-9.1-1.fc19.i686 
mesa-libgbm-9.1-1.fc19.i686 mesa-libglapi-9.1-1.fc19.i686 
ncurses-libs-5.9-8.20130126.fc19.i686 nettle-2.6-2.fc19.i686 
p11-kit-0.16.4-1.fc19.i686 pango-1.33.8-1.fc19.i686 
pcre-8.32-4.fc19.i686 pixman-0.28.0-3.fc19.i686 
systemd-libs-198-6.fc20.i686 xz-libs-5.1.2-4alpha.fc19.i686 
zlib-1.2.7-10.fc19.i686
(gdb) c
Continuing.
process 5413 is executing new program: 
/builddir/build/BUILD/emacs-24.3/build-gtk/src/temacs
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Missing separate debuginfo for /lib/libgraphite2.so.3
Try: yum --disablerepo='*' --enablerepo='*debug*' install 
/usr/lib/debug/.build-id/19/1902dc8ee4d4ae2413864b662da1f5ede07ce3.debug

Breakpoint 2, main (argc=5, argv=0xbffff6f4) at 
/builddir/build/BUILD/emacs-24.3/src/emacs.c:663
663    {
Missing separate debuginfos, use: debuginfo-install 
GConf2-3.2.6-2.fc19.i686 ImageMagick-libs-6.8.3.9-1.fc20.i686 
alsa-lib-1.0.26-3.fc19.i686 at-spi2-atk-2.7.91-1.fc19.i686 
at-spi2-core-2.7.91-1.fc19.i686 atk-2.7.91-1.fc19.i686 
bzip2-libs-1.0.6-8.fc19.i686 cairo-1.12.14-1.fc19.i686 
cairo-gobject-1.12.14-1.fc19.i686 dbus-glib-0.100-3.fc19.i686 
dbus-libs-1.6.8-4.fc19.i686 expat-2.1.0-5.fc19.i686 
fontconfig-2.10.91-3.fc19.i686 freetype-2.4.11-2.fc19.i686 
gdk-pixbuf2-2.27.2-1.fc19.i686 glib2-2.35.8-1.fc19.i686 
glibc-2.17-3.fc19.i686 gmp-5.1.1-2.fc19.i686 gnutls-3.1.9-1.fc20.i686 
gtk3-3.7.12-1.fc19.i686 harfbuzz-0.9.13-1.fc19.i686 
jbigkit-libs-2.0-8.fc19.i686 lcms-libs-1.19-9.fc19.i686 
libICE-1.0.8-5.fc19.i686 libSM-1.2.1-5.fc19.i686 
libX11-1.5.99.901-2.fc19.i686 libXau-1.0.6-7.fc19.i686 
libXcomposite-0.4.4-3.fc19.i686 libXcursor-1.1.13-4.fc19.i686 
libXdamage-1.1.4-3.fc19.i686 libXext-1.3.1-4.fc19.i686 
libXfixes-5.0-5.fc19.i686 libXft-2.3.1-4.fc19.i686 libXi-1.7-1.fc19.i686 
libXinerama-1.1.2-4.fc19.i686 libXrandr-1.4.0-3.fc19.i686 
libXrender-0.9.7-4.fc19.i686 libXt-1.1.3-3.fc19.i686 
libXxf86vm-1.1.2-4.fc19.i686 libcroco-0.6.8-2.fc19.i686 
libdrm-2.4.42-2.fc19.i686 libffi-3.0.11-2.fc19.i686 
libgcc-4.8.0-0.17.fc20.i686 libgomp-4.8.0-0.17.fc20.i686 
libicu-50.1.2-5.fc19.i686 libjpeg-turbo-1.2.90-1.fc19.i686 
libotf-0.9.13-2.fc19.i686 libpng-1.5.13-2.fc19.i686 
librsvg2-2.37.0-2.fc19.i686 libselinux-2.1.13-9.fc19.i686 
libstdc++-4.8.0-0.17.fc20.i686 libtasn1-3.2-3.fc19.i686 
libtiff-4.0.3-5.fc19.i686 libtool-ltdl-2.4.2-12.fc19.i686 
libuuid-2.22.2-6.fc19.i686 libwayland-client-1.0.5-1.fc19.i686 
libwayland-cursor-1.0.5-1.fc19.i686 libwayland-server-1.0.5-1.fc19.i686 
libxcb-1.9-2.fc19.i686 libxkbcommon-0.2.0-2.fc19.i686 
libxml2-2.9.0-4.fc19.i686 m17n-lib-1.6.4-7.fc20.i686 
mesa-libEGL-9.1-1.fc19.i686 mesa-libGL-9.1-1.fc19.i686 
mesa-libgbm-9.1-1.fc19.i686 mesa-libglapi-9.1-1.fc19.i686 
ncurses-libs-5.9-8.20130126.fc19.i686 nettle-2.6-2.fc19.i686 
p11-kit-0.16.4-1.fc19.i686 pango-1.33.8-1.fc19.i686 
pcre-8.32-4.fc19.i686 pixman-0.28.0-3.fc19.i686 
systemd-libs-198-6.fc20.i686 xz-libs-5.1.2-4alpha.fc19.i686 
zlib-1.2.7-10.fc19.i686
(gdb) c
Continuing.

Breakpoint 1, Fmake_vector (length=1511, init=0) at 
/builddir/build/BUILD/emacs-24.3/src/alloc.c:3031
3031    {
(gdb) n
3037      CHECK_NATNUM (length);
(gdb) n
3031    {
(gdb) n
3037      CHECK_NATNUM (length);
(gdb) n
3031    {
(gdb) n
3037      CHECK_NATNUM (length);
(gdb) n
3039      p = allocate_vector (XFASTINT (length));
(gdb) n
3040      sizei = XFASTINT (length);
(gdb) n
3041      for (i = 0; i < sizei; i++)
(gdb) n
3040      sizei = XFASTINT (length);
(gdb) n
3041      for (i = 0; i < sizei; i++)
(gdb) n
3042        p->contents[i] = init;
(gdb) p init
$1 = 0
(gdb) p sizei
$2 = 1511
(gdb) p p->contents[i]
value has been optimized out
(gdb) p length
$3 = 1511
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
Fmake_vector (length=1511, init=0) at 
/builddir/build/BUILD/emacs-24.3/src/alloc.c:3042
3042        p->contents[i] = init;
(gdb)

-- 
S pozdravem / Best regards

Petr Hracek

Red Hat Czech s.r.o.
BaseOS Core Services Brno

Email: [email-masked]
Web: www.cz.redhat.com