]> git.ipfire.org Git - thirdparty/libvirt.git/commit
esx: Disable libcurl's use of signals to fix a segfault
authorMatthias Bolte <matthias.bolte@googlemail.com>
Sat, 29 Sep 2012 20:16:30 +0000 (22:16 +0200)
committerCole Robinson <crobinso@redhat.com>
Thu, 18 Oct 2012 17:13:34 +0000 (13:13 -0400)
commit9e423dd3757389b346cf5dff0ab74de76c24cabe
tree87e3c8e6556f697ae026944e22e2649a854ca594
parent1bc28c283b207b3126ad66dd5e8cc6a42245d545
esx: Disable libcurl's use of signals to fix a segfault

libcurl uses a SIGALRM in combination with sigsetjmp/siglongjmp to be
able to abort a DNS lookup when it takes too long. The problem with this
in a multi-threaded application is that the signal handler for SIGALRM
and the call to siglongjmp can be executed on a thread that is different
from the one that initially did the SIGALRM setup and the call to
sigsetjmp. In the reported case this triggered a segfault.

Disable libcurl's use of signals to avoid this situation. This has the
disadvantage of losing the ability to abort synchronous DNS lookups which
might result in libcurl getting stuck in a DNS lookup in the worst case.
When libcurl was build with an asynchronous DNS backend such as c-ares
then there is no problem because the timeout mechanism works without
signals here anyway.

Reported by Benjamin Wang.
(cherry picked from commit 0821ea6b3cf318a9fe4657d5cf77095f96154db8)
src/esx/esx_vi.c