Discussion:
[bug #18132] REXML::UndefinedNamespaceException when running on Windows 7 with Ruby 1.9.2-p180
anonymous
2011-05-13 20:05:32 UTC
Permalink
URL:
<http://gna.org/bugs/?18132>

Summary: REXML::UndefinedNamespaceException when running on
Windows 7 with Ruby 1.9.2-p180
Project: XMPP4R
Submitted by: None
Submitted on: Fri 13 May 2011 08:05:31 PM UTC
Category: None
Severity: 5 - Blocker
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any

_______________________________________________________

Details:

I'm trying to use XMPP4R 0.5 with Ruby 1.9.2-p180 on Windows 7, but I am
observing a REXML exception during the authentication step. The error appears
to be timing sensitive because it occurs about 90% of the time and monkey
patching REXML to produce debug output makes the issue disappear.

I have attached a small script to reproduce the error. I have also attached
the output from running the script with Ruby 1.9.2-p180 on Windows 7.

This issue does not occur with Ruby 1.8.7-p334 on Windows 7.
This issue does not occur with Ruby 1.9.2-p180 on Linux.
This issue does not occur with Ruby 1.8.7-p334 on Linux.



_______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 13 May 2011 08:05:31 PM UTC Name: xmpp-test.rb Size: 462B By:
None

<http://gna.org/bugs/download.php?file_id=12997>
-------------------------------------------------------
Date: Fri 13 May 2011 08:05:31 PM UTC Name: xmpp-test-output.txt Size: 6kB
By: None

<http://gna.org/bugs/download.php?file_id=12998>

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18132>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Tim Jensen
2011-05-13 20:20:00 UTC
Permalink
Follow-up Comment #1, bug #18132 (project xmpp4r):

The following monkey-patch instrumentation of REXML is sufficient to make the
problem disappear:

module REXML::Parsers
class BaseParser
alias_method :the_real_pull, :pull
def pull
puts "PULL START #{Thread.current}"
the_real_pull
ensure
puts "PULL END: #{Thread.current}"
end
end
end

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18132>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Tim Jensen
2011-05-13 20:35:48 UTC
Permalink
Follow-up Comment #2, bug #18132 (project xmpp4r):

The server is ejabberd version 2.1.2-2, running on Ubuntu 10.04.2 LTS.

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18132>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Tim Jensen
2011-05-26 12:51:22 UTC
Permalink
Follow-up Comment #3, bug #18132 (project xmpp4r):

The problem appears to be caused by (or at least related to) the parser
thread getting stuck in the "aborting" state after being killed upon
successful authentication.

The following patch exposes the issue as a hang on Ruby 1.9.2, but runs
normally on 1.8.7 and 1.9.1.


module Jabber
class Stream
def stop
@parser_thread.kill
@parser_thread.join # <-- Wait for original parser thread to die
before continuing
@parser = nil
end
end
end


_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18132>

_______________________________________________
Message sent via/by Gna!
http://gna.org/

Loading...