JRuby

Calling IO.new with invalid file descriptor raises NativeException

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.0.0RC2
  • Fix Version/s: JRuby 1.1.4
  • Component/s: Core Classes/Modules
  • Labels:
    None
  • Environment:
    OS X 10.4.9, Java 1.5, 2007-05-31 rev 3672
  • Number of attachments :
    1

Description

Calling IO.new with an invalid file descriptor should raise a SystemCallError. Currently JRuby raises a NativeException.

IO.new(999) # => Should raise SystemCallError

Activity

Hide
Anders Bengtsson added a comment -

Attached patch fixes the NPE.

It gives IOError instead of the right subclass of SystemCallError though.

Show
Anders Bengtsson added a comment - Attached patch fixes the NPE. It gives IOError instead of the right subclass of SystemCallError though.
Hide
Charles Oliver Nutter added a comment -

If we can support this the right way, we should try to do it in 1.1 and 1.0.2. If not, we should always raise a normal error like SystemCallError.

Show
Charles Oliver Nutter added a comment - If we can support this the right way, we should try to do it in 1.1 and 1.0.2. If not, we should always raise a normal error like SystemCallError.
Hide
Charles Oliver Nutter added a comment -

I fixed the NPE as in Anders' patch, but didn't get the SystemCallError throwing. Moving off 1.0.2 for that part of the issue, since it's pretty minor.

Show
Charles Oliver Nutter added a comment - I fixed the NPE as in Anders' patch, but didn't get the SystemCallError throwing. Moving off 1.0.2 for that part of the issue, since it's pretty minor.
Hide
Charles Oliver Nutter added a comment -

Raises EBADF in 1.1.4, which matches MRI. 1.0 branch is dead.

Show
Charles Oliver Nutter added a comment - Raises EBADF in 1.1.4, which matches MRI. 1.0 branch is dead.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: