Skip to content

@perryts/mysql crashes inside perry run with 'js_box_get: invalid box pointer 0x0' #536

Description

@proggeramlug

Summary

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.ts
import { Pool } from "@perryts/mysql";

async function main() {
  const pool = new Pool({ url: "mysql://root:@127.0.0.1:3306/test" });
  const rows = await pool.query("SELECT 1 AS n");
  console.log(rows);
  await pool.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.

Environment

  • perry 0.5.503
  • @perryts/mysql 0.1.1 (current main)
  • macOS 25.4.0 (Darwin), arm64
  • MySQL 9.6 (also reproduced against MySQL 8.0)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions