rubyjs / mini_racer

Minimal embedded v8
MIT License
585 stars 91 forks source link

Update to libv8-node 20.x #284

Closed lloeki closed 3 months ago

lloeki commented 1 year ago

Depends on #283: uses libv8-node-19 as a base, which should be merged first.

lloeki commented 3 months ago

Heh, just noticed *-linux-gnu has bundler electing to fetch the ruby platform gem instead of the binary ones, so spends time building libv8, which works for x86_64 and probably also for aarch64 if it did not get killed by GHA timeout.

lloeki commented 3 months ago

Echoing @Fayti1703 notes here coz I'm tired of clicking around :D

https://github.com/rubyjs/mini_racer/pull/283#issuecomment-1572735274

  • Something deep in v8 is segfaulting when trying to read a snapshot -- specifically the constructor of > v8::internal::StringTableInsertionKey. Unsure what the cause is at the moment.
    • crash in test_snapshots_can_be_warmed_up_with_no_side_effects
    • crash in test_isolates_from_snapshot_dont_get_corrupted_if_the_snapshot_gets_warmed_up_or_GCed

https://github.com/rubyjs/mini_racer/pull/283#issuecomment-1585816428

With a debug build of V8 (via a local libv8-node gem build), I get even more snapshot-related crashes due to invalid checksums. V8 says (for example):

#
# Fatal error in ../deps/v8/src/heap/read-only-spaces.cc, line 71
# Check failed: read_only_blob_checksum_ == snapshot_checksum (<unprintable> vs. 3847049538).
#

This smells like a V8 bug, since as far as I can tell MR doesn't touch the snapshot data whatsoever.

Might also be that we do (or fail to do) something and we end up corrupting memory / pointer / whatever.

Hence why rr might be of some help to see what actually touches the memory.

lloeki commented 3 months ago

Merging this as is as per the plan.