Skip to content

Failed tests, afer compiling PHP 8.3.3 on Alpine Linux 3.19.0 #13696

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

Open
zoot opened this issue Mar 13, 2024 · 3 comments
Open

Failed tests, afer compiling PHP 8.3.3 on Alpine Linux 3.19.0 #13696

zoot opened this issue Mar 13, 2024 · 3 comments

Comments

@zoot
Copy link

zoot commented Mar 13, 2024

Description

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    31 (skeleton, sodium, pdo_dblib, intl, bcmath, sysvshm, pcntl, tidy, sysvsem, ldap, xsl, enchant, dba, zend_test, pgsql, snmp, pdo_pgsql, dl_test, ffi, pdo_firebird, shmop, readline, sysvmsg, pdo_oci, pspell, oci8, odbc, sockets, imap, com_dotnet, pdo_odbc)
Exts tested     :    42
---------------------------------------------------------------------

Number of tests : 18830             15071
Tests skipped   :  3759 ( 20.0%) --------
Tests warned    :     0 (  0.0%) (  0.0%)
Tests failed    :    16 (  0.1%) (  0.1%)
Expected fail   :     9 (  0.0%) (  0.1%)
Tests passed    : 15046 ( 79.9%) ( 99.8%)
---------------------------------------------------------------------
Time taken      :   424 seconds
=====================================================================

=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
Test open_basedir configuration [tests/security/open_basedir_linkinfo.phpt]  XFAIL REASON: BUG: open_basedir cannot delete symlink to prohibited file. See also
bugs 48111 and 52176.
Bug #47847 (importNode loses the namespace of an XML element) [ext/dom/tests/bug47847.phpt]  XFAIL REASON: See https://github.com/php/php-src/pull/12308
Bug #55294 (DOMDocument::importNode shifts namespaces when "default" namespace exists) [ext/dom/tests/bug55294.phpt]  XFAIL REASON: See https://github.com/php/php-src/pull/12308
Bug #42718 (unsafe_raw filter not applied when configured as default filter) [ext/filter/tests/bug42718.phpt]  XFAIL REASON: FILTER_UNSAFE_RAW not applied when configured as default filter, even with flags
Bug #67296 (filter_input doesn't validate variables) [ext/filter/tests/bug49184.phpt]  XFAIL REASON: See Bug #49184
Bug #67167: filter_var(null,FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE) returns null [ext/filter/tests/bug67167.02.phpt]  XFAIL REASON: Requires php_zval_filter to not use convert_to_string for all filters.
Return type check elision [ext/opcache/tests/opt/verify_return_type.phpt]  XFAIL REASON: Return types cannot be inferred through prototypes
via [ext/pdo_sqlite/tests/common.phpt]
	SQLite PDO Common: PDOStatement::getColumnMeta [ext/pdo_sqlite/tests/pdo_022.phpt]  XFAIL REASON: This feature is not yet finalized, no test makes sense
updateTimestamp never called when session data is empty [ext/session/tests/user_session_module/bug71162.phpt]  XFAIL REASON: Current session module is designed to write empty session always. In addition, current session module only supports SessionHandlerInterface only from PHP 7.0.
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #53251 (bindtextdomain with null dir doesn't return old value) [ext/gettext/tests/bug53251.phpt]
Gettext basic test with en_US locale that should be on nearly every system [ext/gettext/tests/gettext_basic-enus.phpt]
test if bind_textdomain_codeset() returns correct value [ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt]
Test if bindtextdomain() returns string id if no directory path is set(if directory path is 'null') [ext/gettext/tests/gettext_bindtextdomain-cwd.phpt]
Test dcgettext() functionality [ext/gettext/tests/gettext_dcgettext.phpt]
Test dgettext() functionality [ext/gettext/tests/gettext_dgettext.phpt]
Test if dngettext() returns the correct translations (optionally plural). [ext/gettext/tests/gettext_dngettext-plural.phpt]
Test ngettext() functionality [ext/gettext/tests/gettext_ngettext.phpt]
Bug #48147 (iconv with //IGNORE cuts the string) [ext/iconv/tests/bug48147.phpt]
Bug #52211 (iconv() returns part of string on error) [ext/iconv/tests/bug52211.phpt]
Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence) [ext/iconv/tests/bug76249.phpt]
EUC-JP to ISO-2022-JP [ext/iconv/tests/eucjp2iso2022jp.phpt]
iconv_mime_encode() [ext/iconv/tests/iconv_mime_encode.phpt]
ISSUE #115 (path issue when using phar) [ext/opcache/tests/issue0115.phpt]
ISSUE #149 (Phar mount points not working this OPcache enabled) [ext/opcache/tests/issue0149.phpt]
Killing server should terminate all worker processes [sapi/cli/tests/php_cli_server_pdeathsig.phpt]
=====================================================================

PHP Version

PHP 8.3.3

Operating System

Alpine Linux 3.19.0 Kernel 6.6.12-0-virt

Test Results

php_test_results_20240313_0957.txt

@orlitzky
Copy link
Contributor

orlitzky commented Nov 4, 2024

This is a musl issue (not necessarily Alpine) and is affecting Gentoo now too: https://bugs.gentoo.org/942610

@orlitzky orlitzky mentioned this issue Nov 7, 2024
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 15, 2024
According to POSIX, bindtextdomain() returns "the implementation-
defined default directory pathname used by the gettext family of
functions" when its second parameter is NULL (i.e. when you are
querying the directory corresponding to some text domain and that
directory has not yet been set). But musl does not do this: when no
directory has been set, it consults an environment variable (that
itself may be unset), and there is no default:

  if (!libc.secure) path = getenv("MUSL_LOCPATH");
  /* FIXME: add a default path? */

Worse, the musl bindtextdomain(..., NULL) query always returns NULL,
even when MUSL_LOCPATH is set. This is segfaulting bindtextdomain() in
PHP because it tries to RETURN_STRING on the NULL pointer that the C
function returns.

To work around this, we check for a NULL return from the C function,
and then try to return the value of MUSL_LOCPATH. (This still isn't
perfect, because MUSL_LOCPATH can contain multiple paths, but at least
it's a string.) If MUSL_LOCPATH is unset, we RETURN_FALSE to indicate
failure (there's really no default) rather than segfaulting.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 15, 2024
…musl

The musl implementation of bind_textdomain_codeset() always returns
NULL. The POSIX-correctness of this is debatable, but it is roughly
equivalent to correct, because musl only support UTF-8, so the NULL
value indicating that the codeset is unchanged from the locale's
codeset (UTF-8) is accurate.

PHP's bind_textdomain_codeset() function however treats NULL as
failure, unconditionally:

  * php/doc-en#4311
  * php#17163

This unfortunately causes false to be returned consistently on musl --
even when nothing unexpected has happened -- and naturally this is
affecting several tests. For now we change two tests to accept "false"
in addition to "UTF-8" so that they may pass on musl. If PHP's
bind_textdomain_codeset() is updated to differentiate between NULL and
NULL-with-errno-set, these tests can also be updated once again to
reject the NULL-with-errno result.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 15, 2024
The gettext() family of functions under musl does not support codeset
suffixes like ".UTF-8", because the only codeset it understands is
UTF-8. (Yes, it is annoying that it doesn't support the suffix for the
codeset that it does understand; no, I am not in charge.) Thanks to
this, we have six failing tests on musl,

  * FAIL Gettext basic test with en_US locale that should be on nearly
    every system
    [ext/gettext/tests/gettext_basic-enus.phpt]

  * FAIL Test if bindtextdomain() returns string id if no directory path
    is set( if directory path is 'null')
    [ext/gettext/tests/gettext_bindtextdomain-cwd.phpt]

  * FAIL Test dcgettext() functionality
    [ext/gettext/tests/gettext_dcgettext.phpt]

  * FAIL Test dgettext() functionality
    [ext/gettext/tests/gettext_dgettext.phpt]

  * FAIL Test if dngettext() returns the correct translations
    (optionally plural).
    [ext/gettext/tests/gettext_dngettext-plural.phpt]

  * FAIL Test ngettext() functionality
    [ext/gettext/tests/gettext_ngettext.phpt]

These are all fixed by copying the en_US.UTF-8 message data to en_US,
where musl is able to find it.

This does not make the situation any better for developers (who don't
know what libc their users will be running), but that problem is
inhereted from C and is not the fault of the gettext extension.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 18, 2024
According to POSIX, bindtextdomain() returns "the implementation-
defined default directory pathname used by the gettext family of
functions" when its second parameter is NULL (i.e. when you are
querying the directory corresponding to some text domain and that
directory has not yet been set). Its PHP counterpart is feeding
that result direclty to RETURN_STRING, but this can go wrong in
two ways:

  1. If an error occurs, even POSIX-compliant implementations
     may return NULL.

  2. At least one non-compliant implementation (musl) lacks
     a default directory and returns NULL whenever the domain
     has not yet been bound.

In either of those cases, PHP segfaults on the NULL string. In this
commit we check for the NULL, and RETURN_FALSE when it happens rather
than crashing.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 18, 2024
Musl has two quirks that are leading to failed internationalization
tests. First is that the return value of bindtextdomain(..., NULL)
will always be false, rather than an "implementation-defined default
directory," because musl does not have an implementation-defined
default directory. One test needs a special case for this.

Second is that the musl implementation of bind_textdomain_codeset()
always returns NULL. The POSIX-correctness of this is debatable, but
it is roughly equivalent to correct, because musl only support UTF-8,
so the NULL value indicating that the codeset is unchanged from the
locale's codeset (UTF-8) is accurate.

PHP's bind_textdomain_codeset() function however treats NULL as
failure, unconditionally:

  * php/doc-en#4311
  * php#17163

This unfortunately causes false to be returned consistently on musl --
even when nothing unexpected has happened -- and naturally this is
affecting several tests. For now we change two tests to accept "false"
in addition to "UTF-8" so that they may pass on musl. If PHP's
bind_textdomain_codeset() is updated to differentiate between NULL and
NULL-with-errno-set, these tests can also be updated once again to
reject the NULL-with-errno result.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 18, 2024
The gettext() family of functions under musl does not support codeset
suffixes like ".UTF-8", because the only codeset it understands is
UTF-8. (Yes, it is annoying that it doesn't support the suffix for the
codeset that it does understand; no, I am not in charge.) Thanks to
this, we have six failing tests on musl,

  * FAIL Gettext basic test with en_US locale that should be on nearly
    every system
    [ext/gettext/tests/gettext_basic-enus.phpt]

  * FAIL Test if bindtextdomain() returns string id if no directory path
    is set( if directory path is 'null')
    [ext/gettext/tests/gettext_bindtextdomain-cwd.phpt]

  * FAIL Test dcgettext() functionality
    [ext/gettext/tests/gettext_dcgettext.phpt]

  * FAIL Test dgettext() functionality
    [ext/gettext/tests/gettext_dgettext.phpt]

  * FAIL Test if dngettext() returns the correct translations
    (optionally plural).
    [ext/gettext/tests/gettext_dngettext-plural.phpt]

  * FAIL Test ngettext() functionality
    [ext/gettext/tests/gettext_ngettext.phpt]

These are all fixed by copying the en_US.UTF-8 message data to en_US,
where musl is able to find it.

This does not make the situation any better for developers (who don't
know what libc their users will be running), but that problem is
inhereted from C and is not the fault of the gettext extension.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 19, 2024
According to POSIX, bindtextdomain() returns "the implementation-
defined default directory pathname used by the gettext family of
functions" when its second parameter is NULL (i.e. when you are
querying the directory corresponding to some text domain and that
directory has not yet been set). Its PHP counterpart is feeding
that result direclty to RETURN_STRING, but this can go wrong in
two ways:

  1. If an error occurs, even POSIX-compliant implementations
     may return NULL.

  2. At least one non-compliant implementation (musl) lacks
     a default directory and returns NULL whenever the domain
     has not yet been bound.

In either of those cases, PHP segfaults on the NULL string. In this
commit we check for the NULL, and RETURN_FALSE when it happens rather
than crashing.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 19, 2024
Musl has two quirks that are leading to failed internationalization
tests. First is that the return value of bindtextdomain(..., NULL)
will always be false, rather than an "implementation-defined default
directory," because musl does not have an implementation-defined
default directory. One test needs a special case for this.

Second is that the musl implementation of bind_textdomain_codeset()
always returns NULL. The POSIX-correctness of this is debatable, but
it is roughly equivalent to correct, because musl only support UTF-8,
so the NULL value indicating that the codeset is unchanged from the
locale's codeset (UTF-8) is accurate.

PHP's bind_textdomain_codeset() function however treats NULL as
failure, unconditionally:

  * php/doc-en#4311
  * php#17163

This unfortunately causes false to be returned consistently on musl --
even when nothing unexpected has happened -- and naturally this is
affecting several tests. For now we change two tests to accept "false"
in addition to "UTF-8" so that they may pass on musl. If PHP's
bind_textdomain_codeset() is updated to differentiate between NULL and
NULL-with-errno-set, these tests can also be updated once again to
reject the NULL-with-errno result.

This partially addresses GH php#13696
orlitzky added a commit to orlitzky/php-src that referenced this issue Dec 19, 2024
The gettext() family of functions under musl does not support codeset
suffixes like ".UTF-8", because the only codeset it understands is
UTF-8. (Yes, it is annoying that it doesn't support the suffix for the
codeset that it does understand; no, I am not in charge.) Thanks to
this, we have six failing tests on musl,

  * FAIL Gettext basic test with en_US locale that should be on nearly
    every system
    [ext/gettext/tests/gettext_basic-enus.phpt]

  * FAIL Test if bindtextdomain() returns string id if no directory path
    is set( if directory path is 'null')
    [ext/gettext/tests/gettext_bindtextdomain-cwd.phpt]

  * FAIL Test dcgettext() functionality
    [ext/gettext/tests/gettext_dcgettext.phpt]

  * FAIL Test dgettext() functionality
    [ext/gettext/tests/gettext_dgettext.phpt]

  * FAIL Test if dngettext() returns the correct translations
    (optionally plural).
    [ext/gettext/tests/gettext_dngettext-plural.phpt]

  * FAIL Test ngettext() functionality
    [ext/gettext/tests/gettext_ngettext.phpt]

These are all fixed by symlinking the en_US.UTF-8 message data to en_US,
where musl is able to find it.

This does not make the situation any better for developers (who don't
know what libc their users will be running), but that problem is
inhereted from C and is not the fault of the gettext extension.

This partially addresses GH php#13696
arnaud-lb pushed a commit that referenced this issue Dec 19, 2024
According to POSIX, bindtextdomain() returns "the implementation-
defined default directory pathname used by the gettext family of
functions" when its second parameter is NULL (i.e. when you are
querying the directory corresponding to some text domain and that
directory has not yet been set). Its PHP counterpart is feeding
that result direclty to RETURN_STRING, but this can go wrong in
two ways:

  1. If an error occurs, even POSIX-compliant implementations
     may return NULL.

  2. At least one non-compliant implementation (musl) lacks
     a default directory and returns NULL whenever the domain
     has not yet been bound.

In either of those cases, PHP segfaults on the NULL string. In this
commit we check for the NULL, and RETURN_FALSE when it happens rather
than crashing.

This partially addresses GH #13696
arnaud-lb pushed a commit that referenced this issue Dec 19, 2024
Musl has two quirks that are leading to failed internationalization
tests. First is that the return value of bindtextdomain(..., NULL)
will always be false, rather than an "implementation-defined default
directory," because musl does not have an implementation-defined
default directory. One test needs a special case for this.

Second is that the musl implementation of bind_textdomain_codeset()
always returns NULL. The POSIX-correctness of this is debatable, but
it is roughly equivalent to correct, because musl only support UTF-8,
so the NULL value indicating that the codeset is unchanged from the
locale's codeset (UTF-8) is accurate.

PHP's bind_textdomain_codeset() function however treats NULL as
failure, unconditionally:

  * php/doc-en#4311
  * #17163

This unfortunately causes false to be returned consistently on musl --
even when nothing unexpected has happened -- and naturally this is
affecting several tests. For now we change two tests to accept "false"
in addition to "UTF-8" so that they may pass on musl. If PHP's
bind_textdomain_codeset() is updated to differentiate between NULL and
NULL-with-errno-set, these tests can also be updated once again to
reject the NULL-with-errno result.

This partially addresses GH #13696
arnaud-lb pushed a commit that referenced this issue Dec 19, 2024
The gettext() family of functions under musl does not support codeset
suffixes like ".UTF-8", because the only codeset it understands is
UTF-8. (Yes, it is annoying that it doesn't support the suffix for the
codeset that it does understand; no, I am not in charge.) Thanks to
this, we have six failing tests on musl,

  * FAIL Gettext basic test with en_US locale that should be on nearly
    every system
    [ext/gettext/tests/gettext_basic-enus.phpt]

  * FAIL Test if bindtextdomain() returns string id if no directory path
    is set( if directory path is 'null')
    [ext/gettext/tests/gettext_bindtextdomain-cwd.phpt]

  * FAIL Test dcgettext() functionality
    [ext/gettext/tests/gettext_dcgettext.phpt]

  * FAIL Test dgettext() functionality
    [ext/gettext/tests/gettext_dgettext.phpt]

  * FAIL Test if dngettext() returns the correct translations
    (optionally plural).
    [ext/gettext/tests/gettext_dngettext-plural.phpt]

  * FAIL Test ngettext() functionality
    [ext/gettext/tests/gettext_ngettext.phpt]

These are all fixed by symlinking the en_US.UTF-8 message data to en_US,
where musl is able to find it.

This does not make the situation any better for developers (who don't
know what libc their users will be running), but that problem is
inhereted from C and is not the fault of the gettext extension.

This partially addresses GH #13696
charmitro pushed a commit to wasix-org/php that referenced this issue Mar 13, 2025
According to POSIX, bindtextdomain() returns "the implementation-
defined default directory pathname used by the gettext family of
functions" when its second parameter is NULL (i.e. when you are
querying the directory corresponding to some text domain and that
directory has not yet been set). Its PHP counterpart is feeding
that result direclty to RETURN_STRING, but this can go wrong in
two ways:

  1. If an error occurs, even POSIX-compliant implementations
     may return NULL.

  2. At least one non-compliant implementation (musl) lacks
     a default directory and returns NULL whenever the domain
     has not yet been bound.

In either of those cases, PHP segfaults on the NULL string. In this
commit we check for the NULL, and RETURN_FALSE when it happens rather
than crashing.

This partially addresses GH php#13696
charmitro pushed a commit to wasix-org/php that referenced this issue Mar 13, 2025
Musl has two quirks that are leading to failed internationalization
tests. First is that the return value of bindtextdomain(..., NULL)
will always be false, rather than an "implementation-defined default
directory," because musl does not have an implementation-defined
default directory. One test needs a special case for this.

Second is that the musl implementation of bind_textdomain_codeset()
always returns NULL. The POSIX-correctness of this is debatable, but
it is roughly equivalent to correct, because musl only support UTF-8,
so the NULL value indicating that the codeset is unchanged from the
locale's codeset (UTF-8) is accurate.

PHP's bind_textdomain_codeset() function however treats NULL as
failure, unconditionally:

  * php/doc-en#4311
  * php#17163

This unfortunately causes false to be returned consistently on musl --
even when nothing unexpected has happened -- and naturally this is
affecting several tests. For now we change two tests to accept "false"
in addition to "UTF-8" so that they may pass on musl. If PHP's
bind_textdomain_codeset() is updated to differentiate between NULL and
NULL-with-errno-set, these tests can also be updated once again to
reject the NULL-with-errno result.

This partially addresses GH php#13696
charmitro pushed a commit to wasix-org/php that referenced this issue Mar 13, 2025
The gettext() family of functions under musl does not support codeset
suffixes like ".UTF-8", because the only codeset it understands is
UTF-8. (Yes, it is annoying that it doesn't support the suffix for the
codeset that it does understand; no, I am not in charge.) Thanks to
this, we have six failing tests on musl,

  * FAIL Gettext basic test with en_US locale that should be on nearly
    every system
    [ext/gettext/tests/gettext_basic-enus.phpt]

  * FAIL Test if bindtextdomain() returns string id if no directory path
    is set( if directory path is 'null')
    [ext/gettext/tests/gettext_bindtextdomain-cwd.phpt]

  * FAIL Test dcgettext() functionality
    [ext/gettext/tests/gettext_dcgettext.phpt]

  * FAIL Test dgettext() functionality
    [ext/gettext/tests/gettext_dgettext.phpt]

  * FAIL Test if dngettext() returns the correct translations
    (optionally plural).
    [ext/gettext/tests/gettext_dngettext-plural.phpt]

  * FAIL Test ngettext() functionality
    [ext/gettext/tests/gettext_ngettext.phpt]

These are all fixed by symlinking the en_US.UTF-8 message data to en_US,
where musl is able to find it.

This does not make the situation any better for developers (who don't
know what libc their users will be running), but that problem is
inhereted from C and is not the fault of the gettext extension.

This partially addresses GH php#13696
@andypost
Copy link
Contributor

Got reproducible in x86_64 CI failure in Alpine edge for 8.3.21RC1

] 
TEST 17195/17393 [sapi/cli/tests/php_cli_server_pdeathsig.phpt]
========DIFF========
001- Done
001+ Fatal error: Uncaught Exception: Workers were not properly terminated. Before: 43119, 43120, after: 43119, 43120 in /builds/alpine/aports/community/php83/src/php-8.3.21RC1/sapi/cli/tests/php_cli_server_pdeathsig.php:34
002+ Stack trace:
003+ #0 {main}
004+   thrown in /builds/alpine/aports/community/php83/src/php-8.3.21RC1/sapi/cli/tests/php_cli_server_pdeathsig.php on line 34
========DONE========
FAIL Killing server should terminate all worker processes [sapi/cli/tests/php_cli_server_pdeathsig.phpt]

@andypost
Copy link
Contributor

andypost commented May 1, 2025

and now it pass

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

No branches or pull requests

3 participants