realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

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

Open kraenhansen opened this issue 1 year ago • 4 comments

[!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:

  • The crash itself, which originates from Core (see #7604)
  • The npm run ci:coverage process exits cleanly, which is unexpected from a crash.

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

  • 2796745c674732bdfc45d460924c6dfefc84c720 (Realm Core 14.5.1)
  • e15db6016513ac37996286abde4c44a14e98268c (Realm Core 13.26.0)
  • 89687764c65f17b0a43b6a20d80a07be8063b0ce (Realm Core 13.25.1)
  • 42651be546db8ea6830e9da30a11673c0bfce8c8 (Realm Core 13.25.0)

Stacktrace & log output

free(): invalid pointer

kraenhansen avatar Apr 04 '24 10:04 kraenhansen

➤ PM Bot commented:

Jira ticket: RJS-2790

sync-by-unito[bot] avatar Apr 04 '24 10:04 sync-by-unito[bot]

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

kraenhansen avatar Apr 06 '24 05:04 kraenhansen

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

kraenhansen avatar Apr 18 '24 11:04 kraenhansen

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

  • https://github.com/istanbuljs/nyc/issues/798
  • https://github.com/istanbuljs/nyc/issues/1535
  • https://github.com/istanbuljs/nyc/pull/1546

kraenhansen avatar Apr 18 '24 12:04 kraenhansen