[openamq-dev] porting to Ubuntu
Jonathan Schultz
jonathan at imatix.com
Tue Aug 21 16:09:57 CEST 2007
Sorry Nick I really have no immediate idea of what might be happening.
If you look at the code you should see that one thread (thread 1 in your
output) does a wait on the condition variable s_sync_cond, one thread is
irrelevant (only used for timing), and each of the other thread calls
s_decrement_active_thread_count. One of the latter should find that
s_os_active_thread_count hits zero and therefore does a broadcast on
s_sync_cond, allowing thread 1 to pick up and keep on going. We see
from your debug info that s_decrement_active_thread_count is called 4
times from 4 different threads, which is correct. What we don't see is
whether the broadcast is ever done. Could you try placing breakpoints
on lines 2755 and 2757 of smt_os_thread.c to see what that gives?
Unfortunately my timezone here (Melbourne, Australia, UTC+10) means that
I'm due to sleep about now. I gather you're in England so maybe if we
need to communicate further about this issue we could do it early in
your working day, late in mine? Alternatively if you're a night owl,
late in yours, early in mine?
Regards,
Jonathan
Nick Levine wrote:
> Jonathan,
>
> I applied your patch (and checked that the patch had applied properly
> by grepping for s_decrement_active_thread_count in libsmt.a).
>
> But still no succeess:
>
> (gdb) break s_decrement_active_thread_count
> Function "s_decrement_active_thread_count" not defined.
> Make breakpoint pending on future shared library load? (y or [n]) y
> Breakpoint 1 (s_decrement_active_thread_count) pending.
> (gdb) c
> Continuing.
>
> <<< I atempt to connect >>>
>
> Breakpoint 2 at 0xb7d0febc: file smt_os_thread.c, line 2753.
> Pending breakpoint "s_decrement_active_thread_count" resolved
> [New Thread -1215059056 (LWP 21616)]
> [New Thread -1223451760 (LWP 21617)]
> [Switching to Thread -1223451760 (LWP 21617)]
>
> Breakpoint 2, s_decrement_active_thread_count () at smt_os_thread.c:2753
> 2753 assert (s_os_thread_active_count > 0);
> (gdb) c
> Continuing.
> [New Thread -1231844464 (LWP 21618)]
> [Switching to Thread -1231844464 (LWP 21618)]
>
> Breakpoint 2, s_decrement_active_thread_count () at smt_os_thread.c:2753
> 2753 assert (s_os_thread_active_count > 0);
> (gdb) c
> Continuing.
> [New Thread -1240237168 (LWP 21619)]
> [Switching to Thread -1240237168 (LWP 21619)]
>
> Breakpoint 2, s_decrement_active_thread_count () at smt_os_thread.c:2753
> 2753 assert (s_os_thread_active_count > 0);
> (gdb) c
> Continuing.
> [New Thread -1248629872 (LWP 21620)]
> [Switching to Thread -1248629872 (LWP 21620)]
>
> Breakpoint 2, s_decrement_active_thread_count () at smt_os_thread.c:2753
> 2753 assert (s_os_thread_active_count > 0);
> (gdb) c
> Continuing.
>
> <<< and my code hangs >>>
>
> Program received signal SIGINT, Interrupt.
> [Switching to Thread -1209776448 (LWP 21609)]
> 0xffffe410 in __kernel_vsyscall ()
> (gdb) info threads
> 6 Thread -1248629872 (LWP 21620) 0xffffe410 in __kernel_vsyscall ()
> 5 Thread -1240237168 (LWP 21619) 0xffffe410 in __kernel_vsyscall ()
> 4 Thread -1231844464 (LWP 21618) 0xffffe410 in __kernel_vsyscall ()
> 3 Thread -1223451760 (LWP 21617) 0xffffe410 in __kernel_vsyscall ()
> 2 Thread -1215059056 (LWP 21616) 0xffffe410 in __kernel_vsyscall ()
> * 1 Thread -1209776448 (LWP 21609) 0xffffe410 in __kernel_vsyscall ()
> (gdb) bt
> #0 0xffffe410 in __kernel_vsyscall ()
> #1 0xb7f905c6 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
> #2 0xb7d11421 in smt_wait (msecs=0) at /home/nick/wiinz/openamq-src/OpenAMQ-1.2c1/base-2.2b1/_install/include/icl.h:2014
> #3 0xb7d11ff1 in smt_initialise () at smt_os_thread.c:1760
> #4 0xb7bdc3ce in amq_client_connection_new_ (file=0x805e060 "", line=0, host=0x805e030 "localhost", virtual_host=0x805e048 "/", auth_data=0x8075b38,
> instance=0x805e050 "test", trace=3, timeout=10000) at amq_client_connection.c:1663
> #5 0x200638ed in ?? ()
> #6 0x0805e060 in ?? ()
> #7 0x00000000 in ?? ()
> (gdb)
>
>
> Any thoughts?
>
> - nick
>
>
>
More information about the openamq-dev
mailing list