Project

General

Profile

Actions

Bug #2394

closed

[BUG] pthread_mutex_lock: 22 revisited

Added by rogerdpack (Roger Pack) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-11-23 trunk 25889) [i686-linux]
Backport:
[ruby-core:26877]

Description

=begin
The following occurs consistently with a mixture of 1.9.x, forkoff gem (pure ruby), and my own code.

[BUG] pthread_mutex_lock: 22
ruby 1.9.2dev (2009-07-15 trunk 24111) [i686-linux]

-- control frame ----------

-- C level backtrace information -------------------------------------------
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9(rb_vm_bugreport+0x72) [0xb7f187c2]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9 [0xb7dfd351]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9(rb_bug+0x3a) [0xb7dfd40a]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9(rb_thread_blocking_region+0x1f2) [0xb7f1f352]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9 [0xb7e21d5a]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9 [0xb7e23e3e]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9(rb_io_fptr_finalize+0xe4) [0xb7e24014]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9 [0xb7e12946]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9(rb_gc_call_finalizer_at_exit+0x247) [0xb7e139b7]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9(ruby_cleanup+0x12a) [0xb7e01fca]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9 [0xb7f1e844]
/home/rdp/installs/ruby_trunk_installed/lib/libruby.so.1.9 [0xb7f1e8c1]
/lib/libpthread.so.0 [0xb7d8cfc0]
/lib/libc.so.6(clone+0x5e) [0xb7caba1e]

How to reproduce:

checkout git://github.com/rdp/p2pwebclient.git [pthread_mutex_lock branch]
or download
http://wilkboardonline.com/roger/p2pwebclient_pthread_mutex_lock.tgz

$ gem install rmagick # a dependency, but never part of the bugs, I don't think--sorry for the dependency http://snippets.dzone.com/posts/show/4140 describes how to install its dependencies on ubuntu

$ cd p2pwebclient/src
$ ruby singleMultipleGraphs.rb unnamed316651_at1

Enjoy!
-r
=end


Related issues 2 (0 open2 closed)

Related to Backport191 - Backport #2654: segfault on self thread joinClosedyugui (Yuki Sonoda)Actions
Related to Backport191 - Backport #2399: pthread_mutex_lock: 22Closedyugui (Yuki Sonoda)Actions
Actions #1

Updated by hongli (Hongli Lai) over 14 years ago

=begin
Does ruby -e 'fork { puts }' work?

I think someone reported a similar issue with FreeBSD 6, although I can't reproduce the problem on OS X Snow Leopard.
=end

Actions #2

Updated by naruse (Yui NARUSE) over 14 years ago

  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)

=begin

=end

Actions #3

Updated by rogerdpack (Roger Pack) over 14 years ago

=begin
ruby -e 'fork { puts }' doesn't seem to quite do it, though maybe it would if I ran it over and over again.

Here's a more minimalistic test for it (reproduces every time):

require 'forkoff' # gem
a = File.open('bii', 'w')
[1].forkoff { |n|
a.write '1'
}

[BUG] pthread_mutex_lock: Invalid argument (EINVAL)
ruby 1.9.2dev (2009-11-26 trunk 25926) [i686-linux]

-- control frame ----------

-- C level backtrace information -------------------------------------------
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9(rb_vm_bugreport+0x72) [0xb7e76992]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9 [0xb7d53581]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9(rb_bug+0x3a) [0xb7d5363a]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9(rb_bug_errno+0x7f5) [0xb7d543c5]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9(rb_thread_blocking_region+0x1fa) [0xb7e7d35a]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9 [0xb7d78d9a]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9 [0xb7d7b2be]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9(rb_io_fptr_finalize+0xe4) [0xb7d7b4d4]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9 [0xb7d69746]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9 [0xb7d6a632]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9(ruby_cleanup+0x12e) [0xb7d58f9e]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9 [0xb7e7c71e]
/home/rdp/installs/ruby_trunk_installed//lib/libruby.so.1.9 [0xb7e7c761]
/lib/libpthread.so.0 [0xb7cdffc0]
/lib/libc.so.6(clone+0x5e) [0xb7bfea1e]
=end

Actions #4

Updated by rogerdpack (Roger Pack) over 14 years ago

=begin
Note that this also appears to be able to lock a ruby process.
See the following example of one that was unresponsive, this is what gdb's backtrace gave for it.
Thanks.
-r

(gdb) bt
#0 0xb7fb0410 in __kernel_vsyscall ()
#1 0xb7f90589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
#2 0xb7f8bba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
#3 0xb7f8b58a in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
#4 0x0813002a in native_mutex_lock (lock=0xfffffe00) at thread_pthread.c:36
#5 0x081305bb in rb_thread_interrupt (th=0x81c4738) at thread.c:254
#6 0x08134e0b in thread_start_func_2 (th=0x8f13048, stack_start=0x81c4738) at thread.c:452
#7 0x08135081 in thread_start_func_1 (th_ptr=0xfffffe00) at thread_pthread.c:351
#8 0xb7f894fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#9 0xb7ea6e5e in clone () from /lib/tls/i686/cmov/libc.so.6
=end

Actions #5

Updated by naruse (Yui NARUSE) over 14 years ago

=begin
r26061 fixes a bug related this.
Does this still happen?
=end

Actions #6

Updated by rogerdpack (Roger Pack) over 14 years ago

=begin
could this be moved to the 1.9 project, as it isn't fixed in trunk?
-r
=end

Actions #7

Updated by nobu (Nobuyoshi Nakada) about 14 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26390.
Roger, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #8

Updated by rogerdpack (Roger Pack) about 14 years ago

=begin
Thank you, seems to work like a champ now.
-rp
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0