ext/sockets: run the AF_PACKET error test in isolation - #22773
Merged
Conversation
The no-data case binds an ETH_P_ALL packet socket to lo and asserts that a non-blocking recvfrom() finds nothing, which only holds while no other test puts a frame on loopback. run-tests spawns workers in parallel and the job runs as root, so any concurrent test that talks to localhost makes the socket capture a frame and recvfrom() returns data instead of failing. Observed on LINUX_X32_DEBUG_ZTS: bool(false) where bool(true) was expected. Closes phpGH-22773
iliaal
force-pushed
the
fix/afpacket-test-parallel-unsafe
branch
from
July 16, 2026 18:38
3f10641 to
59b9211
Compare
devnexen
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The no-data case does this:
An ETH_P_ALL socket bound to lo captures every loopback frame, so that assertion holds only while no other test talks to localhost. run-tests spawns workers in parallel and the job runs as root (the SKIPIF requires it), so a concurrent test doing HTTP on 127.0.0.1, or a mysqli connect over TCP, makes recvfrom() return a frame and the assert flips. Seen on LINUX_X32_DEBUG_ZTS as
bool(false)wherebool(true)was expected, with the other three cases in the file passing.--CONFLICTS-- allis what ext/tidy/tests/parsing_file_too_large.phpt already uses for a test that cannot share the machine.One caveat worth stating: the race is rare, so a green CI run here does not prove the fix, it just fails to disprove it. The argument is that the assertion is unsound under any concurrency and this removes the concurrency.