Skip to content

0.2.3

Latest

Choose a tag to compare

@danog danog released this 20 Nov 16:46

Upgrade recommended on Windows, and for SAPIs that start PHP again in the same process (FrankenPHP) (#15).

  • Windows: PHP could crash at the very end of the process (0xC0000005). PHP unloads the extensions (FreeLibrary()) while a Tokio thread may still be running a future of try_suspend_on() that PHP stopped waiting for, on the shared runtime or on one from init_with(), which is released in the background. The code was unmapped under the thread. The module is now pinned before the first runtime thread starts, so it stays loaded until the process exits, as on Linux and macOS (which never unload a module whose threads registered thread-local destructors). Regression test: testTheProcessExitsWhileAFutureOfTrySuspendOnRuns, which crashed every Windows job before the fix.
  • PHP started again in the same process: the resource type that shuts the event loop down at the end of the request was registered once per process. Since the module outlives PHP, after a restart that ID was from the old table of types: the event loop was never shut down, and the next request reused it, with memory PHP had freed (a crash on the third start). The type is now looked up by name whenever PHP started again. Regression test: tests/embed/restart.sh (embed SAPI, new CI job).