[cfe-dev] MacRuby issues

Daniel Dunbar daniel at zuster.org
Mon Mar 30 08:28:43 PDT 2009


2009/3/28 रजनीश <rdogra at earthlink.net>

> >> It basically segments faults
> >
> > It would be wonderful if you could debug this and get down to the
> > root problem and then report it.
>
> Well in debug this what I get.  it seems to be crashing in printf.
> This is in x86_64.  Since I am not familiar
> with LLVM tools, you will have to give me clue on what to run.


The basic strategy is just like debugging a regular crash, but with a bit
more pessimism about who you can trust. From the trace below, it looks like
there is a null pointer dereference, so the obvious questions are why is the
value dereferenced null (is it non-null when built with gcc?) or why is the
program dereferencing it (does gcc take a different path)?

Once you understand the basics of why the program is crashing, the next step
is to try and understand what it is about the code that is causing clang to
miscompile it, and then either recreate the problem in a small test case.
However, if you manage to isolate the problem down to function A in source
file B is miscompiled, feel free to file a bug with the preprocessed version
of the source file and a reference to the function that is miscompiled.

 - Daniel


>
> Starting program: /Volumes/Rafi/Developer/MacRuby/miniruby -I./lib -
> I.ext/common -I./- -r./ext/purelib.rb ext/extmk.rb --make="/usr/bin/
> make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --
> extension --extstatic
> warning: posix_spawn failed, trying execvp, error: 86
> Reading symbols for shared libraries ++++++++.................... done
> compiling bigdecimal
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
> 0x00007fff80b5ec53 in ffi_prep_cif ()
> (gdb) bt
> #0  0x00007fff80b5ec53 in ffi_prep_cif ()
> #1  0x00000001001025ac in rb_str_format ()
> #2  0x00000001000ab8b6 in rb_f_sprintf ()
> #3  0x00000001000398d1 in rb_io_printf ()
> #4  0x00000001000f3d50 in call_cfunc ()
> #5  0x00000001000f2945 in vm_call_method ()
> #6  0x00000001000e37b5 in vm_eval ()
> #7  0x00000001000efd74 in vm_eval_body ()
> #8  0x00000001000de20b in invoke_block_from_c ()
> #9  0x00000001000dbe19 in rb_yield_values ()
> #10 0x000000010001cc8e in each_with_index_i ()
> #11 0x00000001000de2c5 in invoke_block_from_c ()
> #12 0x00000001000dbc99 in rb_yield ()
> #13 0x00000001000021eb in rb_ary_each ()
> #14 0x00000001000f3d5d in call_cfunc ()
> #15 0x00000001000db2ee in vm_call0 ()
> #16 0x00000001000f4e6d in rb_call0 ()
> #17 0x00000001000dc15e in iterate_method ()
> #18 0x00000001000dbff6 in rb_iterate ()
> #19 0x00000001000dc0cd in rb_block_call ()
> #20 0x000000010001bf77 in enum_each_with_index ()
> #21 0x00000001000f3d50 in call_cfunc ()
> #22 0x00000001000f2945 in vm_call_method ()
> #23 0x00000001000e37b5 in vm_eval ()
> #24 0x00000001000efd74 in vm_eval_body ()
> #25 0x00000001000efcef in rb_iseq_eval ()
> #26 0x0000000100025e2a in rb_load ()
> #27 0x0000000100026975 in rb_f_load ()
> #28 0x00000001000f3d50 in call_cfunc ()
> #29 0x00000001000f2945 in vm_call_method ()
> #30 0x00000001000e37b5 in vm_eval ()
> #31 0x00000001000efd74 in vm_eval_body ()
> #32 0x00000001000de20b in invoke_block_from_c ()
> #33 0x00000001000dbc99 in rb_yield ()
> #34 0x00000001000021eb in rb_ary_each ()
> #35 0x00000001000f3d5d in call_cfunc ()
> #36 0x00000001000f2945 in vm_call_method ()
> #37 0x00000001000e37b5 in vm_eval ()
> #38 0x00000001000efd74 in vm_eval_body ()
> #39 0x00000001000efcef in rb_iseq_eval ()
> #40 0x000000010002366f in ruby_exec_node ()
> #41 0x00000001000236cf in ruby_run_node ()
> #42 0x000000010010ae4f in main ()
> (gdb)
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090330/1b896d8a/attachment.html>


More information about the cfe-dev mailing list