You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2008/06/21 01:36:07 UTC

DO NOT REPLY [Bug 45248] New: testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

https://issues.apache.org/bugzilla/show_bug.cgi?id=45248

           Summary: testlockperf of apr_thread_rwlock_t stalls forever on
                    i686 Linux / glibc 2.7
           Product: APR
           Version: HEAD
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR test
        AssignedTo: bugs@apr.apache.org
        ReportedBy: nix@esperi.org.uk


(I first saw this in APR 1.2.12: it is still present in 1.3.2.)

The symptoms are:

apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 3 threads    OK
[indefinite stall]

gdb shows that the lock is still outstanding:

(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b28b478 in pthread_join () from /lib/libpthread.so.0
#2  0x4002222f in apr_thread_join (retval=0xbfe707bc, thd=0x9e09348) at
threadproc/unix/thread.c:217
#3  0x08048c97 in test_thread_rwlock (num_threads=2) at testlockperf.c:212
#4  0x08049228 in main (argc=Cannot access memory at address 0x0
) at testlockperf.c:276
(gdb) thread 2
[Switching to thread 2 (Thread 0x40451b90 (LWP 9811))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b290ec2 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4b28de60 in pthread_rwlock_wrlock () from /lib/libpthread.so.0
(gdb) thread 3
Thread ID 3 not known.
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b290ec2 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4b28de60 in pthread_rwlock_wrlock () from /lib/libpthread.so.0
(gdb) quit


I'm not really sure where to go from here. It's not at all obvious what's
wrong.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #12 from Bojan Smojver <bo...@rexursive.com>  2008-06-29 14:12:05 PST ---
> The patch doesn't cause anything to be printed.

Right. This suggest we don't have any lock/unlock attempt failures in the
process.

The manual page for pthread_rwlock_wrlock() function claims:
-------------------
The pthread_rwlock_wrlock() function shall apply a write  lock  to  the
read-write  lock  referenced by rwlock. The calling thread acquires the
write lock if no other thread (reader or writer) holds  the  read-write
lock rwlock. Otherwise, the thread shall block until it can acquire the
lock. The calling thread may deadlock if at the time the call  is  made
it holds the read-write lock (whether a read or write lock).
-------------------

Is is possible that the thread calling the locking routine is holding that lock
already?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248


Bojan Smojver <bo...@rexursive.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #22177|0                           |1
        is obsolete|                            |




--- Comment #10 from Bojan Smojver <bo...@rexursive.com>  2008-06-25 16:59:30 PST ---
Created an attachment (id=22178)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22178)
Print locking errors in the test


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #20 from Bojan Smojver <bo...@rexursive.com>  2008-07-02 03:32:20 PST ---
Thanks for letting us know. Good luck with the glibc stuff!


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #14 from Nix <ni...@esperi.org.uk>  2008-07-01 15:38:55 PST ---
I forced this to happen by changing the initial number of threads to 3 (since
otherwise it stalls at the 2-thread stage).

The backtraces of the two lock-blocked threads are identical:

(gdb) info threads
  3 Thread 0x4024fb90 (LWP 21108)  0x40000424 in __kernel_vsyscall ()
  2 Thread 0x40450b90 (LWP 21109)  0x40000424 in __kernel_vsyscall ()
  1 Thread 0x4004e7e0 (LWP 21096)  0x40000424 in __kernel_vsyscall ()
(gdb) thread 1
[Switching to thread 1 (Thread 0x4004e7e0 (LWP 21096))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b28b478 in pthread_join () from /lib/libpthread.so.0
#2  0x400218ae in apr_thread_join (retval=0xbfb79488, thd=0x82f4270) at
threadproc/unix/thread.c:217
#3  0x08048c87 in test_thread_rwlock (num_threads=3) at testlockperf.c:212
#4  0x080491df in main (argc=1, argv=Cannot access memory at address 0x4
) at testlockperf.c:276
(gdb) thread 2
[Switching to thread 2 (Thread 0x40450b90 (LWP 21109))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b290ec2 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4b28de60 in pthread_rwlock_wrlock () from /lib/libpthread.so.0
#3  0x400158f0 in apr_thread_rwlock_wrlock (rwlock=0x82f4238) at
locks/unix/thread_rwlock.c:97
#4  0x08048a6f in thread_rwlock_func (thd=0x82f4290, data=0x0) at
testlockperf.c:74
#5  0x40021666 in dummy_worker (opaque=0x82f4290) at
threadproc/unix/thread.c:142
#6  0x4b28a079 in start_thread () from /lib/libpthread.so.0
(gdb) thread 3
[Switching to thread 3 (Thread 0x4024fb90 (LWP 21108))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b290ec2 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4b28de60 in pthread_rwlock_wrlock () from /lib/libpthread.so.0
#3  0x400158f0 in apr_thread_rwlock_wrlock (rwlock=0x82f4238) at
locks/unix/thread_rwlock.c:97
#4  0x08048a6f in thread_rwlock_func (thd=0x82f4270, data=0x0) at
testlockperf.c:74
#5  0x40021666 in dummy_worker (opaque=0x82f4270) at
threadproc/unix/thread.c:142
#6  0x4b28a079 in start_thread () from /lib/libpthread.so.0


(Can anyone else replicate this?)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248


Bojan Smojver <bo...@rexursive.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #13 from Bojan Smojver <bo...@rexursive.com>  2008-06-29 14:19:24 PST ---
In comment #11, was that the test where 2 threads were started (i.e. total
number of threads was 3)? Meaning, two "worker" threads plus main thread?

If so, what was the backtrace of that third thread?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #8 from Bojan Smojver <bo...@rexursive.com>  2008-06-25 16:45:54 PST ---
OK, thanks.

This backtrace from second thread:
----------------------------
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b290ec2 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4b28de60 in pthread_rwlock_wrlock () from /lib/libpthread.so.0
----------------------------

Is this complete backtrace? Was there something else there?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #11 from Nix <ni...@esperi.org.uk>  2008-06-27 02:39:10 PST ---
The patch doesn't cause anything to be printed.

Here are some better backtraces, though (gdb frame-base bug, I think):

(gdb) thread 1
[Switching to thread 1 (Thread 0x400547e0 (LWP 26416))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b28b478 in pthread_join () from /lib/libpthread.so.0
#2  0x400218ae in apr_thread_join (retval=0xbf984298, thd=0x8c19328) at
threadproc/unix/thread.c:217
#3  0x08048c46 in test_thread_rwlock (num_threads=2) at testlockperf.c:220
#4  0x0804920f in main (argc=1, argv=Cannot access memory at address 0x4
) at testlockperf.c:284
(gdb) thread 2
[Switching to thread 2 (Thread 0x40255b90 (LWP 26424))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b290ec2 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4b28de60 in pthread_rwlock_wrlock () from /lib/libpthread.so.0
#3  0x400158f0 in apr_thread_rwlock_wrlock (rwlock=0x8c192f0) at
locks/unix/thread_rwlock.c:97
#4  0x08048a6f in thread_rwlock_func (thd=0x8c19328, data=0x0) at
testlockperf.c:74
#5  0x40021666 in dummy_worker (opaque=0x8c19328) at
threadproc/unix/thread.c:142
#6  0x4b28a079 in start_thread () from /lib/libpthread.so.0


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #15 from Bojan Smojver <bo...@rexursive.com>  2008-07-01 16:01:20 PST ---
I was unable to replicate this in my environment (Fedora 9 on i686/x86_64, RHEL
4 on i686, CentOS 4 on i686 and CentOS 5 on i686/x86_64). AFAIK, people running
Ubuntu reported this test passing for 1.3.2 release.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #1 from Bojan Smojver <bo...@rexursive.com>  2008-06-22 23:42:37 PST ---
Could you do 'info threads' and then do a backtrace of all three threads that
are exercising the lock?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #19 from Nix <ni...@esperi.org.uk>  2008-07-02 00:30:43 PST ---
OK, it works on a bunch of other randomly selected Linux boxes with the same
kernel, compiled with the same compiler. 

It's this glibc at fault. Now to figure out why (it's almost identical to a
stock Debian glibc with a couple of especially disruptive POSIX-violating
patches unrelated to locks removed: miscompilation of glibc?)

I'm starting to see why nobody else has seen this bug. :)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #3 from Nix <ni...@esperi.org.uk>  2008-06-24 16:23:24 PST ---
Sure: will do tomorrow evening. (Sorry for the delay, but I just got home and
it's past midnight here.)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #16 from Nix <ni...@esperi.org.uk>  2008-07-01 16:59:24 PST ---
I guess it's something weird specific to my environment then.

I'll dig deeper and see what's misbehaving. It pretty much has to be glibc or
the kernel, really.... I hope it's not glibc, getting fixes into that is like
pushing water uphill while someone fires a flamethrower at you.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #6 from Bojan Smojver <bo...@rexursive.com>  2008-06-25 16:38:20 PST ---
Probably a silly question (I'm not sure if that can be relevant in current
glibc at all) - did you build glibc with NPTL or without?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #17 from Bojan Smojver <bo...@rexursive.com>  2008-07-01 18:34:44 PST ---
Created an attachment (id=22207)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22207)
Test case without APR

Does this test program run OK on your system?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #7 from Nix <ni...@esperi.org.uk>  2008-06-25 16:40:10 PST ---
With NPTL, from glibc 2.5 on (i.e. essentially forever, certainly since long
before this problem first appeared).


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248


Bojan Smojver <bo...@rexursive.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bojan@rexursive.com




--- Comment #2 from Bojan Smojver <bo...@rexursive.com>  2008-06-22 23:45:47 PST ---
Sorry, maybe I wasn't clear. The message "Thread ID 3 not known." is usually
due to the fact that thread ids are something other than 1, 2 and 3 here.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #9 from Bojan Smojver <bo...@rexursive.com>  2008-06-25 16:56:06 PST ---
Created an attachment (id=22177)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22177)
Print locking errors in the test

Could you try the attached patch? If locking/unlocking doesn't go through, it
should let us know.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248


Nix <ni...@esperi.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |INVALID




--- Comment #18 from Nix <ni...@esperi.org.uk>  2008-07-02 00:18:36 PST ---
No, it still fails. Thus it's not APR at fault.

... interesting. Adding a heap of write() calls shows:

Main
Main got lock
Thread
Thread
Thread
Main made threads
Thread got lock; thread released lock
[~10000 repetitions of the above two lines]
Thread released lock
Main released lock
ead released lock
Thread got lock; thread released lock
[~1.1 million repetitions of the above two lines]
[Hang]

Upon deadlock the rwlock says

__lock = 0, __nr_readers = 0, __readers_wakeup = 0, __writer_wakeup = 219178,
__nr_readers_queued = 0, __nr_writers_queued = 0, __flags = 0 '\0', __shared =
0 '\0', __pad1 = 0 '\0', __pad2 = 0 '\0', __writer = 0

i.e. it shouldn't be blocking (no readers, not locked nothing queued).

I think it's plain that pthread_rwlocks are not, well, locking, at least not
for me (although they deadlock fine), and that this cannot be blamed on APR.

Sorry for wasting your time. I'll dig into glibc's rwlock implementation and
see if any fixes have been made upstream since glibc 2.7.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248


Nix <ni...@esperi.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |ASSIGNED




--- Comment #5 from Nix <ni...@esperi.org.uk>  2008-06-25 15:58:03 PST ---
Fascinating. I tried to bisect the bug, only to find that it doesn't work as
far back as I can go (1.2.0 doesn't work, earlier versions require libtool
downgrades so I didn't go further back). I know for a fact that 1.2.6 worked
for me when I built it, so obviously something external to apr has changed.

>From my upgrade logs I strongly suspect glibc 2.5 -> 2.6.1 (I'm on 2.7 now,
going to 2.8 fairly shortly), although it could be the kernel, I suppose. I'll
do a test glibc reversion in a chroot and see how that flies.

(The distro, well, it was Linux From Scratch a decade before LFS was cool. My
autobuilders work well enough that I see no point using someone else's distro,
plus it means I get to find all sorts of interesting bugs like, well, this
one.)

Sorry for the gdb stupidity: I do know how to use it but not when under hay
fever drugs of this intensity ;}


Looking again (with 1.3.2), the two-thread case freezes up now.

apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 2 threads    OK

  2 Thread 0x40250b90 (LWP 15230)  0x40000424 in __kernel_vsyscall ()
  1 Thread 0x4004f7e0 (LWP 15222)  0x40000424 in __kernel_vsyscall ()

(gdb) thread 1
[Switching to thread 1 (Thread 0x4004f7e0 (LWP 15222))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b28b478 in pthread_join () from /lib/libpthread.so.0
#2  0x4002222f in apr_thread_join (retval=0xbf918a68, thd=0x9ce6328) at
threadproc/unix/thread.c:217
#3  0x08048c97 in test_thread_rwlock (num_threads=2) at testlockperf.c:212
#4  0x08049228 in main (argc=Cannot access memory at address 0x0
) at testlockperf.c:276
(gdb) thread 2
[Switching to thread 2 (Thread 0x40250b90 (LWP 15230))]#0  0x40000424 in
__kernel_vsyscall ()
(gdb) bt
#0  0x40000424 in __kernel_vsyscall ()
#1  0x4b290ec2 in __lll_lock_wait () from /lib/libpthread.so.0
#2  0x4b28de60 in pthread_rwlock_wrlock () from /lib/libpthread.so.0

If I continue, the lock is released and the three-thread case sweeps by without
problems. If I run it under GDB directly rather than attaching, it never hangs.

I tried running it under valgrind to drastically change the performance
profile, and bingo, a three-thread hang, last displayed:

apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 3 threads    OK

Unfortunately interrupting valgrind while hung isn't very useful: the interrupt
happens while you're inside the valgrind VM, and that confuses gdb's unwinder
(on account of that VM being relocated) so that all you get is something like
this:

#0  0x3807211c in ?? ()
#1  0x38746cf0 in ?? ()
#2  0x3887ca7c in ?? ()
#3  0x6234deec in ?? ()
#4  0x38746cfc in ?? ()
...


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 45248] testlockperf of apr_thread_rwlock_t stalls forever on i686 Linux / glibc 2 .7

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45248





--- Comment #4 from Bojan Smojver <bo...@rexursive.com>  2008-06-24 16:31:15 PST ---
Thanks. If you could also include the distro information, that would help.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org