Skip to content

NW.js 107 crashes when using @vscode/sqlite3 after an iframe has loaded. #8326

@msojocs

Description

@msojocs

Steps

1. Environment

nw: v0.107.0 (nwjs-sdk-v0.107.0-linux-x64.tar.gz)

os: linux (WSL2)

2. Prepare package.nw

  1. Create crashed.nw/package.json
  2. Install @vscode/sqlite3 npm install @vscode/sqlite3
  3. Create crashed.nw/index.html

package.json content:

{
  "name": "sqlite3-test",
  "version": "1.0.0",
  "description": "",
  "main": "html/index.html",
  "chromium-args": "--mixed-context",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@vscode/sqlite3": "^5.1.12-vscode"
  }
}

index.html content:

<html>
    <head></head>
    <body>
        <h1>Test Page</h1>
        <iframe src="./sub.html" style="width:600px; height:400px;" onload="sqliteTest()"></iframe>
        <script>
            const sqliteTest = () => {
                const sqlite3 = require('@vscode/sqlite3');
                try {
                    const db = new sqlite3.Database(':memory:', e => {});
                    console.warn('db:', db);
                } catch (err) {
                    console.error('sqlite init err', err, err.stack);
                }
            };
        </script>
    </body>
</html>

sub.html content:

<html>
    <body>
        <h1>Sub Page</h1>
    </body>
</html>

3. Execute

nwjs/nw crashed.nw/
[28995:28995:0214/093351.674370:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.DBus.Properties.GetAll: object_path= /org/freedesktop/UPower/devices/DisplayDevice: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files

  #  node[29049]: node::InternalCallbackScope::InternalCallbackScope(Environment *, std::variant<Local<Object>, Local<Object> *, Global<Object> *>, const async_context &, int, Local<Value>) at ../../third_party/node-nw/src/api/callback.cc:112
  #  Assertion failed: (Environment::GetCurrent(isolate)) == (env)

----- Native stack trace -----

 1: 0x77656aa4a7b6 node::Assert(node::AssertionInfo const&) [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 2: 0x77656a94327a node::InternalCallbackScope::InternalCallbackScope(node::Environment*, std::__1::variant<v8::Local<v8::Object>, v8::Local<v8::Object>*, v8::Global<v8::Object>*>, node::async_context const&, int, v8::Local<v8::Value>) [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 3: 0x77656a942e06 node::CallbackScope::CallbackScope(node::Environment*, v8::Local<v8::Object>, node::async_context) [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 4: 0x77656aa0184f  [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 5: 0x77656afdfd06  [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 6: 0x77656afe39bb  [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 7: 0x77656aff69b9  [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 8: 0x77656afe3f80 uv_run [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnode.so]
 9: 0x776577adf761  [/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so]
[0214/093352.898702:ERROR:third_party/crashpad/crashpad/util/file/file_io_posix.cc:145] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0214/093352.898792:ERROR:third_party/crashpad/crashpad/util/file/file_io_posix.cc:145] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Received signal 6
#0 0x7765785df0ae (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x83df0ad)
#1 0x7765785f16d8 (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x83f16d7)
#2 0x77656fe45330 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x4532f)
#3 0x77656fe4527e gsignal
#4 0x77656fe288ff abort
#5 0x77656aa4a7cb <unknown>
#6 0x77656a94327a <unknown>
#7 0x77656a942e06 <unknown>
#8 0x77656aa0184f <unknown>
#9 0x77656afdfd06 <unknown>
#10 0x77656afe39bb <unknown>
#11 0x77656aff69b9 <unknown>
#12 0x77656afe3f80 <unknown>
#13 0x776577adf761 (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x78df760)
#14 0x77656a9fa8c1 <unknown>
#15 0x7765785312ee (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x83312ed)
#16 0x77657859bd1a (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x839bd19)
#17 0x77657855c5fe (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x835c5fd)
#18 0x77657bdfd219 (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0xbbfd218)
#19 0x7765774385a2 (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x72385a1)
#20 0x776577439726 (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x7239725)
#21 0x776577436d8a (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x7236d89)
#22 0x776577437277 (/home/msojocs/temp/sqlite3-test/nwjs/lib/libnw.so+0x7237276)
#23 0x776572c1d510 ChromeMain
#24 0x77656fe2a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#25 0x77656fe2a28b __libc_start_main
#26 0x5de7e99d2f4a _start
  r8: 0000000000000000  r9: 0000000000000007 r10: 0000000000000008 r11: 0000000000000246
 r12: 0000000000000006 r13: 00005de803d6b2b0 r14: 0000000000000016 r15: 00007ffef7ba8f50
  di: 0000000000007179  si: 0000000000007179  bp: 00007ffef7ba8d90  bx: 0000000000007179
  dx: 0000000000000006  ax: 0000000000000000  cx: 000077656fe9eb2c  sp: 00007ffef7ba8d50
  ip: 000077656fe9eb2c efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]

Update

2026-2-15

Add nwdisable attribute to iframe, crash will not happen.

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