Skip to content

Claude/upgrade ape c library mm z gd - #729

Merged
staalmannen merged 2 commits into
mainfrom
claude/upgrade-ape-c-library-mmZGd
Nov 5, 2026
Merged

staalmannen merged 2 commits into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

No description provided.

`mk install' linked php and then answered

	/rc/lib/rcmain:24 *eval*:1: null list in concatenation
	mk: cp 6.out $BIN/php : exit status=rc 57534: error

`mkone's rule is `cp $prereq $BIN/$TARG', `$BIN/php' is a
concatenation in rc, and concatenating an empty list with a string is
an error rather than an empty result -- so the message names rcmain
and not the mkfile, which is the "mk names the wrong line" shape
again.

`sys/src/ape/config' supplies APEBIN and not BIN, so every other APE
command mkfile assigns BIN itself.  This one includes
`</$objtype/mkfile' directly and sets CC and LD by hand, so the one
variable only mkone reads was the one nobody noticed was missing --
and nothing could notice until the link succeeded.

It goes before the `<mkone' include, since `install:V: $BIN/$TARG' is
a prerequisite and so is expanded at parse time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
`6.out --version' printed

	PHP 8.5.12 (cli) (built: Nov  5 2026 16:19:35) (NTS)
	Zend Engine v4.5.12

and then died with `fault read addr=0x4 pc=0x7ef0f7'.

`accel_globals->key' is allocated by `accel_globals_ctor', whose only
caller is `accel_startup' -- the zend_extension's startup -- and
`zend_extensions.c:194' has the whole body of `zend_extension_startup'
inside `#if ZEND_EXTENSIONS_SUPPORT', which `zend_portability.h:191'
sets to 1 for dlopen and for Windows and 0 otherwise.  Plan 9 has no
dlopen, so no zend_extension's startup runs here at all.  opcache's
MSHUTDOWN is an ordinary module shutdown, gated by nothing, and calls
`accel_shutdown', which takes its `!ZCG(enabled) || !accel_startup_ok'
arm and destroys the globals regardless -- `zend_string_free(NULL)',
and `GC_FLAGS' reads `gc.u.type_info' at offset 4, which is the
address the kernel named.

Guarded, which is what the next statement in the same function
already does for `preloaded_internal_run_time_cache' and what
`zend_accel_blacklist_shutdown' opens with four lines earlier in the
same call.  Upstream's, and worth reporting with the zend_atomic.h
typo.  The rest of that path was read for the same shape:
`zend_jit_shutdown' is behind HAVE_JIT, the blacklist has its own
guard, and unregistering ini entries that were never registered walks
an empty set.

The diagnosis needed one command and no rebuild.  `php_cli.c:1318's
`-h' arm returns while `module_started' and `sapi_started' are still
0 -- they are set at :1337 and :1359 -- so it runs exit() and neither
shutdown.  `./6.out -h' exits clean, which cleared libap's exit path,
the stdio teardown and php_ini_builder_deinit at once and left two
functions where nine calls had been candidates.  `acid 6.out' and
`src(0x7ef0f7)' then named zend_string.h:401 outright.

Prediction: `php -v' exits 0 now.  What would refute it is a fault at
a different line, which would be the next member of the same family,
since every zend_extension on this platform is constructed by nobody.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit f6a2ae8 into main Nov 5, 2026
1 check passed
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.

2 participants