#269 √ resolved
Tom Mornini

[BUG] -r profile causes "Attempted to access field of non-reference" on BSD/Darwin

Reported by Tom Mornini | January 21st, 2008 @ 07:47 PM | in 1.0 preview

~/Desktop/rbx: shotgun/rubinius test/benchmark/yarv/bm_vm3_thread_create_join.rb
~/Desktop/rbx: shotgun/rubinius -r profile test/benchmark/yarv/bm_vm3_thread_create_join.rb
Attempted to access field of non-reference.
(repeat a lot...)

Comments and changes to this ticket

  • Tom Mornini

    Tom Mornini January 21st, 2008 @ 07:47 PM

    • → Title changed from “-r profile causes "Attempted to access field of non-reference” to “-r profile causes "Attempted to access field of non-reference"”
  • zimbatm

    zimbatm January 22nd, 2008 @ 02:32 AM

    • → State changed from “new” to “invalid”

    Please give at least the first 8 digist of the revision when posting.

    I couldn't reproduce it on 91e4b806... Reopen the ticket if you have more details.

  • Tom Mornini

    Tom Mornini January 22nd, 2008 @ 10:30 AM

    Interesting: Still broken for me on 9074bc1c

  • Tom Mornini

    Tom Mornini January 22nd, 2008 @ 10:45 AM

    Additional details:

    ~/Desktop/rbx: uname -a
    Darwin Tom-Morninis-MacBook-Pro.local 9.1.0 Darwin Kernel Version 9.1.0: Wed Oct 31 17:46:22 PDT 2007; root:xnu-1228.0.2~1/RELEASE_I386 i386
    ~/Desktop/rbx: gcc -v
    Using built-in specs.
    Target: i686-apple-darwin9
    Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
    Thread model: posix
    gcc version 4.0.1 (Apple Inc. build 5465)
    
  • zimbatm

    zimbatm January 23rd, 2008 @ 02:57 AM

    Thanks, I was able to reproduce the error with the same platform and compiler. So this looks OS X (or BSD) specific. It works under linux.

  • zimbatm

    zimbatm January 23rd, 2008 @ 03:10 AM

    • → State changed from “invalid” to “open”
  • zimbatm

    zimbatm January 25th, 2008 @ 09:08 AM

    Here is the backtrace when run in gdb :

    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_PROTECTION_FAILURE at address: 0x0000000e
    0x0018e2b8 in methctx_reference (state=0x8000, ctx=0xe) at methctx.c:111
    111	  if(!stack_context_p(ctx)) return;
    (gdb) bt
    #0  0x0018e2b8 in methctx_reference (state=0x8000, ctx=0xe) at methctx.c:111
    #1  0x0016b758 in _cpu_sampler_record_context (sig=27) at cpu_sample.c:81
    #2  <signal handler called>
    #3  0x90435f5a in select$DARWIN_EXTSN ()
    #4  0x001d7e1c in select_poll () at state.h:332
    #5  0x001d8f6b in ev_loop () at state.h:332
    #6  0x0014d702 in cpu_event_runonce (state=0x8000) at cpu_event.c:75
    #7  0x0016e094 in cpu_thread_run_best (state=0x8000, c=0x3009f0) at cpu_task.c:496
    #8  0x0016dab6 in cpu_thread_exited (state=0x8000, c=0x3009f0) at cpu_task.c:392
    #9  0x0016a183 in cpu_perform_system_primitive (state=0x8000, c=0x3009f0, prim=186, mo=0x3c1f34, num_args=0, method_name=0x1683, mod=0x3152c4, block=0xe) at system_primitives.gen:2512
    #10 0x001515f0 in cpu_perform_primitive (state=0x8000, c=0x3009f0, prim=186, mo=0x3c1f34, args=0, name=0x1683, mod=0x3152c4, block=0xe) at cpu.h:290
    #11 0x0015152e in cpu_try_primitive (state=0x8000, c=0x3009f0, mo=0x3c1f34, recv=0x303214, args=0, sym=0x1683, mod=0x3152c4, block=0xe) at cpu_instructions.c:552
    #12 0x0015210a in _cpu_build_and_activate (state=0x8000, c=0x3009f0, mo=0x3c1f34, recv=0x303214, sym=0x1683, args=0, block=0xe, missing=0, mod=0x3152c4) at cpu_instructions.c:910
    #13 0x00152077 in _inline_cpu_unified_send (state=0x8000, c=0x3009f0, recv=0x303214, sym=0x1683, args=0, block=0xe) at cpu_instructions.c:1074
    #14 0x00155e03 in cpu_run (state=0x8000, c=0x3009f0, setup=0) at instruction_dt.gen:477
    #15 0x00189819 in machine_run (m=0x800000) at machine.c:323
    #16 0x00189926 in machine_run_file (m=0x800000, path=0xbffff782 "/Users/zimbatm/Documents/src/rubinius/runtime/loader.rbc") at machine.c:348
    #17 0x0016f076 in environment_load_machine (e=0x300180, m=0x800000) at environment.c:176
    #18 0x00001e0a in main (argc=3, argv=0xbffff05c) at main.c:98
    

    methctx_reference doesn't like to Qnil as a ctx.

    it only happens when snapshotting for the profiler. bin/ci never triggers this for example..

  • Eero Saynatkari

    Eero Saynatkari January 26th, 2008 @ 02:37 PM

    • → Title changed from “-r profile causes "Attempted to access field of non-reference"” to “[BUG] -r profile causes "Attempted to access field of non-reference" on BSD/Darwin”
  • zimbatm

    zimbatm January 30th, 2008 @ 12:38 AM

    • → State changed from “open” to “resolved”

    This has been fixed by Evan in 4090c477d1501140dbfe5f4f3250d61b91e2e4cd

    I did the tests in OS X, everything's fine.

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags