Because the node builds are configured with small-icu, we see a segfault caused by a bug in nodejs where it crashes on Intl.Segmeter when running segment().
I just added this ticket here, in case anyone is experiencing segfaults with @yao-pkg/pkg builds and are using Intl.Segmenter, until the nodejs team figures out how to fix it.
It is kind of hard to find out the reason for the segfault as node just exits without any information, so I think it is wise to have this ticket open until it is either fixed by node, or if we patch it here. During my segfault investigation, I tried updating the code to throw an exception instead of crashing, and that seemed to work as a workaround for the segfault, although the segmenter probably didn't work. But we ended up using another solution without Intl.Segmenter instead of course. But if we want users of pkg to get an exception instead of a crash we could consider adding this workaround to the patches if nodejs upstream doesn't fix it the right way soon.
If you compile node with the --debug configure option, it actually halts node with a assertion error instead of segfaulting (don't try this at home, pkg does not really support patching --debug builds)
nodejs/node#51752
Because the node builds are configured with small-icu, we see a segfault caused by a bug in nodejs where it crashes on Intl.Segmeter when running segment().
I just added this ticket here, in case anyone is experiencing segfaults with @yao-pkg/pkg builds and are using Intl.Segmenter, until the nodejs team figures out how to fix it.
It is kind of hard to find out the reason for the segfault as node just exits without any information, so I think it is wise to have this ticket open until it is either fixed by node, or if we patch it here. During my segfault investigation, I tried updating the code to throw an exception instead of crashing, and that seemed to work as a workaround for the segfault, although the segmenter probably didn't work. But we ended up using another solution without Intl.Segmenter instead of course. But if we want users of pkg to get an exception instead of a crash we could consider adding this workaround to the patches if nodejs upstream doesn't fix it the right way soon.
If you compile node with the --debug configure option, it actually halts node with a assertion error instead of segfaulting (don't try this at home, pkg does not really support patching --debug builds)
nodejs/node#51752