denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.92k stars 5.22k forks source link

Bug: dyld[3532]: missing symbol called in `sqlite3` #24740

Open marvinhagemeister opened 1 month ago

marvinhagemeister commented 1 month ago

Steps to reproduce

  1. Run deno init
  2. Set vendor: true in deno.json
  3. Run deno install --allow-scripts npm:sqlite3
  4. Add main.ts with these contents:

    import sqlite3Init from "npm:sqlite3";
    
    const sqlite3 = sqlite3Init.verbose();
    const db = new sqlite3.Database(":memory:");
    
    db.serialize(() => {
    db.run("CREATE TABLE lorem (info TEXT)");
    
    const stmt = db.prepare("INSERT INTO lorem VALUES (?)");
    for (let i = 0; i < 10; i++) {
      stmt.run("Ipsum " + i);
    }
    stmt.finalize();
    
    db.each("SELECT rowid AS id, info FROM lorem", (err, row) => {
      console.log(row.id + ": " + row.info);
    });
    });
    
    db.close();
  5. Run DENO_FUTURE=1 deno run -A main.ts

Output:

$ DENO_FUTURE=1 deno run -A main.ts
dyld[3532]: missing symbol called
[1]    3532 abort      DENO_FUTURE=1 deno run -A 

Version: Deno 1.45.3 (git https://github.com/denoland/deno/commit/7776636c2efc3db07b965166a9982fc3d5ef21ce 2024-07-26)

nathanwhit commented 1 month ago

Looks like sqlite3 uses symbols defined in uv.h.

It's technically not part of the Node-API stable ABI, but a lot of addons still use it, see https://github.com/denoland/deno/issues/24158#issuecomment-2158730758

This is a tricky one

littledivy commented 3 weeks ago

sqlite3 also depends on libuv mutexes https://github.com/TryGhost/node-sqlite3/blob/1609684658a881aeff583daf3d810e499bf7bb74/src/threading.h#L4-L8