-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Crash on Connecting to Postgres - Laravel #514
Comments
Possibly also related to #458. |
FWIW I have a similar issue on a mac M2 with laravel and postgresql. It works fine connecting to a local db but when I attempt to connect using a frankenphp(8451,0x175243000) malloc: double free for ptr 0x13300c200
frankenphp(8451,0x175243000) malloc: *** set a breakpoint in malloc_error_break to debug |
This should probably be reported to static-php-cli, or to PHP itself. This smells like an upstream bug. |
I suspect this is the issue since AFAIK, apt doesn't install php's thread safe libraries. |
Debian packages aren't used and it's useless to install them. Octane installs the static binary we provide, which is built using ZTS and doesn't use local PHP extensions. |
Hello, first of all, thanks for the great job you are doing with FrankenPHP, @dunglas ! I'm experiencing the same segfault on Reproduced with:
Contents of <?php
pg_connect("postgresql://root:xxxxx@127.0.0.1/postgres");
# ./frankenphp-linux-x86_64 php-cli index.php
Segmentation fault (core dumped)
# wget https://github.com/dunglas/frankenphp/releases/download/v1.1.0/frankenphp-linux-x86_64
# chmod 755 frankenphp-linux-x86_64
# ./frankenphp-linux-x86_64 php-server
2024/02/25 18:37:46.277 WARN admin admin endpoint disabled
2024/02/25 18:37:46.278 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0001d5080"}
2024/02/25 18:37:46.278 WARN http.auto_https server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "php", "http_port": 80}
2024/02/25 18:37:46.280 INFO http.log server running {"name": "php", "protocols": ["h1", "h2", "h3"]}
2024/02/25 18:37:46.280 INFO FrankenPHP started 🐘 {"php_version": "8.3.3"}
2024/02/25 18:37:46.281 INFO Caddy serving PHP app on :80
2024/02/25 18:37:46.292 WARN tls storage cleaning happened too recently; skipping for now {"storage": "FileStorage:/root/.local/share/caddy", "instance": "6f0de059-811e-440a-861f-08b240d7cb33", "try_again": "2024/02/26 18:37:46.292", "try_again_in": 86399.999999001}
2024/02/25 18:37:46.292 INFO tls finished cleaning storage units
# curl http://127.0.0.1/index.php
curl: (52) Empty reply from server
[1]+ Segmentation fault (core dumped) ./frankenphp-linux-x86_64 php-server
# docker run -it --rm -v $PWD:/app/public -p 80:80 dunglas/frankenphp bash
[we are in the docker now]
$ /usr/local/bin/install-php-extensions pgsql
[...long output of installing...]
$ /usr/local/bin/frankenphp php-cli index.php
$ No segfault this time (and I confirmed that I can run SQL over the connection). (Without the |
Just a small update and workaround, based on the thread in <?php
$conn = pg_connect("postgresql://root:xxxxx@127.0.0.1/postgres?sslmode=disable"); |
Heads up: the bug was fixed upstream in crazywhalecc/static-php-cli#353 in |
Thank you for getting this fixed @kkovacs! |
When the following database connection code is enable , it will crash the whole octane running franken without any error
Command used to run FrankenPHP
If i run it with ./frankenphp run , it will return the following and crash
Segmentation fault
I've installed
sudo apt-get install php8.3-pgsql
sudo apt-get install php8.3-pdo
Update : I've tested it on ARM initially, now x86, it's the same issue.
The text was updated successfully, but these errors were encountered: