Skip to content

Instantly share code, notes, and snippets.

Chuck Remes chuckremes

Block or report user

Report or block chuckremes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bench.rb
require 'benchmark/ips'
class Ak
def initialize(to:)
@to = to
end
def read(a:, b:, c:, d: nil)
@to.read(a: a, b: b, c: c, d: d)
end
View bench.txt
Charless-Air:ruby-io cremes$ ruby -v
rubinius 3.89.c15 (2.3.1 2ce10c98 2018-01-05 5.0.0) [x86_64-darwin16.7.0]
ACharless-Air:ruby-io cremes$ ruby benchmarks/keywords_vs_none.rb
Warming up --------------------------------------
keywords 467.000 i/100ms
nokeywords 2.710k i/100ms
Calculating -------------------------------------
keywords 4.970k (± 9.2%) i/s - 73.786k
nokeywords 30.586k (± 6.8%) i/s - 457.990k
View u.rb
file = File.open('/tmp/u', 'r')
file.each(5) do |line|
p line, file.pos
end
View vv
(lldb) p entries[i].prediction()->executable()->show(state)
#<Rubinius::Tuple:0x10c25e100>: 21
#<Encoding::UTF-8>
name: "UTF-8"
dummy?: false
>
#<Encoding::ASCII-8BIT>
name: "ASCII-8BIT"
dummy?: false
>
View frames
(lldb) up
frame #1: 0x0000000100066b8c rbx`rubinius::CallSite::Cache::poly_execute(state=0x000070000b08dc10, call_site=0x000000010c237d80, args=0x000070000b08bcf0) at call_site.hpp:223
220 cache->hit();
221 entries[i].hit();
222
-> 223 return entries[i].prediction()->executable()->execute(state,
224 entries[i].prediction()->executable(),
225 entries[i].prediction()->module(), args);
226 } else {
(lldb) p *cache
View bt.txt
...Process 73743 stopped
* thread #82, name = 'ruby.334', stop reason = EXC_BAD_ACCESS (code=1, address=0x12)
frame #0: 0x0000000000000012
error: memory read failed for 0x0
Target 0: (rbx) stopped.
(lldb) bt
* thread #82, name = 'ruby.334', stop reason = EXC_BAD_ACCESS (code=1, address=0x12)
* frame #0: 0x0000000000000012
frame #1: 0x0000000100066b8c rbx`rubinius::CallSite::Cache::poly_execute(state=0x000070000b08dc10, call_site=0x000000010c237d80, args=0x000070000b08bcf0) at call_site.hpp:223
frame #2: 0x0000000100190485 rbx`rubinius::instructions::send_stack(rubinius::State*, rubinius::CallFrame*, long, long) [inlined] rubinius::CallSite::execute(this=<unavailable>, state=0x000070000b08dc10, args=0x000000000000458e) at call_site.hpp:305 [opt]
View bt2.txt
Charless-Air:rubinius cremes$ build/rubinius/bin/rbx -v
Melbourne failed to load, Ruby source parsing disabled
rubinius 3.87 (2.3.1 24759319 2017-12-30 5.0.0 D) [x86_64-darwin16.7.0]
main # Rubinius::Loader at core/loader.rb:843
rubygems # Rubinius::Loader at core/loader.rb:588
load_rubygems . Rubinius::CodeLoader at core/code_loader.rb:202
require # Kernel(Class) at core/kernel.rb:852
require # Rubinius::CodeLoader at core/code_loader.rb:246
load # Rubinius::CodeLoader::Feature at core/code_loader.rb:121
load # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Feature) at core/code_loader.rb:83
View crsh.txt
..................................................................................................................................................................................................................................................................................................................................................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
View g.rb
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"
View tra.txt
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,
You can’t perform that action at this time.