deadlock in std::__default_alloc_template<true, 0>::allocate

R

rrtttcsut

Hi,
I got a problem of deadlock in std::__default_alloc_template<true,
0>::allocate().
It occured in the following environment.
CPU: AMD64(multicore)
OS: suse linux(linux 2.6)

I can not get all thread's stack. The following stack is the only
thread I can got. It maybe main thread(I am not sure):

#0 0x0000002a9676a0bb in __lll_mutex_lock_wait () from /lib64/tls/
libpthread.so.0
#1 0x0000007fbfffcc60 in ?? ()
#2 0x0000000000000071 in ?? ()
#3 0x0000002a96766fe8 in pthread_mutex_lock () from /lib64/tls/
libpthread.so.0
#4 0x0000002a9650d4e0 in std::__default_alloc_template<true,
0>::allocate
()
from /usr/lib64/libstdc++.so.5
#5 0x0000000000bc1a31 in
std::__simple_alloc<std::_List_node<XXXXXX>,
std::__default_alloc_template<true, 0> >::allocate
()
#6 0x0000000000bc19fa in
std::_List_alloc_base<XXXXXX, std::allocator<XXXXXX>,
true>::_M_get_node ()
#7 0x0000000000bc19a9 in
std::_List_base<XXXXXX, std::allocator<XXXXXX> >::_List_base ()
#8 0x0000007fbfffcc88 in ?? ()
#9 0x0000007fbfffcbe0 in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0x0000007fbfffcc10 in ?? ()
#12 0x00000000019aac20 in ?? ()
#13 0x0000000000000040 in ?? ()
#14 0x0000000000000001 in ?? ()
#15 0x0000007fbfffcc10 in ?? ()
#16 0x00000000009d20a2 in

XXXXXX is an class.

This bug can not recur.
So could somebody tell how the deadlock happen? or how to recur it and
how to fix it?

Thanks a lot.
Regards.
 
I

Ian Collins

Hi,
I got a problem of deadlock in std::__default_alloc_template<true,
0>::allocate().
It occured in the following environment.
CPU: AMD64(multicore)
OS: suse linux(linux 2.6)
You'd be better off asking in a Linux group, there isn't a C++ language
answer to this.
 
M

Maxim Yegorushkin

I got a problem of deadlock in std::__default_alloc_template<true,
0>::allocate().

How do you know it's a deadlock?
It occured in the following environment.
CPU: AMD64(multicore)
OS: suse linux(linux 2.6)

Are you using -pthread flag when both compiling and linking with gcc?
I can not get all thread's stack. The following stack is the only
thread I can got. It maybe main thread(I am not sure):

#0  0x0000002a9676a0bb in __lll_mutex_lock_wait () from /lib64/tls/
libpthread.so.0
#1  0x0000007fbfffcc60 in ?? ()
#2  0x0000000000000071 in ?? ()
#3  0x0000002a96766fe8 in pthread_mutex_lock () from /lib64/tls/
libpthread.so.0
#4  0x0000002a9650d4e0 in std::__default_alloc_template<true,
0>::allocate
()
   from /usr/lib64/libstdc++.so.5
#5  0x0000000000bc1a31 in
std::__simple_alloc<std::_List_node<XXXXXX>,
std::__default_alloc_template<true, 0> >::allocate
    ()
#6  0x0000000000bc19fa in
std::_List_alloc_base<XXXXXX, std::allocator<XXXXXX>,
true>::_M_get_node ()
#7  0x0000000000bc19a9 in
std::_List_base<XXXXXX, std::allocator<XXXXXX> >::_List_base ()
#8  0x0000007fbfffcc88 in ?? ()
#9  0x0000007fbfffcbe0 in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0x0000007fbfffcc10 in ?? ()
#12 0x00000000019aac20 in ?? ()
#13 0x0000000000000040 in ?? ()
#14 0x0000000000000001 in ?? ()
#15 0x0000007fbfffcc10 in ?? ()
#16 0x00000000009d20a2 in

XXXXXX is an class.

This bug can not recur.
So could somebody tell how the deadlock happen?

Deadlock normally happens because of a coding or logic error.
or how to recur it and how to fix it?

You need to find the cause of your problem and eliminate it.

Post your complete code that demonstrates the problem here, so that we
can see what you are observing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top