Tests/coverage expansion#33
Merged
Merged
Conversation
http_static_handler_freeze() initialised the persistent extra_headers and mime_overrides HashTables with ZVAL_PTR_DTOR while filling them with persistent zend_strings. ZVAL_PTR_DTOR routes through zend_string_destroy, which asserts the string is non-persistent — SIGABRT at HttpServer teardown (heap corruption in release builds). Triggered whenever StaticHandler::setHeader()/setMimeType() runs on a handler attached via HttpServer::addStaticHandler() (the path that calls freeze). Use a custom persistent_str_zval_dtor that releases values through zend_string_release_ex(s, persistent=1). Also add 20 phpt tests expanding coverage: multipart parsing edge cases and error paths, static-handler validation/lifecycle, server config validation, response reason phrases and end-to-end HTTP methods.
HttpServer::start() now binds AF_UNIX listeners added via HttpServerConfig::addUnixListener() — previously the config accepted the path but start() had a TODO and never bound it (a unix-only config died with "No valid listeners"). Single-worker servers bind the path directly. With workers > 1 the pool parent binds each AF_UNIX socket once (AF_UNIX has no SO_REUSEPORT, so per-worker independent binds are impossible) and shares the fd with every worker; each worker adopts a dup via ZEND_ASYNC_SOCKET_LISTEN_FD. Stale socket files from a crashed run are probed and unlinked; the bound path is unlinked on teardown. Tests: 038 (single worker round-trip) and 039 (workers > 1 shared fd).
Contributor
CoverageTotal lines: 77.11% → 80.90% (+3.78 pp)
❌ Regression in touched files (> 1.0 pp drop)
Add |
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.
No description provided.