cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: http client easy interface - crashes under load

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Sat, 8 Oct 2016 18:03:42 -0400

On 10/8/2016 4:39 PM, Ferdinand de Boevere via curl-library wrote:
> Running the tool with 100 connections/threads (a.out 100) causes it to
> crash after 3 seconds:
> The web server does not return anything relevant here since
> authentication is missing from the request.
>
> The core file shows the following stack trace:
>
> Core was generated by `./a.out 100'.
> Program terminated with signal 11, Segmentation fault.
> #0 0x000000000042e132 in addbyter (output=110, data=0x2b733e615170)
> at mprintf.c:976
> 976 infop->buffer[0] = outc; /* store */
> (gdb)
> (gdb) bt
> #0 0x000000000042e132 in addbyter (output=110, data=0x2b733e615170)
> at mprintf.c:976
> #1 0x000000000042d048 in dprintf_formatf (data=0x2b733e615170,
> stream=0x42e0f9 <addbyter>,
> format=0x45ff5c "name lookup timed out", ap_save=0x2b733e6151c0)
> at mprintf.c:624
> #2 0x000000000042e1b7 in curl_mvsnprintf (buffer=0xdb3357 <Address
> 0xdb3357 out of bounds>, maxlength=16384,
> format=0x45ff5c "name lookup timed out", ap_save=0x2b733e6151c0)
> at mprintf.c:994
> #3 0x0000000000419f85 in Curl_failf (data=0xdb2a4f, fmt=0x45ff5c
> "name lookup timed out") at sendf.c:234
> #4 0x000000000040e3d5 in Curl_resolv_timeout (conn=0x2b733e6153c0,
> hostname=0x0, port=59, entry=0x46045a, timeoutms=4588634)
> at hostip.c:619
> #5 0x000000000d3b6e00 in ?? ()
> #6 0x00002b733e617000 in ?? ()
> #7 0x00002b732aaaaaab in ?? ()
> #8 0x0000000000000000 in ?? ()

Looks familiar [1]. Please review libcurl thread safety [2], it sounds
like you need to set CURLOPT_NOSIGNAL [3].

[1]: https://github.com/curl/curl/issues/1003
[2]: https://curl.haxx.se/libcurl/c/threadsafe.html
[3]: https://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-09