pycurl FTBFS due to segfault in test suite

Bug #1163609 reported by Barry Warsaw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curl (Ubuntu)
New
High
Barry Warsaw
Raring
New
High
Barry Warsaw
pycurl (Ubuntu)
Triaged
High
Barry Warsaw
Raring
Triaged
High
Barry Warsaw

Bug Description

pycurl FTBFS in Raring:

https://launchpadlibrarian.net/135742128/buildlog_ubuntu-raring-amd64.pycurl_7.19.0-5ubuntu6_FAILEDTOBUILD.txt.gz

The problem is that the test suite runs test_internals.py, and this segfaults. This is easily reproducible outside the build environment using the following code:

$ python
>>> from pycurl import CurlMulti
>>> m = CurlMulti()
>>> del m
Segmentation fault (core dumped)

Tracing through with gdb, the problem appears that calling curl_multi_cleanup() on a CURLM* previously returned by curl_multi_init() is what crashes. The cleanup is called from util_multi_close() in pycurl.c via do_multi_dealloc() but afaict, the CURLM* handle is valid. Or at least, it's unchanged from what curl_multi_init() returns. The above code is taken directly from test_internals.py with the extraneous stuff boiled out.

# remove an invalid but closed handle
if 1:
    m = CurlMulti()
    c = Curl()
    c.close()
    m.remove_handle(c)
    del m, c

'c' isn't needed to reproduce the crash.

Tags: ftbfs
Revision history for this message
Barry Warsaw (barry) wrote :

Likely related to

http://sourceforge.net/p/pycurl/bugs/26/

duplicated at

http://sourceforge.net/p/pycurl/bugs/27/

but as upstream is effectively abandoned, I'd be surprised to see this fixed. I can't find anything useful at

https://github.com/Lispython/pycurl/

which PyPI claims to be the new home of the pycurl2 fork.

Matthias Klose (doko)
Changed in pycurl (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-13.04-beta-1
status: New → Triaged
Revision history for this message
Barry Warsaw (barry) wrote :

Reproducible with this simple C program:

#include <stdio.h>
#include <curl/multi.h>

int main()
{
   CURLM *handle = curl_multi_init();

   printf("handle: 0x%x\n", (unsigned int)handle);
   curl_multi_cleanup(handle);
   return 0;
}

gcc -g -o curltest curltest.c `curl-config --static-libs`

So this looks like it could be a bug in curl itself.

Revision history for this message
Barry Warsaw (barry) wrote :

I'm going to apply the upstream fix for LP: #1124508 and see if that fixes pycurl. It will almost certainly fix the C program crash. I'll un-dup if that turns out to not be the case.

Changed in curl (Ubuntu Raring):
assignee: nobody → Barry Warsaw (barry)
Changed in pycurl (Ubuntu Raring):
assignee: nobody → Barry Warsaw (barry)
Changed in curl (Ubuntu Raring):
milestone: none → ubuntu-13.04-beta-1
importance: Undecided → High
Revision history for this message
Barry Warsaw (barry) wrote :

The curl fix does seem to fix the pycurl build with just a retry (locally at least), so we'll track it in 1124508 for now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.