Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext-http hangs during shutdown #141

Open
Wouter0100 opened this issue Jan 3, 2025 · 0 comments
Open

ext-http hangs during shutdown #141

Wouter0100 opened this issue Jan 3, 2025 · 0 comments

Comments

@Wouter0100
Copy link

I'm creating this issue because of a finding when running ext-http with FrankenPHP, a PHP runtime build for Caddy. Recently they introduced a way to graceful shutdown FrankenPHP threads, which uncovered a problem with ext-http. I initially thought it was exclusively a FrankenPHP issue and thus opened dunglas/frankenphp#1296, but according to a response it might actually also be ext-http.

See the comment here from @AlliBalliBaba for more info:

From the looks of it, there is some sort of memory corruption happening right after threads are released and the process then hangs at php_module_shutdown. I'm not too familiar with ext-http, but it might not be fully thread-safe. This probably would need fixing in the extension itself.

The errors we see from time to time when shutting down FrankenPHP with ext-http loaded (not always though):

free(): invalid pointer
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
double free or corruption (fasttop)
malloc_consolidate(): invalid chunk size

A very easy way to reproduce this is by starting a Dockerfile:

FROM dunglas/frankenphp:1.3.4-php8.3.14-bookworm

RUN install-php-extensions http

I must admit, I'm not all to familiar with PHP extensions/C. Sorry for any misunderstandings. Thanks!

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

No branches or pull requests

1 participant