Skip to content

Instantly share code, notes, and snippets.

View brixen's full-sized avatar

Brian Shirai brixen

View GitHub Profile
1)
Kernel#taint on a Fixnum raises a RuntimeError FAILED
Expected RuntimeError but no exception was raised (1 was returned)
main # Rubinius::Loader at
core/loader.rb:852 (+90)
script # Rubinius::Loader at
core/loader.rb:667 (+343)
load_script # Rubinius::CodeLoader at
core/code_loader.rb:280 (+60)
load # Rubinius::CodeLoader::Source(Rubinius::CodeLoader::Script) at
@brixen
brixen / bm_while.rb
Created March 7, 2018 03:50
rbx 3.19 ~7.7x vs mri 2.2.3
require 'benchmark/ips'
def script
i = 0
while i < 1000_000
i += 1
end
i
end
@brixen
brixen / block.rb
Last active February 27, 2018 21:48
class A
attr_accessor :things
def initialize
@things = []
end
def compute
things.each do |x|
x.compute
(lldb) t 5
* thread #5, name = 'ruby.5', stop reason = breakpoint 1.1
frame #0: 0x000000010003b99f rbx`rubinius::capi::Handle::as_rdata(this=0x00000001155375d0, env=0x0000000100a42bd0) at data.cpp:18
15 Data* data = c_as<Data>(object_);
16
17 if(data->freed_p()) {
-> 18 rb_raise(rb_eArgError, "Data object has already been freed");
19 }
20
21 if(type_ == cRData) {
@brixen
brixen / diagnostics.json
Last active February 12, 2018 18:30
rbx -Xlog.gc.set -Xlog.gc.run -Xdiagnostics.target=diagnostics.json -Xdiagnostics.interval=50 -Xdiagnostics.machine.enabled=yes -Xdiagnostics.profiler.enabled=yes -Xdiagnostics.profiler.min_sample=2 -v -e 'puts "hello world"; GC.run true'
{
"metadata": {
"type": "MachineMetrics",
"nodename": "Shirai-MacBook.local",
"timestamp": "Mon Feb 12 10:27:39 2018",
"sequence": 1,
"thread_name": "ruby.main",
"thread_id": 1
},
"checkpoints": 0,
$ bin/rbx compile -B -e 'class A; def m; end; end'
============= :__script__ ==============
Arguments: 0 required, 0 post, 0 total
Arity: 0
Locals: 0
Stack size: 4
Registers: 0
Literals: 4: :A, :open_class, <compiled code>, :call_under
Lines to IP: 1: 0..25
@brixen
brixen / gist:f1314821cb430c36821d6983266f2bdb
Created February 7, 2018 18:55
40 thread install on Bundler 1.11.2
This file has been truncated, but you can view the full file.
$ lldb -p 84832
(lldb) process attach --pid 84832
Process 84832 stopped
* thread #1, name = 'ruby.main', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff6dfb0cee libsystem_kernel.dylib`__psynch_cvwait + 10
libsystem_kernel.dylib`__psynch_cvwait:
-> 0x7fff6dfb0cee <+10>: jae 0x7fff6dfb0cf8 ; <+20>
0x7fff6dfb0cf0 <+12>: movq %rax, %rdi
0x7fff6dfb0cf3 <+15>: jmp 0x7fff6dfa80b8 ; cerror_nocancel
0x7fff6dfb0cf8 <+20>: retq
{
"type": "Profiler",
"fields": {
"index": [
"serial",
"name",
"location",
"samples",
"calls"
],
{
"type": "Profiler",
"index": [
{
"serial": 2273,
"name": "*",
"location": "core/string.rb:230",
"samples": 14,
"calls": 11777
},
{
"type": "MemoryMetrics",
"young_bytes": 0,
"young_objects": 0,
"immix_bytes": 18819176,
"immix_objects": 250133,
"immix_chunks": 1,
"large_bytes": 262375952,
"large_objects": 20672,
"symbols": 7646,