Opened 13 years ago

Closed 12 years ago

#1844 closed Bug (fixed)

Prefer curl_multi_socket_action() to curl_multi_perform() in modern versions of libcurl

Reported by: charles Owned by: charles
Priority: Normal Milestone: 1.75
Component: libtransmission Version: 1.74
Severity: Major Keywords:
Cc:

Description

I'm seeing stability issues with 1.50's use of curl_multi_perform() in libtransmission/web.c on F10, which (iirc) uses 7.18.2. Over a three hour transmission session I experienced two crashes deep inside libcurl. Both of them involved a near-NULL pointer (eg, 0x52) as if fields in a NULL struct pointer were being dereferenced. Replacing curl_multi_perform() calls with curl_multi_socket_action() solves the problem.

Unfortunately we switched from curl_multi_socket_action() to curl_multi_perform() in 1.50 to work around a bug in the older version of libcurl that's bundled with OS X.

One solution would be to check the libcurl version at compile time to decide to which function call to use. Skimming the curl release notes, it looks like 7.18.0 would be a good arbitrary point to start using curl_multi_socket_action().

Change History (9)

comment:1 Changed 13 years ago by charles

  • Owner set to charles
  • Status changed from new to assigned

xref: #1748

comment:2 Changed 13 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed

Added to trunk in r7905

Added to 1.5x branch in r7906

comment:3 Changed 12 years ago by charles

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening due to new problems that this seems to cause between OS X 10.5 and 10.6 support.

comment:4 Changed 12 years ago by charles

  • Milestone changed from 1.51 to 1.75
  • Version changed from 1.50 to 1.74

according to Sujay in the forums, r9053 is causing new libcurl problems.

r9053 was done for ticket #2377, to ensure that when we make Transmission builds on Snow Leopard, the executable will still run on Leopard.

10.5 uses libcurl 7.16, and 10.6 has libcurl 7.19. The change in r9053 started compiling Transmission with the old libcurl 7.16 headers so that we wouldn't leave 10.5 users behind. It's possible that there's some incompatibility from building with libcurl 7.16 and then running that executable on Snow Leopard's libcurl 7.19.

In libtransmission there is code that decided at compile time which behavior to use depending on whether the version of libcurl available was 7.18 or higher... so that looks like prime suspect. In r9065 I've removed that compile-time check and made it a runtime check instead, so it should play nice on both 10.5 and 10.6.

I've made this change from compile-time to run-time in trunk with r9065.

comment:5 Changed 12 years ago by charles

  • Component changed from Transmission to libtransmission

comment:6 Changed 12 years ago by livings124

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:7 Changed 12 years ago by livings124

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:8 Changed 12 years ago by charles

r9065 has been backported from trunk to 1.7x by r9072.

comment:9 Changed 12 years ago by charles

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.