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

ZTS support on Alpine is broken #8160

Closed
mvorisek opened this issue Mar 1, 2022 · 4 comments
Closed

ZTS support on Alpine is broken #8160

mvorisek opened this issue Mar 1, 2022 · 4 comments

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Mar 1, 2022

Description

see docker-library/php#1076, the issue is described at docker-library/php#1076 (comment)

I expect all bundled exts to be ZTS compatible on every linux platform, incl. Alpine.

PHP Version

8.0, 8.1, probably also master

@cmb69
Copy link
Contributor

cmb69 commented Mar 1, 2022

I think we need to enable the static TSRM cache:

 ext/pdo/config.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/pdo/config.m4 b/ext/pdo/config.m4
index 9b9a3e36df..63a2f7ed0f 100644
--- a/ext/pdo/config.m4
+++ b/ext/pdo/config.m4
@@ -9,7 +9,7 @@ if test "$PHP_PDO" != "no"; then
   dnl Make sure $PHP_PDO is 'yes' when it's not 'no' :)
   PHP_PDO=yes
 
-  PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c, $ext_shared)
+  PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c, $ext_shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
   PHP_ADD_EXTENSION_DEP(pdo, spl, true)
   PHP_INSTALL_HEADERS(ext/pdo, [php_pdo.h php_pdo_driver.h php_pdo_error.h])

Interestingly:

EXTENSION('pdo', 'pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c', false /* force static, PHP_PDO_SHARED is broken yet somehow */);

@unix-world
Copy link

unix-world commented Mar 4, 2022

Not sure, but as far as I know Alpine linux does not use the standard glibc ... Perhaps that's the problem there.
https://wiki.alpinelinux.org/wiki/Running_glibc_programs

Because of these there are many programs that have not yet been ported natively to Alpine Linux and they requires to be run in a flatpak environment which is something different than running them natively ...
Ex: thunderbird !

@krakjoe
Copy link
Member

krakjoe commented Mar 4, 2022 via email

@cmb69 cmb69 linked a pull request Mar 7, 2022 that will close this issue
@cmb69 cmb69 closed this as completed in 2b2aeb9 Mar 11, 2022
cmb69 added a commit that referenced this issue Mar 11, 2022
* PHP-8.0:
  Fix GH-8160: ZTS support on Alpine is broken
cmb69 added a commit that referenced this issue Mar 11, 2022
* PHP-8.1:
  Fix GH-8160: ZTS support on Alpine is broken
@mihas2
Copy link

mihas2 commented Mar 1, 2024

confirm! php:8.2-zts-alpine - craches with "segmentation fault core dumped"

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

Successfully merging a pull request may close this issue.

6 participants
@mvorisek @krakjoe @cmb69 @unix-world @mihas2 and others