Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"deadlock detected (fatal)" from roster.add() #26

Open
ssoroka opened this issue Feb 3, 2012 · 3 comments
Open

"deadlock detected (fatal)" from roster.add() #26

ssoroka opened this issue Feb 3, 2012 · 3 comments

Comments

@ssoroka
Copy link

ssoroka commented Feb 3, 2012

My code that caused the deadlock is pretty much just:

roster = Jabber::Roster::Helper.new(cl)
roster.add(email, name, true)

Exception is:

~/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/thread.rb:71:in `sleep': deadlock detected (fatal)
  from ~/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/thread.rb:71:in `wait'
  from ./vendor/bundle/ruby/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/semaphore.rb:24:in `block in wait'
  from <internal:prelude>:10:in `synchronize'
  from ./vendor/bundle/ruby/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/semaphore.rb:23:in `wait'
  from ./vendor/bundle/ruby/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:331:in `wait'
  from ./vendor/bundle/ruby/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:398:in `send'
  from ./vendor/bundle/ruby/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:432:in `send_with_id'
  from ./vendor/bundle/ruby/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/roster/helper/roster.rb:332:in `add'

Only happens in (some versions of?) Ruby 1.9.3, can't reproduce in Ruby 1.8.7.

Am I missing code to prevent deadlocks?

@astro
Copy link
Collaborator

astro commented Feb 3, 2012

Not that I were maintaining xmpp4r anymore, but please check in what thread you're invoking that, and if it locked resources at this point.

@ssoroka
Copy link
Author

ssoroka commented Feb 3, 2012

So is this:

A) My fault for not using a thread or locking properly in my application code?
B) xmpp4r's fault for locking when it doesn't need to?
or
C) A bug in Ruby 1.9.3? such as: http://bugs.ruby-lang.org/issues/4266

@bobbrez
Copy link

bobbrez commented Feb 27, 2012

Even with the examples its getting the "deadlock detected" exception. It sounds like it is probably more B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants