Subject: bug#17288: SegFault with emacs in CPP header file (long constructor)

From: Dan Faudemer <[email-masked]>
Date: Thu, 17 Apr 2014 14:04:44 +0200

From: [email-masked]
To: [email-masked]
Subject: 24.3; Segfault in CPP Header File with linum
Date: Thu, 17 Apr 2014 07:00:58 -0500
Message-ID: <>
--text follows this line--

Hello,

I have some issue with emacs in a long intialisation constructor, emacs
exit with a segault.

My .emacs contains :
(global-linum-mode 1)
(set-default 'truncate-lines t)

And the header file bug.h :

aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaaaaaaaaaa("aaaaaaaaaaa"),aaa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a("aaaaaaaaaaaaaaaaa"),aaaaaaaaaaaaaaaaa("aaaaaaaaaaaaaaaaa"),
aaaaaaaaaaaaaaa("aaaaaaaaaaaaaaaaa"),faaaaaaaaaaaaaaaaa("aaaaaaaaaaaaaaaaa")

To reproduce the segfault you have to put the cursor on the second line
and press the button to go to the end of the line.

Emacs return to me this error :
/usr/bin/emacs[0x4ef391]
/usr/bin/emacs[0x4d4dbd]
/usr/bin/emacs[0x4ef2ee]
/usr/bin/emacs[0x4ef6a3]
/lib64/libpthread.so.0[0x2b8f483b6be0]
/usr/bin/emacs[0x498926]
/usr/bin/emacs[0x49c180]
/usr/bin/emacs[0x43aab9]
/usr/bin/emacs[0x43abf5]
/usr/bin/emacs[0x44b2dc]
/usr/bin/emacs[0x44f0ff]
/usr/bin/emacs[0x454f8b]
/usr/bin/emacs[0x457349]
/usr/bin/emacs[0x545aa3]
/usr/bin/emacs[0x458675]
/usr/bin/emacs[0x4e2939]
/usr/bin/emacs[0x4e4da7]
/usr/bin/emacs[0x4e6c7b]
/usr/bin/emacs[0x545bf6]
/usr/bin/emacs[0x4dd6ea]
/usr/bin/emacs[0x545cea]
/usr/bin/emacs[0x4dde40]
/usr/bin/emacs[0x4ddf8a]
/usr/bin/emacs[0x4d5ba6]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3affa1d994]
/usr/bin/emacs[0x413f19]

And with emacs -Q
Fatal error 11: Segmentation fault
Backtrace:
/usr/bin/emacs[0x4ef391]
/usr/bin/emacs[0x4d4dbd]
/usr/bin/emacs[0x4ef2ee]
/usr/bin/emacs[0x4ef6a3]
/lib64/libpthread.so.0[0x2b05af4dbbe0]
/usr/bin/emacs[0x498926]
/usr/bin/emacs[0x49c180]
/usr/bin/emacs[0x43aab9]
/usr/bin/emacs[0x43abf5]
/usr/bin/emacs[0x44b2dc]
/usr/bin/emacs[0x44f0ff]
/usr/bin/emacs[0x454f8b]
/usr/bin/emacs[0x457349]
/usr/bin/emacs[0x545aa3]
/usr/bin/emacs[0x458675]
/usr/bin/emacs[0x4e2939]
/usr/bin/emacs[0x4e4da7]
/usr/bin/emacs[0x4e6c7b]
/usr/bin/emacs[0x545bf6]
/usr/bin/emacs[0x4dd6ea]
/usr/bin/emacs[0x545cea]
/usr/bin/emacs[0x4dde40]
/usr/bin/emacs[0x4ddf8a]
/usr/bin/emacs[0x4d5ba6]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3affa1d994]
/usr/bin/emacs[0x413f19]

Regards,

Dan.

In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.14.7)
 of 2013-05-22 on bkahne-ec1
System Description:    Red Hat Enterprise Linux Client release 5.8 (Tikanga)

Configured using:
 `configure '--prefix=/usr/'
 '--with-x-toolkit=gtk'
 'LDFLAGS=-Wl,-R/pkg/gtk+-/2.14.7/x86_64-linux/lib''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: C/l

Minor modes in effect:
  global-linum-mode: t
  linum-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
ESC [ > 0 ; 1 1 5 ; 0 c ESC x r e p o TAB r TAB RE
T

Recent messages:
("/usr/bin/emacs" "-bg" "black" "-fg" "#FFFFFF" "bug.h")
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading cc-langs...done
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message cl-macs gv format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode cc-langs cl cl-lib cc-mode
cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs time-date linum tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)