better-sqlite3: Crash when using prebuilt v8.5.2 with Electron 26.1.0
Error message before crash is
[20860:0821/201632.615257:ERROR:child_thread_impl.cc(235)] Invalid PlatformChannel receive right
Code is
let database: Sqlite3Database.Database;
try {
database = new Sqlite3Database(':memory:', { verbose: logger.debug, nativeBinding: SQLITE_BINARY_PATH });
} catch (error) {
logger.error(`error when loading sqlite3 for workspace ${workspaceID}, skip because of error to prevent crash: ${(error as Error).message}`);
return;
}
It was working in 8.4.0 + “electron”: “25.2.0”,
Not working with 8.5.1 + “electron”: “26.0.0”, or 8.4.0 + + “electron”: “26.0.0”,
So it is electron’s falut.
About this issue
- Original URL
- State: open
- Created 10 months ago
- Reactions: 1
- Comments: 19 (9 by maintainers)
Electron 27.0.0 seems to have resolved this issue for me.
Using @neoxpert 's repo, manually rebuilding fixes the issue:
Including
--debug
, omitting--debug
, or replacing--debug
with--release
all result in a non-crashingbetter_sqlite3.node
.So it looks like the pre-built binary doesn’t work correctly.
I opened https://github.com/prebuild/prebuild/issues/309 to have this discussion in the right place.
Harumph–rebuilding resulted in the same behavior. Until this is properly resolved, I’d run https://github.com/WiseLibs/better-sqlite3/issues/1044#issuecomment-1693735596 in your postinstall.
I’ve kicked off a rebuild for the latest version, but I suspect the same binaries will be emitted. I’ll look into it a bit more tomorrow. @JoshuaWise if you’ve got any suggestions, that’d be great.