cURL / Mailing Lists / curl-library / Single Mail

curl-library

segfault in hash.c

From: Jeff Pohlmeyer <yetanothergeek_at_yahoo.com>
Date: Thu, 4 Sep 2003 13:47:42 -0700 (PDT)

I am trying to run curl_multi on a separate thread from inside a gtk program.
( Currently it is about 11,000 lines of pascal-flavored spaghetti. )

I keep getting a lot of SIGSEGV's that look like the one below.

These crashes don't always occur in exactly the same place every time, but
it is almost always when some function in hostip.c calls some function in
hash.c , and passes it a 0xFFFFFFF pointer.

Any ideas what is causing this?

This a pascal syntax backtrace -
  The "$" means hexadecimal, and the #'s are ascii char codes...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1026 (LWP 31555)]

Curl_hash_clean_with_criterium (h=$83a6948, user=$bf7ff370,
    comp=$4005d340 <hostcache_timestamp_remove at hostip.c:170>) at hash.c:248

248 if (comp(user, ((curl_hash_element *) CURL_LLIST_VALP(le))->ptr)) {

(gdb) print le
$1 = (^curl_llist_element) $fffffffd

(gdb) print le.ptr
Cannot access memory at address $fffffffd
(gdb) bt 18

#0 Curl_hash_clean_with_criterium (h=$83a6948, user=$bf7ff370,
    comp=$4005d340 <hostcache_timestamp_remove at hostip.c:170>) at hash.c:248
#1 $4005d3a7 in hostcache_prune (hostcache=$83a6948, cache_timeout=0,
    now=1062707526) at hostip.c:193
#2 $4005d48b in cache_resolv_response (data=$8313ef0, addr=$81e90f8,
    hostname=$83a6890 'img-cdn.mediaplex.com', port=80) at hostip.c:247
#3 $4005da1e in host_callback (arg=$831d480, status=0, hostent=$8202238)
    at hostip.c:502
#4 $4007a1ef in end_hquery (hquery=$83a68b0, status=0, host=$8202238)
    at ares_gethostbyname.c:151
#5 $4007a1a9 in host_callback (arg=$83a68b0, status=0,
    abuf=$bf7ff544 '~j'#129#128, alen=472) at ares_gethostbyname.c:143
#6 $4007d2f3 in qcallback (arg=$83a67a0, status=0,
    abuf=$bf7ff544 '~j'#129#128, alen=472) at ares_query.c:109
#7 $4007c294 in end_query (channel=$831dc40, query=$8327bd0, status=0,
    abuf=$bf7ff544 '~j'#129#128, alen=472) at ares_process.c:605
#8 $4007bcc2 in process_answer (channel=$831dc40,
    abuf=$bf7ff544 '~j'#129#128, alen=472, whichserver=0, tcp=0,
    now=1062707526) at ares_process.c:348
#9 $4007bb27 in read_udp_packets (channel=$831dc40, read_fds=$bf7ff838,
    now=1062707526) at ares_process.c:262
#10 $4007b72b in ares_process (channel=$831dc40, read_fds=$bf7ff838,
    write_fds=$bf7ff7b8) at ares_process.c:67
#11 $4005d7c3 in Curl_is_resolved (conn=$831d480, done=$bf7ff8f6 '')
    at hostip.c:409
#12 $400781b1 in curl_multi_perform (multi_handle=$80d1ef8,
    running_handles=$bf7ffab0) at multi.c:367
#13 $080555c8 in TITEMQUEUE__GETSUBITEMS (ITEM_QUEUE=$40c72c9c,
    MULTI_HANDLE=$80d1ef8, this=$809b38c) at wb_queue.pp:432
#14 $08055944 in TITEMQUEUE__FETCH (this=$809b38c) at wb_queue.pp:584
#15 $08070f06 in STARTCURLTHREAD (P=$0) at wb_thread.pp:994
#16 $403daca3 in pthread_start_thread () from /lib/libpthread.so.0
#17 $403dacee in pthread_start_thread_event () from /lib/libpthread.so.0

TIA,
 - Jeff

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-04