curl-library
RE: Curl_resolv_timeout crash in AIX
Date: Wed, 9 Dec 2015 08:42:49 +0000
Hi,
I met a curl_resolv_timeout crash in AIX7.1 when curl is running in multi-thread. Curl version is the latest, 7.45.0. The call stack is:
Segmentation fault in addbyter at 0x8000000004b3418 ($t3)
0x8000000004b3418 (addbyter+0x18) 98650000 stb r3,0x0(r5)
(dbx) where
addbyter(??, ??) at 0x8000000004b3418
dprintf_formatf(??, ??, ??, ??) at 0x8000000004b3564
curl_mvsnprintf(??, ??, ??, ??) at 0x8000000004b3324
Curl_failf(0x90000000002ab90, 0x8001000a008ef68, 0x44204080, 0x800000000000d032, 0x3ffc000000000003, 0x2ba8, 0x0, 0x0) at 0x8000000004b31d0
Curl_resolv_timeout(??, ??, ??, ??, ??) at 0x8000000004bdd58
And I have already set the CURLOPT_NOSIGNAL to 1L according to advice.
But in redhat linux, my program runs OK, the core dump only happens in AIX7.1.
And I also add the configure option --enable-threaded-resolver to compile curl, the core dump still happens.
Could someone give me some advice ?
Thanks a lot.
I have some findings about the above problem.
I found data->set.no_signal has been modified somewhere after init.
In my program, I set CURLOPT_NOSIGNAL to 1, and set CURLOPT_TIMEOUT to 1200. And I add some printf in curl code url.c and hostip.c.
Here in url.c:
case CURLOPT_NOSIGNAL:
/*
* The application asks not to set any signal() or alarm() handlers,
* even when using a timeout.
*/
data->set.no_signal = (0 != va_arg(param, long))?TRUE:FALSE;
printf("Set data->set.no_signal = %d\n", data->set.no_signal); // added printf
break;
And in hostip.c, function Curl_resolv_timeout() :
#ifdef USE_ALARM_TIMEOUT
printf("Display data->set.no_signal = %d\n", data->set.no_signal); // added printf
if(data->set.no_signal)
/* Ignore the timeout when signals are disabled */
timeout = 0;
else
timeout = timeoutms;
In the screen outpu, I can see:
Set data->set.no_signal = 1
Display data->set.no_signal = 0
And also the timeoutms is not 1200000 anymore, it is the default value 300000.
It seems the 2 values have been reset to default value somewhere.
But I searched curl source code, cannot find anywhere the 2 values are reset.
Can someone help ?
Thanks.
B.R.
Fred
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-12-09