This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'thread' | |
puts "rubysl-openssl: #{RubySL::OpenSSL::VERSION}" | |
puts "rubysl-digest: #{RubySL::Digest::VERSION}" | |
Thread.abort_on_exception = true | |
input = 'the cake is possibly a lie' | |
digest = Digest::SHA256.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Starting threads... | |
An exception occurred running /tmp/openssl.rb: | |
Expected digest "9292f26a8d1ce66f44eda88a679821f650e1d523ce6d1cff9d3e2ebfc79a3499" to equal "83103cff21a7a50e45eb90c29ca9d24204d95fe7369565ec1d5339750da386ab" (RuntimeError) | |
Backtrace: | |
{ } in Object#__script__ at /tmp/openssl.rb:24 | |
Kernel(Object)#loop at kernel/common/kernel.rb:511 | |
{ } in Object#__script__ at /tmp/openssl.rb:17 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):006:0> digest1 = OpenSSL::Digest::SHA256.new | |
=> #<OpenSSL::Digest::SHA256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855> | |
irb(main):007:0> digest2 = OpenSSL::Digest::SHA256.new | |
=> #<OpenSSL::Digest::SHA256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855> | |
irb(main):008:0> digest1.update('the cake is possibly a lie') | |
=> #<OpenSSL::Digest::SHA256: 83103cff21a7a50e45eb90c29ca9d24204d95fe7369565ec1d5339750da386ab> | |
irb(main):009:0> digest2.update('the cake is possibly a lie') | |
=> #<OpenSSL::Digest::SHA256: 83103cff21a7a50e45eb90c29ca9d24204d95fe7369565ec1d5339750da386ab> | |
irb(main):010:0> digest1.hexdigest | |
=> "83103cff21a7a50e45eb90c29ca9d24204d95fe7369565ec1d5339750da386ab" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Starting threads... | |
An exception occurred running /tmp/openssl_thread.rb: | |
Expected digest "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" to equal "83103cff21a7a50e45eb90c29ca9d24204d95fe7369565ec1d5339750da386ab" (RuntimeError) | |
Backtrace: | |
{ } in Object#__script__ at /tmp/openssl_thread.rb:23 | |
Kernel(Object)#loop at kernel/common/kernel.rb:511 | |
{ } in Object#__script__ at /tmp/openssl_thread.rb:16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake | |
cp wat.gemspec tmp/x86_64-linux/stage/wat.gemspec | |
install -c tmp/x86_64-linux/wat/2.2.1/wat.so lib/wat.so | |
cp tmp/x86_64-linux/wat/2.2.1/wat.so tmp/x86_64-linux/stage/lib/wat.so | |
Snippet: Struct.new(:foo, :bar) [OK] | |
Snippet: Struct.new(:foo, :bar).new -e:1: [BUG] Segmentation fault at 0x00000000000018 | |
Snippet: Struct.new(:foo, :bar).new.class [OK] | |
Snippet: Struct.new(:foo, :bar).class -e:1:in `rb_struct_s_members': uninitialized struct (TypeError) | |
Snippet: Struct.new('WTF', :foo, :bar) [OK] | |
Snippet: Struct.new('WTF', :foo, :bar).new -e:1: [BUG] Segmentation fault at 0x00000000000018 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rb_struct_s_members(Struct.new(:foo, :bar)) # => segfault | |
rb_struct_s_members(Struct.new(:foo, :bar).new) # => segfault | |
rb_struct_s_members(Struct.new(:foo, :bar).new.class) # => segfault | |
rb_struct_s_members(Struct.new(:foo, :bar).class) # => TypeError: uninitialized struct | |
rb_struct_s_members(Struct.new('WTF', :foo, :bar)) # => segfault | |
rb_struct_s_members(Struct.new('WTF', :foo, :bar).new) # => segfault | |
rb_struct_s_members(Struct.new('WTF', :foo, :bar).new(5, 6)) # => segfault | |
rb_struct_s_members(Class.new(Struct)) # => TypeError: uninitialized struct | |
rb_struct_s_members(Class.new(Struct).new(:foo, :bar)) # => segfault | |
rb_struct_s_members(Class.new(Struct).new(:foo, :bar).new) # => segfault |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo | |
a = 10 | |
if butts | |
b = 20 | |
end | |
end | |
method(:foo).executable.local_names # => #<Rubinius::Tuple: :a, :b> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NUMBER=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
require 'rspec/autorun' | |
require 'nokogiri' | |
class SomeClass | |
def example(doc); end | |
end | |
# Warning: running this _will_ freeze your computer or at the very least make it | |
# very slow, consume a lot of CPU and burn your lap (in case you're using a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' |