Bug 1593595
| Summary: | test_fetch_uri segfaults on master | ||
|---|---|---|---|
| Product: | [Retired] Restraint | Reporter: | Roman Joost <rjoost> |
| Component: | general | Assignee: | Roman Joost <rjoost> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Matt Tyson 🤬 <mtyson> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | master | CC: | asavkov, bpeck, dcallagh, mtyson, rjoost |
| Target Milestone: | 0.1.36 | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-09-17 05:53:06 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Roman Joost
2018-06-21 07:34:42 UTC
I can't merge my code from Bug 1590570 unless we've passing tests, might as well fix this. I've checked our slaves which have: glibc-2.25-12.fc26.src.rpm glib2-2.52.3-2.fc26.src.rpm curl-7.53.1-13.fc26.src.rpm and on a newly provisioned F26 machine we have: glibc-2.25-13.fc26.src.rpm glib2-2.52.3-2.fc26.src.rpm curl-7.53.1-16.fc26.src.rpm I've now confirmed that building it from source on our Fedora 26 Jenkins instance works. I've downgraded all obvious dependencies of restraint on a newly provisioned Fedora 26 instance in Beaker to match up what I have identified with the Jenkins instance. Yet it still segfaults in libcurl (curl_multi_socket_action). I've taken a different approach and grabbed the sources in distgit for the two builds from Fedora: curl-7.53.1-13.fc26 https://koji.fedoraproject.org/koji/buildinfo?buildID=1006496 curl-7.53.1-16.fc26 https://koji.fedoraproject.org/koji/buildinfo?buildID=1058139 and prepared a static build from the third-party folder in restraint with these sources. The curl sources were fully patched before. The test runs without a segfault. Now I'm beginning to think that the data being handed to libcurl through the g_main_loop_run is getting somehow corrupted. I first thought that our glib version in the third-party folder was too old, but it just had recently been updated by Matt. Perhaps next attempt is to try watching the data with gdb and see if it indeed gets corrupted and by what. Heh so that one was a bit of a layer cake. Matt found the point in the source code, where we allocated memory for a cURL error buffer on the stack. This buffer however needs to stay around for the livetime of the connection in order for cURL to write to it.
For this particular test it did actually try to write the error, yet at that point the buffer was already gone.
The actual cURL error was:
* SMB shares are not supported in file: URLs.
which oddly enough we don't use. All we have is a file URL pointing to a local directory:
g_strdup_printf("file:///%s/test-data/http-remote/fetch_http.tgz#restraint/sanity/fetch_git", cwd)
What that becomes however is: file:////home/rjoost/works/restraint/src/test-data/http-remote/fetch_http.tgz#restraint/sanity/fetch_git
(Note the additional slash in the authority)
Also related to this is: https://github.com/curl/curl/commit/695e96b3d5b9e6ae4832af5f8e99e07de960bf33
Reverting the patch and running the test suite shows us the crash. With the patch applied we don't get the crash any more. Restraint 0.1.36 was released on 24 August. |