Skip to content

Instantly share code, notes, and snippets.

@mbj
Last active December 5, 2018 19:38
Show Gist options
  • Save mbj/e6795ee5e0583c5541ee250e9942279a to your computer and use it in GitHub Desktop.
Save mbj/e6795ee5e0583c5541ee250e9942279a to your computer and use it in GitHub Desktop.
Crash Ruby 2.5.3
system('uname -a')
# not relevant just to make sure we terminate early
# core dumping is expensive.
Thread.abort_on_exception = true
MUTEX = Mutex.new
# You may have to up this on your platform
50.times do
Thread.new do
pid = Process.fork { MUTEX.synchronize {} }
MUTEX.synchronize {}
Process.waitpid(pid)
end
end
@mbj
Copy link
Author

mbj commented Dec 5, 2018

My result:

Linux mbj 4.14.85-1-lts #1 SMP Sat Dec 1 13:41:17 CET 2018 x86_64 GNU/Linux
crash.rb:12: [BUG] unexpected THREAD_KILLED
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]

Please post yours as brief.

@mostlyobvious
Copy link

Darwin morbo.lan 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
crash.rb:12: [BUG] unexpected THREAD_KILLED
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]

@mostlyobvious
Copy link

$ ruby -v
ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-darwin18]
Darwin morbo.lan 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
# did not crash

@mostlyobvious
Copy link

Linux dev 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
crash.rb:12: [BUG] unexpected THREAD_KILLED
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]

@mostlyobvious
Copy link

Linux dev 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
crash.rb:12: [BUG] unexpected THREAD_KILLED
ruby 2.6.0preview1 (2018-02-24 trunk 62554) [x86_64-linux]

@mostlyobvious
Copy link

ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin17]
Darwin morbo.lan 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
# did not crash

@mostlyobvious
Copy link

ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin17]
Darwin morbo.lan 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
# did not crash

@mostlyobvious
Copy link

ruby -v
ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
Linux dev 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
# did not crash

@mostlyobvious
Copy link

Linux dev 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
crash.rb:12: [BUG] unexpected THREAD_KILLED
ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-linux]

@mbj
Copy link
Author

mbj commented Dec 5, 2018

no crash:

ruby -v
ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-linux]
Linux mbj 4.14.85-1-lts #1 SMP Sat Dec 1 13:41:17 CET 2018 x86_64 GNU/Linux

@dgollahon
Copy link

dgollahon commented Dec 5, 2018

Darwin MacBook-Pro.local 17.7.0 Darwin Kernel Version 17.7.0: Wed Oct 10 23:06:14 PDT 2018; root:xnu-4570.71.13~1/RELEASE_X86_64 x86_64
crash.rb:13: [BUG] unexpected THREAD_KILLED
ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]

Note: did not fail the first time I ran it. It crashes ~80% of the time.

@mbj
Copy link
Author

mbj commented Dec 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment