Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created January 25, 2009 21:56
Show Gist options
  • Select an option

  • Save methodmissing/52556 to your computer and use it in GitHub Desktop.

Select an option

Save methodmissing/52556 to your computer and use it in GitHub Desktop.
macbook-pros-computer:ruby187 lourens$ gdb miniruby
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct 2 04:07:49 UTC 2007)
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 "i386-apple-darwin"...Reading symbols for shared libraries .... done
(gdb) break malloc_error_break
Breakpoint 1 at 0xe24a6
(gdb) run -e 'Thread.new{ Fiber.new{p 1}.resume }'
Starting program: /Users/lourens/projects/ruby187/miniruby -e 'Thread.new{ Fiber.new{p 1}.resume }'
Reading symbols for shared libraries +++... done
Breakpoint 1 at 0x9452b4a9
miniruby(29409) malloc: *** error for object 0x803a00: double free
*** set a breakpoint in malloc_error_break to debug
Breakpoint 1, 0x9452b4a9 in malloc_error_break ()
(gdb) bt
#0 0x9452b4a9 in malloc_error_break ()
#1 0x94526497 in szone_error ()
#2 0x94450463 in szone_free ()
#3 0x944552d4 in szone_realloc ()
#4 0x9445492e in malloc_zone_realloc ()
#5 0x944548a1 in realloc ()
#6 0x00033102 in rb_thread_save_context (th=0x80500c) at eval.c:10549
#7 0x0003839b in fiber_store (next_fib=0x804c00) at eval.c:13531
#8 0x0003857c in fiber_switch (fibval=1336360, argc=0, argv=0x0, is_resume=1) at eval.c:13595
#9 0x00038632 in rb_fiber_resume (fibval=1336360, argc=0, argv=0x0) at eval.c:13621
#10 0x0003877f in rb_fiber_m_resume (argc=0, argv=0x0, fib=1336360) at eval.c:13666
#11 0x00028f89 in call_cfunc (func=0x38760 <rb_fiber_m_resume>, recv=1336360, len=-1, argc=0, argv=0x0) at eval.c:5749
#12 0x00028390 in rb_call0 (klass=1388960, recv=1336360, id=5601, oid=5601, argc=0, argv=0x0, body=0x1530d8, flags=0) at eval.c:5904
#13 0x00029b63 in rb_call (klass=1388960, recv=1336360, mid=5601, argc=0, argv=0x0, scope=0, self=1403220) at eval.c:6151
#14 0x00021aeb in rb_eval (self=1403220, n=0x1464c8) at eval.c:3492
#15 0x000260d5 in rb_yield_0 (val=1336440, self=1403220, klass=0, flags=1, avalue=2) at eval.c:5077
#16 0x00036691 in rb_thread_yield (arg=1336440, th=0x802400) at eval.c:12332
#17 0x00036353 in rb_thread_start_0 (fn=0x3659a <rb_thread_yield>, arg=0x146478, th=0x802400) at eval.c:12250
#18 0x000367e7 in rb_thread_initialize (thread=1336460, args=1336440) at eval.c:12409
#19 0x00028f65 in call_cfunc (func=0x3671e <rb_thread_initialize>, recv=1336460, len=-2, argc=0, argv=0x0) at eval.c:5746
#20 0x00028390 in rb_call0 (klass=1391140, recv=1336460, id=2961, oid=2961, argc=0, argv=0x0, body=0x1539c0, flags=2) at eval.c:5904
#21 0x00029b63 in rb_call (klass=1391140, recv=1336460, mid=2961, argc=0, argv=0x0, scope=1, self=6) at eval.c:6151
#22 0x00029f42 in rb_funcall2 (recv=1336460, mid=2961, argc=0, argv=0x0) at eval.c:6287
#23 0x0002d2f5 in rb_obj_call_init (obj=1336460, argc=0, argv=0x0) at eval.c:7770
#24 0x000366da in rb_thread_s_new (argc=0, argv=0x0, klass=1391140) at eval.c:12363
#25 0x00028f89 in call_cfunc (func=0x36697 <rb_thread_s_new>, recv=1391140, len=-1, argc=0, argv=0x0) at eval.c:5749
#26 0x00028390 in rb_call0 (klass=1391120, recv=1391140, id=3361, oid=3361, argc=0, argv=0x0, body=0x1539e8, flags=0) at eval.c:5904
#27 0x00029b63 in rb_call (klass=1391120, recv=1391140, mid=3361, argc=0, argv=0x0, scope=0, self=1403220) at eval.c:6151
#28 0x00021aeb in rb_eval (self=1403220, n=0x1465a4) at eval.c:3492
#29 0x000207df in rb_eval (self=1403220, n=0x1464a0) at eval.c:3222
#30 0x0001c2e6 in eval_node (self=1403220, node=0x1464a0) at eval.c:1436
#31 0x0001ca0b in ruby_exec_internal () at eval.c:1641
#32 0x0001ca5c in ruby_exec () at eval.c:1661
#33 0x0001ca8a in ruby_run () at eval.c:1671
#34 0x00001a0c in main (argc=3, argv=0xbffff7dc, envp=0xbffff7ec) at main.c:48
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment