Repository navigation
fix: compile generated extensions with GCC 14+, pass CI on Ubuntu 26.04 - #2834
nicolas-grekas wants to merge 3 commits into
Conversation
ubuntu-latest now resolves to Ubuntu 26.04, where three things break: - PHP unloads the shared extensions when it shuts down, and libenchant 2.8 can't be loaded twice in a process: GObject still knows its types, so the next use of enchant aborts. That's the second phpinfo() of the test suite, and on a server the first use of enchant after a worker restart, opcache_reset() or a config reload. ZEND_DONT_UNLOAD_MODULES is now set from the library constructor, so extensions stay loaded as they do in a static build. - GCC 14+ rejects the extensions the generator writes: memrchr() is not declared because cgo includes <stdlib.h> before php.h, and nullable int and bool arguments are passed as pointers to other types than the ones cgo declares. The generated files now define _GNU_SOURCE, like cgo.go, and point to values of the right types. The manual example of the docs gets the define too. - MemorySanitizer in clang 21 takes the index of _mm512_permutex2var_epi8() for uninitialized memory, which clang 22 fixes. The msan job builds PHP without the AVX-512 VBMI variant of base64_decode(), the one place calling it, and the key of the PHP cache follows the workflow file so that a change of the configure line rebuilds PHP.
With ZEND_DONT_UNLOAD_MODULES, net-snmp is initialized again in the same image, which it doesn't expect: it floods the log at each start of PHP and the suite segfaults on the runner. Back to PHP's default: the PHP of the CI jobs no longer loads enchant.
|
Does GitHub offer operating system runners than Ubuntu? I'd rather just run the san tests on an OS that gets proper bug fixes pulled in instead of whatever silly thing Canonical is doing. |
|
Ubuntu is what a big chunk of end users use so it makes sense to keep it, don't you think? |
|
🫣 |
|
I guess we can leave it for this backwards OS, but perhaps with a note. I'm generally not terribly happy with the changes here, they feel a bit misplaced in frankenphp. For enchant we should just wait for upstream fix (it's a bugfix so will go into 8.4+), and for running san tests I would prefer running them on new versions of software (e.g. gcc 16, clang 23). |
Ubuntu 26.04 has clang 22 in its archive, where MemorySanitizer no longer takes the index of an AVX-512 permutation for uninitialized memory: PHP is built as before. A note next to the enchant line says when to drop it.
|
PR updated: the sanitizer jobs now use clang 22, which Ubuntu 26.04 has in its archive, instead of skipping the AVX-512 code. And a note next to the enchant line says when to drop it. Waiting for the php-src fix alone would keep every PR red for weeks, and 8.2/8.3 won't get it while we test them. The rest is ours: the generator emits C that GCC 14+ refuses. |
| ini-values: opcache.jit=disable | ||
| # libenchant 2.8 can't be loaded again once PHP unloaded it, which each new start of PHP does: | ||
| # GObject still knows the types of the first load, and aborts when they come back | ||
| # GObject still knows the types of the first load, and aborts when they come back. |
There was a problem hiding this comment.
this comment isn't really important, just a todo drop when patched upstream is enough
| LDFLAGS: -fsanitize=${{ matrix.sanitizer == 'asan' && 'address' || 'memory' }} | ||
| CC: clang | ||
| CXX: clang++ | ||
| # MemorySanitizer in clang 21, the default of Ubuntu 26.04, takes the index of an AVX-512 permutation |
There was a problem hiding this comment.
also not really important to know imo
ubuntu-latestis now Ubuntu 26.04, where nine jobs fail on every PR (see the checks of #2833):<stdlib.h>beforephp.h, so they now define_GNU_SOURCEascgo.godoes, and nullableintandboolarguments point to values of the types cgo declares.phpinfo()of the process: PHP unloads shared extensions when it shuts down, and libenchant 2.8 can't be loaded twice, GObject still knows its types. The PHP of the CI jobs no longer loads enchant._mm512_permutex2var_epi8()for uninitialized memory (fixed in clang 22 by [msan] Fix 'Simplify 'maskedCheckAVXIndexShadow' #147839' llvm/llvm-project#148785). The sanitizer jobs now use clang 22, which Ubuntu 26.04 has in its archive.The enchant abort is not only a CI matter: on such a system, a server dies at the first use of enchant after a worker restart, an
opcache_reset()or a config reload. SettingZEND_DONT_UNLOAD_MODULESfrom FrankenPHP avoids it, and #2730 too, but I left that out: net-snmp doesn't expect to be initialized twice, it floods the log at each start and the suite segfaults on the runner.