Skip to content

Conversation

@asan13
Copy link

@asan13 asan13 commented Nov 3, 2025

Hi,

Issue 77

It seems that the problem arises here in Curl_Multi.xsh:

static int
cb_multi_socket( CURL *easy_handle, curl_socket_t s, int what, void *userptr,
                void *socketp )
...
        (void) curl_easy_getinfo( easy_handle, CURLINFO_PRIVATE, (void *) &easy );
        /* easy is NULL here, if what == CURL_POLL_REMOVE, because easy_handle 
           is an internal libcurl `admin` pointer. */

        /* $multi, $easy, $socket, $what, $socketdata, $userdata */
        SV *args[] = {
                /* 0 */ SELF2PERL( multi ),
                /* 1 */ SELF2PERL( easy ), /* segfault here */

If the parameter what == CURL_POLL_REMOVE, then easy_handle can be an internal handle, and in the new curl, it is a special multi->admin handle.
Callback arguments

Since this callback manages a whole multi handle, an application should not make assumptions about which particular handle that is passed here. It might even be an internal easy handle that the application did not add itself.

It might be better to call perl-callback with NULL in the easy parameter:

SV *args[] = {
                /* 0 */ SELF2PERL( multi ),
                /* 1 */ easy ? SELF2PERL( easy ) : NULL,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant