Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Fatal error during scavenge collection on Android armeabi-v7a

342 views
Skip to first unread message

Kasper Isager Dalsgarð

unread,
Feb 22, 2024, 6:07:22 AM2/22/24
to v8-users
I'm consistently observing a crash on Android armeabi-v7a during scavenge collection triggered by `String::NewFromUtf8(Isolate *, const char *)`, though I don't suspect that the exact call that triggered the scavenge collection relates to the issue. For reference, this is the failing debug check I'm hitting:

```
#
# Fatal error in ../../../v8/src/heap/scavenger.cc, line 393
# Debug check failed: copied_list.IsEmpty().
#
```

I'm having a really hard time debugging why this happens and the fact that it doesn't happen on arm64-v8a has me even more puzzled. I've read through https://groups.google.com/g/v8-users/c/sdU232XmyOw where the same debug check failed, but the was caused by a race condition whereas the code I'm running uses only a single thread.

Which APIs could cause that check to fail? I've tried removing all my uses of weak persistent handles, for example, but that doesn't make a difference. Could it my `Platform` implementation that breaks some invariants that I'm not aware of?

All of the code that interacts with V8 is available here by the way: https://github.com/holepunchto/libjs. I of course don't expect anyone to read through all of that, I'll provide excerpts and summaries of portions that might be relevant to the issue.

Any help would be much appreciated, thanks!

Kasper Isager Dalsgarð

unread,
Mar 7, 2024, 3:48:23 AM3/7/24
to v8-users
A colleague of mine briefly hit the same assertion on Android arm64-v8a, but has since been unable to reproduce it. I still haven't been able to narrow down what triggers it.

Kasper Isager Dalsgarð

unread,
Aug 15, 2024, 8:00:29 AM8/15/24
to v8-users
After several attempts at debugging this, I think I've narrowed it down to the some sort of interaction with QEMU as it consistently happens when running V8 on an emulated Android device on both 32- and 64-bit architectures.

Kasper Isager Dalsgarð

unread,
May 3, 2025, 5:46:11 AM (12 days ago) May 3
to v8-users
Another colleague is now hitting this on a Linux machine running under KVM. I'm still no closer to figuring out where things go wrong; any input would be greatly appreciated.

Kasper Isager Dalsgarð

unread,
May 4, 2025, 5:20:29 AM (11 days ago) May 4
to v8-users
I finally figured out what went wrong and it's almost embarrassing: The crash occurred specifically on single core machines as I was allocating a worker thread for each available core, but always subtracted 1 for the main thread. On single core machines this meant that no workers were allocated causing V8 to crash on the as soon as garbage collection was triggered.
Reply all
Reply to author
Forward
0 new messages