Subject: Segfault compiling cedet/srecode/texi.el during "make bootstrap"

From: Bob Halley <[email-masked]>
Date: Mon, 10 Jun 2013 08:42:56 +0100

Since the recent CEDET merge, Emacs no longer builds for me.  It segfaults
while compiling cedet/srecode/texi.el.  The fault happens on optimized builds
with both gcc 4.2.1 and clang from the most recent Xcode (4.6.2) OS X.

If I checkout something just before the sequence of CEDET merges that ended
with

commit 8a705018438ec0142e964a48f1af4996242e20f6
Merge: 509f7cc 5419570
Author: David Engster <[email-masked]>
Date:   Sun Jun 2 18:39:32 2013 +0200

    Merge with CEDET upstream (rev. 8564).

everything builds fine.  Any version at or after the version above fails.

Details:

(x86_64-apple-darwin12.4.0, NS apple-appkit-1187.39)
 of 2013-06-02 on bark.local
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure --without-x --with-ns -with-wide-int'

$ make bootstrap

[...all is good until...]

In end of data:
cedet/srecode/table.el:291:1:Warning: the function `srecode-mode-table' is not
    known to be defined.
Wrote /Users/halley/src/emacs/lisp/cedet/srecode/table.elc
Compiling cedet/srecode/template.el
Wrote /Users/halley/src/emacs/lisp/cedet/srecode/template.elc
Compiling cedet/srecode/texi.el
make[3]: *** [cedet/srecode/texi.elc] Abort trap: 6 (core dumped)
make[2]: *** [compile-main] Error 2
make[1]: *** [lisp] Error 2
make: *** [bootstrap] Error 2

(gdb) bt
#0  0x00007fff8da5dd46 in __kill ()
#1  0x000000010009f379 in terminate_due_to_signal (sig=6, backtrace_limit=40) at emacs.c:343
#2  0x00000001000bb193 in emacs_abort () at sysdep.c:2148
#3  0x000000010018ab9d in ns_term_shutdown (sig=<value temporarily unavailable, due to optimizations>) at nsterm.m:4388
#4  0x000000010009f9de in shut_down_emacs (sig=11, stuff=76230) at emacs.c:1944
#5  0x000000010009f33b in terminate_due_to_signal (sig=11, backtrace_limit=40) at emacs.c:327
#6  0x00000001000bb706 in deliver_fatal_thread_signal (sig=<value temporarily unavailable, due to optimizations>) at sysdep.c:1649
#7  <signal handler called>
#8  0x00007fff8a503a47 in memmove$VARIANT$sse42 ()
#9  0x00000001000db059 in directory_files_internal (directory=140734799730000, full=140734799730000, match=140734799730000, nosort=140734799730000, id_format=140734799730000, attrs=false) at dired.c:275
#10 0x0000000100117015 in Ffuncall (nargs=4421888592, args=0x1001171c8) at eval.c:2722
#11 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799730304, maxdepth=64, args_template=4296346960, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#12 0x000000010011a702 in funcall_lambda (fun=140734799730400, nargs=1, arg_vector=0x7fff5fbed6e0) at eval.c:2945
#13 0x00000001001170db in Ffuncall (nargs=4, args=0x1078f37b2) at eval.c:2760
#14 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799730640, maxdepth=32, args_template=4320145466, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#15 0x000000010011a702 in funcall_lambda (fun=140734799730736, nargs=2, arg_vector=0x7fff5fbed830) at eval.c:2945
#16 0x00000001001170db in Ffuncall (nargs=2, args=0x1078f3a02) at eval.c:2760
#17 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799730992, maxdepth=48, args_template=4300205426, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#18 0x000000010011a702 in funcall_lambda (fun=140734799731088, nargs=2, arg_vector=0x7fff5fbed990) at eval.c:2945
#19 0x00000001001170db in Ffuncall (nargs=3, args=0x103810afa) at eval.c:2760
#20 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799731344, maxdepth=48, args_template=4296336030, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#21 0x000000010011a702 in funcall_lambda (fun=140734799731440, nargs=9, arg_vector=0x7fff5fbedaf0) at eval.c:2945
#22 0x00000001001170db in Ffuncall (nargs=3, args=0x103810c1a) at eval.c:2760
#23 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799731744, maxdepth=96, args_template=4320145466, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#24 0x0000000100119f02 in eval_sub (form=10) at eval.c:2087
#25 0x000000010013d0ae in readevalloop (readcharfun=4320273946, stream=0x7fff5fbedd80, sourcename=4421888592, unibyte=140734799732096, readfun=140734799732096, start=4320145466, end=4320145466, printflag=false) at lread.c:1873
#26 0x0000000100138bbb in Fload (file=4421888592, noerror=140734799732528, nomessage=140734799732528, nosuffix=140735226364520, must_suffix=140734799732528) at lread.c:1351
#27 0x0000000100121683 in Frequire (feature=10, filename=140734799732608, noerror=140734799732608) at fns.c:2659
#28 0x0000000100116ff9 in Ffuncall (nargs=10, args=0x1001171c8) at eval.c:2718
#29 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799732880, maxdepth=32, args_template=4320145466, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#30 0x0000000100119f02 in eval_sub (form=2) at eval.c:2087
#31 0x000000010013d0ae in readevalloop (readcharfun=4320273946, stream=0x7fff5fbee1f0, sourcename=4421888592, unibyte=140734799733232, readfun=140734799733232, start=4320145466, end=4320145466, printflag=false) at lread.c:1873
#32 0x0000000100138bbb in Fload (file=4421888592, noerror=140734799733664, nomessage=140734799733664, nosuffix=140735226364368, must_suffix=140734799733664) at lread.c:1351
#33 0x0000000100121683 in Frequire (feature=2, filename=140734799733744, noerror=140734799733744) at fns.c:2659
#34 0x0000000100116ff9 in Ffuncall (nargs=2, args=0x1001171c8) at eval.c:2718
#35 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799734064, maxdepth=80, args_template=4320145466, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#36 0x0000000100119f02 in eval_sub (form=2) at eval.c:2087
#37 0x000000010013d0ae in readevalloop (readcharfun=4320273946, stream=0x7fff5fbee690, sourcename=4421888592, unibyte=140734799734416, readfun=140734799734416, start=4320145466, end=4320145466, printflag=false) at lread.c:1873
#38 0x0000000100138bbb in Fload (file=4421888592, noerror=140734799734848, nomessage=140734799734848, nosuffix=140735226364216, must_suffix=140734799734848) at lread.c:1351
#39 0x0000000100121683 in Frequire (feature=2, filename=140734799734928, noerror=140734799734928) at fns.c:2659
#40 0x0000000100116ff9 in Ffuncall (nargs=2, args=0x1001171c8) at eval.c:2718
#41 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799735216, maxdepth=48, args_template=4320145466, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#42 0x0000000100119f02 in eval_sub (form=2) at eval.c:2087
#43 0x000000010013d0ae in readevalloop (readcharfun=4320273946, stream=0x7fff5fbeeb10, sourcename=4421888592, unibyte=140734799735568, readfun=140734799735568, start=4320145466, end=4320145466, printflag=false) at lread.c:1873
#44 0x0000000100138bbb in Fload (file=4421888592, noerror=140734799736000, nomessage=140734799736000, nosuffix=140735226364064, must_suffix=140734799736000) at lread.c:1351
#45 0x0000000100121683 in Frequire (feature=2, filename=140734799736080, noerror=140734799736080) at fns.c:2659
#46 0x0000000100116ff9 in Ffuncall (nargs=2, args=0x1001171c8) at eval.c:2718
#47 0x0000000100116902 in Fapply (nargs=140734799736288, args=0x7fff5fbeede0) at eval.c:2193
#48 0x00000001001170f4 in Ffuncall (nargs=2, args=0x101823c3a) at eval.c:2692
#49 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799736560, maxdepth=0, args_template=1028, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#50 0x00000001001170db in Ffuncall (nargs=3, args=0x107800302) at eval.c:2760
#51 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799736816, maxdepth=0, args_template=4296337008, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#52 0x00000001001170db in Ffuncall (nargs=2, args=0x107800182) at eval.c:2760
#53 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799737072, maxdepth=0, args_template=1028, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#54 0x00000001001170db in Ffuncall (nargs=2, args=0x106808502) at eval.c:2760
#55 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799737328, maxdepth=0, args_template=4412492569, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#56 0x00000001001170db in Ffuncall (nargs=2, args=0x10480b655) at eval.c:2760
#57 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799737552, maxdepth=0, args_template=0, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#58 0x00000001001170db in Ffuncall (nargs=1, args=0x10480b685) at eval.c:2760
#59 0x0000000100119dac in eval_sub (form=1) at eval.c:2053
#60 0x000000010011aae8 in internal_lisp_condition_case (var=4404053442, bodyform=4370781654, handlers=4370780934) at eval.c:1169
#61 0x000000010014f351 in exec_byte_code (bytestr=4421888592, vector=140734799738416, maxdepth=0, args_template=140734799738216, nargs=4300792576, args=0x100512ce0) at bytecode.c:1099
#62 0x00000001001170db in Ffuncall (nargs=4404053442, args=0x1068083b2) at eval.c:2760
#63 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799738768, maxdepth=0, args_template=4412492249, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#64 0x00000001001170db in Ffuncall (nargs=2, args=0x10481b89a) at eval.c:2760
#65 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799739008, maxdepth=0, args_template=0, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#66 0x00000001001170db in Ffuncall (nargs=2, args=0x10480b455) at eval.c:2760
#67 0x0000000100119dac in eval_sub (form=1) at eval.c:2053
#68 0x000000010011aae8 in internal_lisp_condition_case (var=4420890962, bodyform=4370740918, handlers=4370742662) at eval.c:1169
#69 0x000000010014f351 in exec_byte_code (bytestr=4421888592, vector=140734799739840, maxdepth=0, args_template=140734799739664, nargs=4300792576, args=0x100512ce0) at bytecode.c:1099
#70 0x00000001001170db in Ffuncall (nargs=4420890962, args=0x107817122) at eval.c:2760
#71 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799740144, maxdepth=0, args_template=4420892990, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#72 0x00000001001170db in Ffuncall (nargs=2, args=0x10481b95a) at eval.c:2760
#73 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799740544, maxdepth=0, args_template=4300021952, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#74 0x00000001001170db in Ffuncall (nargs=1, args=0x1058172aa) at eval.c:2760
#75 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799740896, maxdepth=0, args_template=4300033222, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#76 0x00000001001170db in Ffuncall (nargs=2, args=0x10480ebba) at eval.c:2760
#77 0x000000010014e748 in exec_byte_code (bytestr=4421888592, vector=140734799741184, maxdepth=0, args_template=4300034625, nargs=4300792576, args=0x100512ce0) at bytecode.c:903
#78 0x000000010011a2bf in apply_lambda (fun=140734799741280, args=0) at eval.c:2820
#79 0x0000000100119fe9 in eval_sub (form=4297609293) at eval.c:2126
#80 0x000000010011685a in Feval (form=4320406470, lexical=4297609373) at eval.c:1918
#81 0x0000000100118c8b in internal_condition_case (bfun=0x1000a8ad0 <top_level_2>, handlers=4320211610, hfun=0x1000b2e40 <cmd_error>) at eval.c:1214
#82 0x00000001000b304b in top_level_1 (ignore=4297609293) at keyboard.c:1181
#83 0x0000000100118d77 in internal_catch (tag=4297609293, func=0x1000b3010 <top_level_1>, arg=4297609293) at eval.c:988
#84 0x00000001000b33b2 in command_loop [inlined] () at /Users/halley/src/emacs/src/keyboard.c:1142
#85 0x00000001000b33b2 in recursive_edit_1 () at keyboard.c:776
#86 0x00000001000a494d in Frecursive_edit () at keyboard.c:840
#87 0x00000001000a1835 in main (argc=5825280, argv=0x7fff5fbf0650) at emacs.c:1543
(gdb) f 9
#9  0x00000001000db059 in directory_files_internal (directory=140734799730000, full=140734799730000, match=140734799730000, nosort=140734799730000, id_format=140734799730000, attrs=false) at dired.c:275
275		      memcpy (SDATA (fullname), SDATA (directory),
(gdb) list
270		      Lisp_Object fullname;
271		      ptrdiff_t nbytes = len + directory_nbytes + needsep;
272		      ptrdiff_t nchars;
273	
274		      fullname = make_uninit_multibyte_string (nbytes, nbytes);
275		      memcpy (SDATA (fullname), SDATA (directory),
276			      directory_nbytes);
277	
278		      if (needsep)
279			SSET (fullname, directory_nbytes, DIRECTORY_SEP);

I don't know how to debug this, but if you tell me what you need I can
try to do it!

/Bob