You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@perryts/mysql crashes inside perry run with 'js_box_get: invalid box pointer 0x0' #536
Any TypeScript program that imports and uses @perryts/mysql crashes immediately at the first DB query when run via perry run (and the equivalent perry compile-d binary). The same crash reproduces on @perryts/mysql's own examples/perry-aot-minimal.ts inside that project. So this looks like a Perry runtime issue with how @perryts/mysql boxes JS values, even though the driver advertises Perry support.
Identical code runs cleanly under Node + tsx — the bug is Perry-runtime-specific.
Reproducer
// repro.tsimport{Pool}from"@perryts/mysql";asyncfunctionmain(){constpool=newPool({url: "mysql://root:@127.0.0.1:3306/test"});constrows=awaitpool.query("SELECT 1 AS n");console.log(rows);awaitpool.end();}main().catch((err)=>{console.error(err);process.exit(1);});
# under tsx — works
$ npx tsx repro.ts
[ { n: 1 } ]
# under perry run — crashes
$ perry run repro.ts
[PERRY WARN] js_box_get: invalid box pointer 0x0 #0
TypeError: (number).next is not a function
perry compile repro.ts -o repro && ./repro produces the same stderr.
@perryts/mysql's own bundled example (examples/perry-aot-minimal.ts) reproduces the crash too, ruling out anything app-specific.
Impact
Production deploy of our server (which uses @perryts/mysql for MySQL access) is blocked on this — we can't ship the perry compile-d native binary. Today we run tsx server/main.ts in production-equivalent settings as a workaround. 24 e2e suites cover the server end-to-end via tsx; switching the e2e to run the Perry binary is the test we'd add the moment this lands.
Possible split
If this turns out to be a @perryts/mysql issue rather than core Perry, happy to refile on PerryTS/mysql — let me know.
Activity
fix(hir): refs PerryTS#536 — gate Pool/Client/MongoClient native-inst…
fix(runtime+stdlib+ext-net+docs): refs #536 — pop/shift return undefi…
test: refs #536 — regression test for [].pop()/[].shift() === undefin…
fix(transport): refs PerryTS/perry#536 — call net.createConnection(po…
fix(hir): user `class Big`/`Decimal`/`BigNumber` no longer shadowed (…
fix(transform): run an inlined finally once per closure, not once per…
fix(runtime): the hole-leak family — Set/Map raw reads, pop, typeof/S…
chore(pg): finish the #10677 removal — drop the pg codegen/FFI leftovers