Skip to content

JRuby returns nil backtrace for living newborn threads, whereas MRI returns [] #4891

@ivoanjo

Description

@ivoanjo

Environment

  • JRuby: jruby 9.1.15.0 (2.3.3) 2017-12-07 929fde8 Java HotSpot(TM) 64-Bit Server VM 25.151-b12 on 1.8.0_151-b12 +jit [linux-x86_64]
  • Kernel: Linux u186024434db159d25c92 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Distro: Ubuntu 16.04.3 LTS

Expected Behavior

Example code:

puts RUBY_DESCRIPTION

puts Thread.new { sleep }.backtrace.inspect

Output on MRI 2.0 to 2.5 (this seems to have changed from 1.9, where it returned nil):

ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
[]

(This is of course a race and may sometimes yield non-empty results)

Actual Behavior

Output on JRuby:

jruby 9.1.15.0 (2.3.3) 2017-12-07 929fde8 Java HotSpot(TM) 64-Bit Server VM 25.151-b12 on 1.8.0_151-b12 +jit [linux-x86_64]
nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions