Kernel#exec should not raise SystemExit ---------------------------------------
Key: JRUBY-2252 URL: http://jira.codehaus.org/browse/JRUBY-2252 Project: JRuby Issue Type: Bug Components: Core Classes/Modules Affects Versions: JRuby 1.1RC2 Environment: JRuby 1.1RC2, Linux, Windows Reporter: Vladimir Sizikov Priority: Minor Attachments: exec-test.rb 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): {noformat} 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' --------------- {noformat} -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email