realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.6k stars 558 forks source link

"free(): invalid pointer" when running on Ubuntu x86_64 and Node.js >= v20.12.0 #6589

Open kraenhansen opened 3 weeks ago

kraenhansen commented 3 weeks ago

[!NOTE] If you're seeing "free(): invalid pointer" when running on Ubuntu x86_64, a valid workaround is downgrading Node.js to v20.11.1

Description

See for more information https://github.com/realm/realm-core/issues/7604.

The coverage tests started crashing around March 26th, by the release of Node.js v20.12.0.

Here's an example of a failing run: https://github.com/realm/realm-js/actions/runs/8552406490/job/23433443919?pr=6587

There seem to be two issues:

I've reproduced the crash on these Realm JS commits:

Stacktrace & log output

free(): invalid pointer
sync-by-unito[bot] commented 3 weeks ago

➤ PM Bot commented:

Jira ticket: RJS-2790

kraenhansen commented 3 weeks ago

This might have been the cause: https://github.com/realm/realm-core/issues/7434 🤞

kraenhansen commented 1 week ago

I've created https://github.com/realm/realm-core/issues/7604 with more information on the root cause of this crash.

kraenhansen commented 1 week ago

Regarding the uncorrect exit code when the subprocess spawed by nyc crashes, I've found these issues and PR that I believe is related: