bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ost::Thread::detach() stability issue


From: Paul Thexton
Subject: ost::Thread::detach() stability issue
Date: Tue, 16 Mar 2004 16:09:04 -0000

Hi,

I've spent the last day or so looking around on this lists' archive, and
also on the savannah site looking for a solution but unfortunatley have
found nothing suitable...

I did however find a post from someone suffering the same problem as me, I
have replied with the following but thought I would post this here as well
in case anyone can enlighten me as to whether I am doing something wrong, or
if it is indeed a bug with commonc++

Basically I have a small application which (right now) is simply accepting a
connection in on a port, printing down a couple of messages to the client
connection and then finishing the thread ....

Unfortunately, the application is randomly (ie I cannot fully replicate the
problem, as in "it happens after x number of connections" etc ...) core
dumping on me, I can force this to happen by launching telnet to the
application port one after the other in quick succession (although this has
happened when the application is running under more "normal" operating
paramters)....

I have analysed the core dump and posted to savannah
(http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=6057) as
below......

I've come across this exact same error, I'm currently running on :

gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

commonc++ version is 2-1.1.0

This problem does appear to be entirely random however the only time I can
force it to happen is if I force lots of connections to go through in a
short time ....

The output from the debugger is:

(gdb) bt full
#0 0x403b03be in ost::Thread::detach(ost::Semaphore*) (this=0x805e1f0,
start=0x0) at thread.cpp:789
rtn = 0
#1 0x0804d0d8 in main () at IPXP2.cpp:49
server = {<TCPSocket> = {<Socket> = {_vptr.Socket = 0x8058648, errid =
errSuccess, errstr = 0x0, syserr = 0, flags = {
thrown = false, broadcast = false, route = true, keepalive = false, loopback
= true, multicast = false,
completion = false, linger = false, ttl = 1}, so = 3, state = BOUND}, <No
data fields>}, <No data fields>}
tcp = (myTCPSession *) 0x805e168
addr = {<InetAddress> = {_vptr.InetAddress = 0x80586b8, validator = 0x0,
ipaddr = 0x805e158, addr_count = 1,
hostname = 0x0, static mutex = {_vptr.Mutex = 0x403c61b8, static _debug =
Cannot access memory at address 0x0



The line the debugger believes to have caused the crash is:

788: rtn = pthread_create(&priv->_tid, &priv->_attr,
exec_t(&ccxx_exec_handler), this);
789: if(!rtn && priv->_tid)
790: return 0;
791: return -1;

Since the core file suggests that the value of rtn = 0, then I'm assuming
the problem is with priv->_tid .... is there some kind of mutex needing to
go on here? or is pthread_create() not doing its job properly?

I'm really confused by this error, I really do want to use this threading
model for an application I am writing currently but if I cannot get this
resolved, then I am going to have to revert back to a more basic (and
unmanagable) ansi C implementation.

Thanks if anyone can help!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]