Skip to content

PHP 8.3 with libcurl 7.29.0 segmentation fault #20815

@thg2k

Description

@thg2k

Description

I know this is a bit late to the party, but as the last 8.3 bugfix release is about to happen, I was wondering if we can get this segfault fixed.

The reason is very straightforward, the multi init should be followed by at least one curl_multi_add_handler before it is destroyed, otherwise the library crashes in the curl_multi_cleanup function.

I'd happy to provide a PR but I will need a few more days, if somebody has a quick fix idea please go ahead.

For the records, this bug exists since at least PHP 7.2.

The following code:

<?php
$ch = curl_multi_init();
unset($ch);
print "EOF\n";

Resulted in this output:

Segmentation fault (core dumped)

But I expected this output instead:

EOF

PHP Version

PHP 8.3.29 (cli) (built: Dec 29 2025 17:10:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.29, Copyright (c) Zend Technologies

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions