Skip to content

AOT: SQLite3::open returns null — leftover of version (#35991) (ext/sqlite3/sqlite3.c) #36001

Description

@PurHur

Category

bug · AOT · leftover of #35991 / #20565 · php-src-strict

Problem

Thin AOT still has no SQLite3::open proxy after the version fold (#35991). Calls lower to an ExternalMethod null stub instead of php-src zim_sqlite3_open behaviour.

Host Zend in the CI image has no ext/sqlite3; compare VM vs AOT under PHP_COMPILER_PROFILE=8.4 (same gate as #35991).

Repro (PHP_COMPILER_PROFILE=8.4) VM (2026-08-30 @ 78852fc5dd) AOT
$db = new SQLite3(':memory:'); try { $db->open(':memory:'); } catch (Throwable $e) { echo get_class($e), ':', $e->getMessage(); } Exception:Already initialised DB Object silent NULL (no throw)
$db->close(); $db->open(':memory:'); then querySingle of folded SQL reopen succeeds (void → null dump); DB usable NULL stub; no reopen

php-src reference

PHP implementation target

  • Register open on lib/JIT/Call/Sqlite3Method + Context sqlite3 proxies (peer of #35991 version)
  • ext/sqlite3/JitSqlite3::open — if PROP_ID != 0 throw Exception; else re-init props like __construct after close (PROP_ID=0)
  • No new runtime/*.c

Repro

./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
php bin/vm.php test/repro/sqlite3_open_aot.php
php bin/compile.php -o /tmp/o.bin test/repro/sqlite3_open_aot.php && /tmp/o.bin'

Done when

  • VM and AOT match on already-open throw + close/reopen
  • ./script/aot-smoke.sh stays 8/8
  • No new thin C ABI

Parent

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-3:aotPhase 3 – AOT deployment

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions