Thanks to visit codestin.com
Credit goes to github.com

Skip to content

exit! incorrectly calls exit handlers #6379

@rjattrill

Description

@rjattrill

Environment Information

  • jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94 OpenJDK 64-Bit Server VM 25.252-b09 on 1.8.0_252-b09 +jit [mswin32-x86_64]
  • Windows 10

Expected Behavior

Kernel::exit! should not fire exit handlers as per this documentation:

https://ruby-doc.org/core-2.7.1/Kernel.html#method-i-exit-21

For example this script:

at_exit { puts "at_exit function" }
ObjectSpace.define_finalizer("string",  proc { puts "in finalizer" })
exit!

should produce no output and terminate. MRI behaves as expected.

Actual Behavior

The actual output is this:

at_exit function
in finalizer

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