Skip to content

Fix stdlib_stream bootstrap AOT stream JIT parity (#1152)#1159

Merged
PurHur merged 1 commit into
masterfrom
fix/issue-1152-stdlib-stream-aot
May 23, 2026
Merged

Fix stdlib_stream bootstrap AOT stream JIT parity (#1152)#1159
PurHur merged 1 commit into
masterfrom
fix/issue-1152-stdlib-stream-aot

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 23, 2026

Summary

  • Fix intermittent AOT crash in test/bootstrap-aot/stdlib_stream.php by assigning fopen stream handles with explicit writeLong/writeBool instead of copyFromPointer.
  • Clone fread results via __string__separate before boxing to avoid invalid frees.
  • Point the bootstrap fixture at a repo-local path (matching stdlib_filesystem.php) instead of unimplemented sys_get_temp_dir/getmypid helpers.

Test plan

  • php bin/compile.php -o build/bootstrap-aot/stdlib_stream test/bootstrap-aot/stdlib_stream.php
  • 20 consecutive AOT runs match Zend output (1)
  • bootstrap-aot-link parity for stdlib_stream.php

Made with Cursor

@PurHur PurHur force-pushed the fix/issue-1152-stdlib-stream-aot branch 2 times, most recently from c96b61f to 0b99848 Compare May 23, 2026 19:13
Store stream handles with explicit writeLong/writeBool instead of copyFromPointer
and separate fread strings before boxing to avoid intermittent AOT crashes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur force-pushed the fix/issue-1152-stdlib-stream-aot branch from 0b99848 to 830dda6 Compare May 23, 2026 19:15
@PurHur PurHur merged commit f3e0b8a into master May 23, 2026
1 check passed
@PurHur PurHur deleted the fix/issue-1152-stdlib-stream-aot branch May 23, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant