Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.1RC2
    • Fix Version/s: JRuby 1.2
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      JRuby 1.1RC2, Linux, Windows
    • Number of attachments :
      1

      Description

      After fix for JRUBY-1988 (rev. 5634), the Kernel#exec method always raises SystemExit to simulate MRI's exec behavior, where exec'ed process replaces the original one. There is a minor problem with this approach - the raised SystemExit can be rescued from within the script, which is not possible in MRI. Ideally, we should raise in such a way that it's not possible to the parent script to see and rescue the exception.

      Attached test case shows the problem.

      With MRI, the test run is replaced with the sub-process.
      In JRuby, the SystemExit is raised (and rescued by the test, allowing to continue the execution):

        1) Failure:
      test_exec_nothing_raised(ExecTest) [exec-test.rb:7]:
      Exception raised:
      Class: <SystemExit>
      Message: <"exit">
      ---Backtrace---
      exec-test.rb:7:in `test_exec_nothing_raised'
      ---------------
      
      1. exec-test.rb
        0.3 kB
        Vladimir Sizikov

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Vladimir Sizikov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: