Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Segfault when running attached script #32

Open
eric opened this issue Sep 27, 2010 · 0 comments
Open

Segfault when running attached script #32

eric opened this issue Sep 27, 2010 · 0 comments

Comments

@eric
Copy link

eric commented Sep 27, 2010

When running this script I get a segfault: http://gist.github.com/599412
When I run this one I don't: http://gist.github.com/599415

Am I doing something wrong?

$ gdb ruby
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
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

(gdb) run professional_js.rb 
Starting program: /usr/bin/ruby professional_js.rb
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

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000000000000e
0x00000001006c25ab in js_Execute (cx=0x1031062a0, chain=0x1001f6000, script=0x0, down=0x0, flags=0, result=0x7fff5fbfd220) at jsinterp.c:1485
1485            frame.nvars = script->ngvars;
(gdb) where
#0  0x00000001006c25ab in js_Execute (cx=0x1031062a0, chain=0x1001f6000, script=0x0, down=0x0, flags=0, result=0x7fff5fbfd220) at jsinterp.c:1485
#1  0x000000010065d494 in JS_ExecuteScript (cx=0x1031062a0, obj=0x1001f6000, script=0x0, rval=0x7fff5fbfd220) at jsapi.c:4895
#2  0x0000000100649560 in evaluate_compiled_script (self=4328360120, compiled_script=4328326320) at runtime.c:152
#3  0x0000000100024a39 in rb_proc_call ()
#4  0x00000001000257fb in rb_proc_call ()
#5  0x00000001000208ee in rb_provided ()
#6  0x000000010001fe79 in rb_provided ()
#7  0x000000010002523a in rb_proc_call ()
#8  0x00000001000257fb in rb_proc_call ()
#9  0x00000001000208ee in rb_provided ()
#10 0x000000010002523a in rb_proc_call ()
#11 0x00000001000257fb in rb_proc_call ()
#12 0x00000001000206c2 in rb_provided ()
#13 0x000000010002523a in rb_proc_call ()
#14 0x00000001000257fb in rb_proc_call ()
#15 0x00000001000206c2 in rb_provided ()
#16 0x000000010002133f in rb_provided ()
#17 0x00000001000308f5 in rb_eval_string ()
#18 0x000000010003092f in ruby_exec ()
#19 0x0000000100030951 in ruby_run ()
#20 0x0000000100000ef0 in main ()
(gdb) p frame
$1 = {
  regs = 0x7fff5fbfd110, 
  spbase = 0x100025cce, 
  callobj = 0x0, 
  argsobj = 0x0, 
  varobj = 0x1001f6000, 
  callee = 0x0, 
  script = 0x0, 
  fun = 0x0, 
  thisp = 0x1001f6000, 
  argc = 0, 
  argv = 0x0, 
  rval = 4295122699, 
  nvars = 24, 
  vars = 0x7fff5fbfd200, 
  down = 0x7fff5fbfd140, 
  annotation = 0x103111be0, 
  scopeChain = 0x1, 
  sharpDepth = 6581470, 
  sharpArray = 0x0, 
  flags = 1883575744, 
  dormantNext = 0x7fff5fbfca60, 
  xmlNamespace = 0x7fff5fbfca60, 
  blockChain = 0x7fff5fbfd140, 
  pcDisabledSave = 33392824
}
(gdb) p script
$2 = (JSScript *) 0x0
(gdb) 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant