Skip to content

Instantly share code, notes, and snippets.

View chuckremes's full-sized avatar

Chuck Remes chuckremes

View GitHub Profile
..................................................................................................................................................................................................................................................................................................................................................The Rubinius process is aborting with signal: SIGSEGV
--- begin system info ---
node: info: Charless-Air Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64
--- end system info ---
--- begin rubinius info ---
process: info: cremes rbx 19995 3.87 2.3.1 2017-12-30 24759319 5.0.0 JIT disabled
--- end rubinius info ---
--- begin system backtrace ---
0 rbx 0x0000000102da764d _ZN8rubiniusL20abandon_ship_handlerEi + 333
1 libsystem_platform.dylib 0x00007fff9b78eb3a _sigtramp + 26
@chuckremes
chuckremes / g.rb
Last active December 30, 2017 10:51
require 'fiber'
Thread.abort_on_exception = true
class Foo
def initialize(a_val)
puts "Step 1"
@io_fiber = Fiber.new do |calling_fiber|
puts "Step 4"
some_val = calling_fiber.transfer(a_val)
puts "Step 7"
IO::Async::Private::Scheduler#new originating fiber creating io_fiber,
Thread.current #<Thread:0xc08 id=8 pid=3996597 source=/Users/cremes/dev/mygit/ruby-io/c/test_async_sockets.rb:9 status=run>,
Fiber.current #<Fiber:0xc0c thread_name=ruby.8 fiber_id=0 status=run>
IO::Async::Private::Scheduler#io_fiber running loop,
Thread.current #<Thread:0xc08 id=8 pid=3996597 source=/Users/cremes/dev/mygit/ruby-io/c/test_async_sockets.rb:9 status=run>,
Fiber.current #<IO::Internal::Fiber:0xc10 thread_name=ruby.8 fiber_id=9 status=transfer source=/Users/cremes/dev/mygit/ruby-io/lib/io/async/private/scheduler.rb:15>,
calling fiber #<Fiber:0xc0c thread_name=ruby.8 fiber_id=0 status=run>
IO::Async::Private::Scheduler#io_fiber_loop transferring to originating_fiber,
IO::Async::Private::Scheduler#new setting up io_fiber on Thread #<Thread:0xc08 id=8 pid=3957711 source=/Users/cremes/dev/mygit/ruby-io/c/test_async_sockets.rb:9 status=run>
IO::Async::Private::Scheduler#io_fiber running loop on Thread #<Thread:0xc08 id=8 pid=3957711 source=/Users/cremes/dev/mygit/ruby-io/c/test_async_sockets.rb:9 status=run>
IO::Async::Private::Scheduler#io_fiber_loop transferring to originating_fiber on Thread #<Thread:0xc08 id=8 pid=3957711 source=/Users/cremes/dev/mygit/ruby-io/c/test_async_sockets.rb:9 status=run>
Exception in thread: attempt to transfer fiber across threads: current thread: 8, Fiber Thread: (FiberError)
Exception: attempt to transfer fiber across threads: current thread: 8, Fiber Thread: (FiberError)
Exception: `FiberError' /Users/cremes/dev/mygit/ruby-io/lib/io/async/private/scheduler.rb:18 - attempt to transfer fiber across threads: current thread: 8, Fiber Thread:
call # Proc at core/proc.rb:20
{ } in initialize # IO::Async::Private::Scheduler at
Dec 29 17:17:34 [62003] command line: /Users/cremes/dev/mygit/rubinius/build/rubinius/bin/ruby -d test_async_sockets.rb
Dec 29 17:17:34 [62003] node: info: Charless-Air Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64
Dec 29 17:17:34 [62003] thread: run: ruby.main, 3826364, 0xe71d000
Dec 29 17:17:34 [62003] process: info: cremes rbx 62003 3.86.c105 2.3.1 2017-12-26 6837f1a2 5.0.0 JIT disabled
Dec 29 17:17:34 [62003] process: boot stats: fields 2948us main thread: 28us memory: 8319us ontology: 8032us platform: 1762us
Dec 29 17:17:34 [62003] codedb: loading: /Users/cremes/dev/mygit/rubinius/build/rubinius/codedb/cache
Dec 29 17:17:34 [62003] system: RUBYOPT:
Dec 29 17:17:36 [62003] thread: new: ruby.5, /Users/cremes/dev/mygit/ruby-io/lib/io/async/private/io_loop.rb:28
Dec 29 17:17:36 [62003] thread: run: ruby.5, 3826373, 0xeb33000
Dec 29 17:17:36 [62003] thread: new: ruby.6, /Users/cremes/dev/mygit/ruby-io/lib/io/async/private/pool.rb:8
(lldb) p cache->prediction()->module()->show(state)
#<Rubinius::Channel(Class):0x10380d150>
name: :Rubinius::Channel
superclass: #<Object(Class):0x103800170>
constant_table: #<Rubinius::ConstantTable:0x10380d2a0>
method_table: #<Rubinius::MethodTable:0x10380d1c8>: 16
:send, :<<, :receive, :try_receive, :waiting, :value, :receive_timeout, :inspect,
>
>
(rubinius::Object *) $2 = 0x000000000000001a
(lldb) p *cache
(rubinius::CallSite::InlineCache) $0 = {
_receiver_class_ = 0x000000010380d150
_prediction_ = 0x000000011d6571f0
_method_missing_ = eNone
_hits_ = 886
_misses_ = 0
_execute_ = 0x0000000100066cd0 (rbx`rubinius::CallSite::InlineCache::invoke(rubinius::State*, rubinius::CallSite*, rubinius::CallSite::InlineCache*, rubinius::Arguments&) at call_site.hpp:134)
}
(lldb) p *cache->prediction()
@chuckremes
chuckremes / p
Created December 28, 2017 22:34
frame #3: 0x0000000100066b67 rbx`rubinius::CallSite::invoke_cached(state=0x000070000c6b5c10, call_site=0x000000011d650e60, args=0x000070000c6b3b60) at call_site.hpp:307
304 InlineCache* cache = 0;
305
306 for(int i = 0; i < max_caches && (cache = call_site->_caches_[i]); i++) {
-> 307 Object* value = cache->execute(state, call_site, args, valid_p);
308
309 if(valid_p) return value;
310 }
(lldb) p cache->prediction()->executable()->show(state)
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=EXC_I386_GPFLT).
@chuckremes
chuckremes / t2
Last active December 28, 2017 22:29
(lldb) bt 20
* thread #2, name = 'ruby.main'
frame #0: 0x00007fffdd9416c6 libsystem_malloc.dylib`tiny_free_list_add_ptr + 223
frame #1: 0x00007fffdd940bc4 libsystem_malloc.dylib`tiny_malloc_from_free_list + 1108
frame #2: 0x00007fffdd93f472 libsystem_malloc.dylib`szone_malloc_should_clear + 400
frame #3: 0x00007fffdd93f282 libsystem_malloc.dylib`malloc_zone_malloc + 107
frame #4: 0x00007fffdd93e200 libsystem_malloc.dylib`malloc + 24
* frame #5: 0x000000010020a365 rbx`rubinius::memory::MarkSweepGC::allocate(this=0x000000010191cd50, bytes=664, collect_now=0x00007000090fcb7f) at mark_sweep.cpp:48
frame #6: 0x00000001001ea7d3 rbx`rubinius::Memory::new_object(this=0x0000000103001000, state=0x0000700009109c10, bytes=664) at memory.cpp:769
frame #7: 0x000000010005292c rbx`rubinius::Memory::new_object(this=0x0000000103001000, state=0x0000700009109c10, klass=0x0000000103800260, bytes=664, type=TupleType) at memory.hpp:320
(lldb) up
frame #5: 0x000000010020a365 rbx`rubinius::memory::MarkSweepGC::allocate(this=0x000000010191cd50, bytes=664, collect_now=0x00007000090fcb7f) at mark_sweep.cpp:48
45 }
46
47 Object* MarkSweepGC::allocate(size_t bytes, bool& collect_now) {
-> 48 void* mem = malloc(bytes);
49 if(!mem) return NULL;
50
51 Object* obj = reinterpret_cast<Object*>(mem);