Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

IO#ensure_open fails in xmpp4r gem #864

Closed
bakkdoor opened this Issue · 1 comment

3 participants

@bakkdoor
Collaborator

I wanted to try out the xmpp4r gem (see: http://home.gna.org/xmpp4r/).
I provided a simple test script that connects to a xmpp server, tries to authenticate and disconnects. This all works fine under MRI (to actually run this you'll have to use your own xmpp username & password).
But on Rubinius it fails (see gist).
I was able to track it down failing in IO#ensure_open_and_writable when it calls IO#ensure_open (which i found to be a primitive). The C++ code that failed is this:

else if(to_fd() == -1) {
  Exception::io_error(state, "closed stream");
}

No idea why it's workin in MRI but not on rbx. Maybe somehow the open connection stream is accidentally closed by the runtime or something. Different timeouts?
Let me know if you have any further questions.

Gist with error report and sample code: https://gist.github.com/964180

@kronos
Collaborator

OK. I found out the problem.

x = Thread.new do
  begin
    loop { sleep 1.0 }
  rescue Exception => e # !!!
    p e.message
  end
end

x.kill
sleep 0.5

Rubinius allows to catch the error and the code outputs "Thread::Die", but both MRI & YARV don't. If we remove "Exception => e" everything works well. I think it's very easy to fix for Brian and Evan :).

@ryoqun ryoqun referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@ryoqun ryoqun referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@ryoqun ryoqun referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@ryoqun ryoqun closed this issue from a commit
@ryoqun ryoqun Correctly implement Thread#kill
Re-implement Thread#kill by adding new RaiseReason rather than complicating the
existing ad-hoc way of raising Exceptions.

Conceputually, Thread#kill isn't quite like exceptions. If the exception approach
wasn't replaced, it would be neccesary to really specially handle Thread::Die.

Make some failing specs pass. Also, Fix #864.
ba7667b
@ryoqun ryoqun closed this in ba7667b
@roshats roshats referenced this issue from a commit in roshats/rubinius
@ryoqun ryoqun Correctly implement Thread#kill
Re-implement Thread#kill by adding new RaiseReason rather than complicating the
existing ad-hoc way of raising Exceptions.

Conceputually, Thread#kill isn't quite like exceptions. If the exception approach
wasn't replaced, it would be neccesary to really specially handle Thread::Die.

Make some failing specs pass. Also, Fix #864.
d4751f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.