frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Segmentation fault (core dumped)

Open kharbat opened this issue 1 year ago • 2 comments

What happened?

Not necessarily a bug - I'm testing Frankenphp for the first time on my Yii2 project.

Running frankenphp php-server -a -v in my web directory. It works for seconds, it handles a few requests and then randomly crashes with no meaningful message, just Segmentation fault (core dumped).

Am I missing something?

Build Type

Standalone binary

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

default php8.3 php.ini

Relevant log output

No response

kharbat avatar Nov 01 '24 22:11 kharbat

Trying the worker mode using frankenphp php-server -a -v --worker /var/www/api/web/index.php

Results with the following errors. Knowing that I have no function called apache_request_headers() in the entire code.

- 2024/11/01 22:40:43.256 ERROR   unexpected termination, restarting      {"worker": "/var/www/api/web/index.php", "exit_status": 1}

- 2024/11/01 22:40:43.256 DEBUG   apache_request_headers() called in non-HTTP context     {"worker": "/var/www/api/web/index.php"}

- 2024/11/01 22:40:43.254 DEBUG   apache_request_headers() called in non-HTTP context     {"worker": "/var/www/api/web/index.php"}

- 2024/11/01 22:40:43.257 ERROR   unexpected termination, restarting      {"worker": "/var/www/api/web/index.php", "exit_status": 1}

- 2024/11/01 22:40:43.255 ERROR   unexpected termination, restarting      {"worker": "/var/www/api/web/index.php", "exit_status": 1}

- 2024/11/01 22:40:43.257 DEBUG   starting        {"worker": "/var/www/api/web/index.php", "num": 40}

- 2024/11/01 22:40:43.255 DEBUG   apache_request_headers() called in non-HTTP context     {"worker": "/var/www/api/web/index.php"}

- 2024/11/01 22:40:43.253 ERROR   unexpected termination, restarting      {"worker": "/var/www/api/web/index.php", "exit_status": 1}

kharbat avatar Nov 01 '24 22:11 kharbat

It's probably one of your library that calls apache2_resuests_headers().

For the crash, please check that your or code or the libraries you use aren't using an extension known to crash (the usual suspect is OpenSSL): https://frankenphp.dev/docs/known-issues/#buggy-php-extensions

If you're using OpenSSl, please switch to the Docker image we provide or compile FrankenPHP locally. This will fix the issue.

If it's another thing, could you follow these steps to get a stack trace please? https://frankenphp.dev/docs/contributing/#debugging-segmentation-faults-with-static-builds

dunglas avatar Nov 02 '24 06:11 dunglas