Http.c write_request_thread disappeared ?

"fred" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <000001c791c6$1980ebe0$4ce0110a@FRED42>
I attached to a stuck smsbox, and it appears the write_request_thread not
running,
Yet pending_requests has a len of 99.
client_threads_are_running = 1

So hmm, something happened....

Anyway why wouldn't you write 

static void write_request_thread(void *arg)
{
   client_threads_are_running = 1;

   ......


   client_threads_are_running = 0;
}

This would ensure if the thread exits hopefully normally,
It automatically resets client_threads_are_running
?
Instead we have it currently written done in start_client_threads(void)

This doesn't occur often, and was lucky to be able to attach debugger to it

Anyway, thoughts ?
 

========
When attached, heres what I got
Thread 10 (Thread -1223447632 (LWP 18286)):
#0  0xb72a1f3d in poll () from /lib/tls/libc.so.6
#1  0x080a4207 in gwthread_poll (fds=0x833f000, numfds=0, timeout=60) at
gwlib/gwthread-pthread.c:737
#2  0x080a29bf in poller (arg=0x8313500) at gwlib/fdset.c:331
#3  0x080a37a3 in new_thread (arg=0x83148a8) at gwlib/gwthread-pthread.c:362
#4  0xb7536dfc in start_thread () from /lib/tls/libpthread.so.0
#5  0xb72aaf2a in clone () from /lib/tls/libc.so.6

Thread 9 (Thread -1233937488 (LWP 18287)):
#0  0xb72a1f3d in poll () from /lib/tls/libc.so.6
#1  0x080a4207 in gwthread_poll (fds=0xb6739960, numfds=1, timeout=-1) at
gwlib/gwthread-pthread.c:737
#2  0x080a8187 in server_thread (dummy=0x0) at gwlib/http.c:2205
#3  0x080a37a3 in new_thread (arg=0x8314808) at gwlib/gwthread-pthread.c:362
#4  0xb7536dfc in start_thread () from /lib/tls/libpthread.so.0
#5  0xb72aaf2a in clone () from /lib/tls/libc.so.6

Thread 8 (Thread -1244427344 (LWP 18288)):
#0  0xb753920b in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/tls/libpthread.so.0
#1  0x080ab040 in gwlist_consume (list=0x82f5808) at gwlib/list.c:421
#2  0x080a7de8 in port_get_request (port=14063) at gwlib/http.c:2003
#3  0x080a883f in http_accept_request (port=14063, client_ip=0x2273,
url=0xfffffffc, headers=0xfffffffc, body=0xb5d38a64, 
    cgivars=0x2273) at gwlib/http.c:2402
#4  0x0808022f in sendsms_thread (arg=0x0) at gw/smsbox.c:3386
#5  0x080a37a3 in new_thread (arg=0x832f970) at gwlib/gwthread-pthread.c:362
#6  0xb7536dfc in start_thread () from /lib/tls/libpthread.so.0
#7  0xb72aaf2a in clone () from /lib/tls/libc.so.6

Thread 7 (Thread -1254917200 (LWP 18289)):
---Type <return> to continue, or q <return> to quit---
#0  0xb753920b in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/tls/libpthread.so.0
#1  0x080ab040 in gwlist_consume (list=0x833e090) at gwlib/list.c:421
#2  0x0807c596 in obey_request_thread (arg=0x0) at gw/smsbox.c:1740
#3  0x080a37a3 in new_thread (arg=0x8336820) at gwlib/gwthread-pthread.c:362
#4  0xb7536dfc in start_thread () from /lib/tls/libpthread.so.0
#5  0xb72aaf2a in clone () from /lib/tls/libc.so.6

Thread 6 (Thread -1265407056 (LWP 18290)):
#0  0xb753920b in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/tls/libpthread.so.0
#1  0x080ab040 in gwlist_consume (list=0x833e040) at gwlib/list.c:421
#2  0x080a75e9 in http_receive_result_real (caller=0xfffffffc,
status=0xfffffffc, final_url=0xb4936a60, headers=0xb4936a64, 
    body=0xb4936a68, blocking=1) at gwlib/http.c:1669
#3  0x0807ae46 in url_result_thread (arg=0x0) at gw/smsbox.c:1247
#4  0x080a37a3 in new_thread (arg=0x8337060) at gwlib/gwthread-pthread.c:362
#5  0xb7536dfc in start_thread () from /lib/tls/libpthread.so.0
#6  0xb72aaf2a in clone () from /lib/tls/libc.so.6

Thread 5 (Thread -1275896912 (LWP 18291)):
#0  0xb753920b in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/tls/libpthread.so.0
#1  0x080ab040 in gwlist_consume (list=0x833e108) at gwlib/list.c:421
#2  0x0807ac92 in http_queue_thread (arg=0x0) at gw/smsbox.c:1166
#3  0x080a37a3 in new_thread (arg=0x8337818) at gwlib/gwthread-pthread.c:362
#4  0xb7536dfc in start_thread () from /lib/tls/libpthread.so.0
#5  0xb72aaf2a in clone () from /lib/tls/libc.so.6

Thread 4 (Thread -1286386768 (LWP 18292)):
#0  0xb72a1f3d in poll () from /lib/tls/libc.so.6
#1  0x080a42df in gwthread_sleep (seconds=30) at gwlib/gwthread-pthread.c:771
#2  0x08081916 in heartbeat_thread (arg=0x833e3b8) at gw/heartbeat.c:109
---Type <return> to continue, or q <return> to quit---
#3  0x080a37a3 in new_thread (arg=0x833e3d8) at gwlib/gwthread-pthread.c:362
#4  0xb7536dfc in start_thread () from /lib/tls/libpthread.so.0
#5  0xb72aaf2a in clone () from /lib/tls/libc.so.6

Thread 3 (Thread -1296876624 (LWP 18301)):
#0  0xb753b6f1 in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#1  0xb75387a7 in _L_mutex_lock_28 () from /lib/tls/libpthread.so.0
#2  0x08340210 in ?? ()
#3  0x0812e344 in __func__.9 ()
#4  0xb2b33a18 in ?? ()
#5  0x080b520f in mutex_lock_real (mutex=0x477d, file=0x83446a0 "\034",
line=202, func=0xb7240e0b "\201Ã\215*\f")
    at gwlib/thread.c:135
Previous frame identical to this frame (corrupt stack?)
#0  0xb72a1f3d in poll () from /lib/tls/libc.so.6
(gdb)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.