Repository navigation
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #193 +/- ##
=======================================
Coverage 68.65% 68.65%
=======================================
Files 7 7
Lines 1356 1356
Branches 248 248
=======================================
Hits 931 931
Misses 310 310
Partials 115 115 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 4, 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.
zend_objectmust be the last member of a custom object struct: its trailingproperties_table[1]is sized byzend_object_properties_size(), which is-sizeof(zval)for a class without declared properties, sophp_msgpack_base_new()allocates less thansizeof(php_msgpack_base_t).force_f32(added in #178) was placed after the embeddedzend_object, so it lives outside the allocation. On 32-bit ARM (armhf/armv7), wherezvalis 8-byte aligned, the store inMessagePack::__construct()lands in the next ZendMM slot of the same bin and clobbers whatever lives there. x86/x86_64 layouts happen to hide it, which is why CI never saw it.How it shows up
Alpine's armhf/armv7 builders started failing
make testwith randomTermsig=11after PHP 8.4.27 / 8.5.12 changed allocation patterns enough to expose it. Affected tests are therand()-driven unpacker ones: 072, 082, 086, 088, 089 — 2–5 of them crash per run:https://build.alpinelinux.org/buildlogs/build-3-25-armhf/community/php85-pecl-msgpack/php85-pecl-msgpack-3.0.1-r0.log
Debugging under qemu-arm + gdb, a packed array (
array(new Obj(1,2,3), new Obj(4,5,6))in 072,mt_srand(5)) hasu.v.flags == 0x14(PACKED | STATIC_KEYS) on entry toMessagePack::__constructand0on entry topack()— the 1-bytebase->force_f32 = 0store hit it.msgpack_serialize_array()then walks the packed storage asBuckets and dereferences a boguszend_string.Verification
On armhf (Alpine edge, PHP 8.5.12): unpatched, every full
make testrun has 2–5 segfaults; patched, 15/15 full runs are clean (134 passed, 0 failed). Also passes under Alpine'sabuildcheck.🤖 Generated with Claude Code