Subject: Re: bug#16324: 24.3.50; Crashing on OSX 10.6.8 (built --with-ns)

From: Keith David Bershatsky <[email-masked]>
Date: Thu, 02 Jan 2014 16:10:48 -0800

I think this is probably what you were looking for.  Today is my first day learning how to use gdb:

Last login: Thu Jan  2 16:01:10 on ttys001
MP:~ HOME$ cd /Users/HOME/Desktop/emacs-trunk-01-01-2014/src/
MP:src HOME$ gdb /Users/HOME/.0.data/.0.emacs/Emacs.app/Contents/MacOS/Emacs
GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ........... done

DISPLAY = /tmp/launch-N6Y4z5/org.x:0
TERM = xterm-color
Breakpoint 1 at 0x1000a5170: file emacs.c, line 351.
Breakpoint 2 at 0x1000c3be4: file sysdep.c, line 850.
(gdb) run
Starting program: /Users/HOME/.0.data/.0.emacs/Emacs.app/Contents/MacOS/Emacs 
Reading symbols for shared libraries .++++++++++............................................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Emacs(1148,0x7fff71079cc0) malloc: *** error for object 0x116443608: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x00007fff89abe0b6 in __kill ()
(gdb) bt
#0  0x00007fff89abe0b6 in __kill ()
#1  0x00007fff89b5e9f6 in abort ()
#2  0x00007fff89b4d62d in szone_error ()
#3  0x00007fff89a7a66f in small_free_list_remove_ptr ()
#4  0x00007fff89a770db in szone_free_definite_size ()
#5  0x0000000100102a91 in lisp_free (block=0x116230400) at alloc.c:931
#6  0x00000001001074d5 in Fgarbage_collect () at alloc.c:6495
#7  0x0000000100158519 in exec_byte_code (bytestr=1148, vector=266896620757450753, maxdepth=0, args_template=4320145466, nargs=131, args=0x0) at lisp.h:4514
#8  0x000000010012028b in funcall_lambda (fun=4364230573, nargs=1, arg_vector=0x7fff5fbfcfa8) at eval.c:3040
#9  0x000000010012054d in Ffuncall (nargs=2, args=<value temporarily unavailable, due to optimizations>) at eval.c:2867
#10 0x0000000100157f7b in exec_byte_code (bytestr=2, vector=1, maxdepth=-1149410096387949562, args_template=4320145466, nargs=33, args=0x0) at bytecode.c:919
#11 0x000000010012028b in funcall_lambda (fun=4364929437, nargs=1, arg_vector=0x7fff5fbfd1a0) at eval.c:3040
#12 0x000000010012054d in Ffuncall (nargs=2, args=<value temporarily unavailable, due to optimizations>) at eval.c:2867
#13 0x0000000100157f7b in exec_byte_code (bytestr=2, vector=1, maxdepth=-1149410096387949562, args_template=4320145466, nargs=33, args=0x0) at bytecode.c:919
#14 0x000000010012028b in funcall_lambda (fun=4332012773, nargs=6, arg_vector=0x7fff5fbfd320) at eval.c:3040
#15 0x0000000100121908 in apply_lambda (fun=4332012773, args=4362432026) at eval.c:2915
#16 0x000000010011f921 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2251
#17 0x000000010011fe74 in Fsetq (args=<value temporarily unavailable, due to optimizations>) at eval.c:536
#18 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#19 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#20 0x0000000100123088 in Fwhile (args=4332012773) at eval.c:989
#21 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#22 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#23 0x00000001001235f1 in FletX (args=<value temporarily unavailable, due to optimizations>) at eval.c:897
#24 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#25 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#26 0x00000001001202e0 in funcall_lambda (fun=4334326870, nargs=0, arg_vector=0x7fff5fbfd8b0) at eval.c:3033
#27 0x0000000100121908 in apply_lambda (fun=4334326870, args=4320145466) at eval.c:2915
#28 0x000000010011f921 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2251
#29 0x000000010011fe74 in Fsetq (args=<value temporarily unavailable, due to optimizations>) at eval.c:536
#30 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#31 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#32 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#33 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#34 0x0000000100123088 in Fwhile (args=4334326870) at eval.c:989
#35 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#36 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#37 0x0000000100112ec7 in Fsave_restriction (body=4334167206) at editfns.c:3415
#38 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#39 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#40 0x0000000100112e07 in Fsave_excursion (args=4334167254) at editfns.c:941
#41 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#42 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#43 0x0000000100123347 in Flet (args=<value temporarily unavailable, due to optimizations>) at eval.c:967
#44 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#45 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#46 0x0000000100112e67 in Fsave_current_buffer (args=4334169142) at editfns.c:954
#47 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#48 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#49 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#50 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#51 0x00000001001235f1 in FletX (args=<value temporarily unavailable, due to optimizations>) at eval.c:897
#52 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#53 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#54 0x00000001001202e0 in funcall_lambda (fun=4334167478, nargs=3, arg_vector=0x7fff5fbfe5a8) at eval.c:3033
#55 0x000000010012054d in Ffuncall (nargs=4, args=<value temporarily unavailable, due to optimizations>) at eval.c:2867
#56 0x0000000100120d72 in Fapply (nargs=4, args=0x7fff5fbfe5a0) at eval.c:2292
#57 0x000000010011fd42 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2148
#58 0x000000010011fe74 in Fsetq (args=<value temporarily unavailable, due to optimizations>) at eval.c:536
#59 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#60 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#61 0x000000010011e8f7 in internal_catch (tag=4331910290, func=0x10011ff30 <Fprogn>, arg=4334197254) at eval.c:1109
#62 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#63 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#64 0x0000000100123088 in Fwhile (args=4) at eval.c:989
#65 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#66 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#67 0x0000000100123088 in Fwhile (args=4) at eval.c:989
#68 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#69 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#70 0x00000001001235f1 in FletX (args=<value temporarily unavailable, due to optimizations>) at eval.c:897
#71 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#72 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#73 0x00000001001202e0 in funcall_lambda (fun=4334175862, nargs=4, arg_vector=0x7fff5fbfece0) at eval.c:3033
#74 0x0000000100121908 in apply_lambda (fun=4334175862, args=4363406682) at eval.c:2915
#75 0x000000010011f921 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2251
#76 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#77 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#78 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#79 0x00000001001235f1 in FletX (args=<value temporarily unavailable, due to optimizations>) at eval.c:897
#80 0x000000010011fd83 in eval_sub (form=<value temporarily unavailable, due to optimizations>) at eval.c:2124
#81 0x000000010011ff5d in Fprogn (body=<value temporarily unavailable, due to optimizations>) at eval.c:459
#82 0x00000001001202e0 in funcall_lambda (fun=4334875542, nargs=0, arg_vector=0x7fff5fbff1a0) at eval.c:3033
#83 0x000000010012054d in Ffuncall (nargs=1, args=<value temporarily unavailable, due to optimizations>) at eval.c:2867
#84 0x0000000100120de6 in apply1 (fn=4334156962, arg=<value temporarily unavailable, due to optimizations>) at eval.c:2572
#85 0x000000010011ca5f in Fcall_interactively (function=4334156962, record_flag=4320145466, keys=4672935237) at callint.c:378
#86 0x0000000100120751 in Ffuncall (nargs=4, args=<value temporarily unavailable, due to optimizations>) at eval.c:2813
#87 0x0000000100157f7b in exec_byte_code (bytestr=4, vector=4320145466, maxdepth=-1149410096387949562, args_template=4100, nargs=35, args=0x7fff5fbff528) at bytecode.c:919
#88 0x000000010012054d in Ffuncall (nargs=2, args=<value temporarily unavailable, due to optimizations>) at eval.c:2867
#89 0x000000010012097e in call1 (fn=<value temporarily unavailable, due to optimizations>, arg1=<value temporarily unavailable, due to optimizations>) at eval.c:2605
#90 0x00000001000ba1c7 in command_loop_1 () at keyboard.c:1552
#91 0x000000010011ea43 in internal_condition_case (bfun=0x1000b9c70 <command_loop_1>, handlers=4320211946, hfun=0x1000b1600 <cmd_error>) at eval.c:1345
#92 0x00000001000affd7 in command_loop_2 (ignore=<value temporarily unavailable, due to optimizations>) at keyboard.c:1170
#93 0x000000010011e8f7 in internal_catch (tag=4320208138, func=0x1000affa0 <command_loop_2>, arg=4320145466) at eval.c:1109
#94 0x00000001000af45c in recursive_edit_1 () at keyboard.c:1149
#95 0x00000001000b1897 in Frecursive_edit () at keyboard.c:841
#96 0x00000001000a79b3 in main (argc=1, argv=0x7fff5fbff988) at emacs.c:1637
Unsafe to run code: malloc zone lock is held for some zone..
Canceling call as the malloc lock is held so it isn't safe to call the runtime.
Issue the command:
    set objc-non-blocking-mode off 
to override this check if you are sure your call doesn't use the malloc libraries or the ObjC runtime.
(gdb)