mirrorz-org / mirrorz-help

https://help.mirrorz.org
MIT License
57 stars 43 forks source link

bug: `npm run og:build` segfaults in CentOS 7 #114

Closed taoky closed 8 months ago

taoky commented 1 year ago

先决条件 (Prerequisites)

发生了什么(What happened)

# npm run og:build

> help.mirrorz.org@0.0.0 og:build
> node -r @swc-node/register ./scripts/generate-opengraph.ts

Loaded env from /root/mirrorz-help/.env.local
info  - Generating OpenGraph images for "help.mirrors.cernet.edu.cn"...
info  - [OG] Cache miss for open graph image "help.mirrors.cernet.edu.cn/default" from ./node_modules/.cache/
Segmentation fault (core dumped)

期望的现象(What you expected to happen)

> npm run og:build                                                                                                                                                           

> help.mirrorz.org@0.0.0 og:build
> node -r @swc-node/register ./scripts/generate-opengraph.ts

Loaded env from /home/taoky/Projects/mirrorz-help/.env.local
info  - Generating OpenGraph images for "mirrors.help"...
info  - [OG] Reading open graph image "mirrors.help/default" from ./node_modules/.cache/
> echo $status
0

如何重现此问题(How to reproduce it)

$ sudo docker run -it --rm centos:7 bash
# ulimit -n 1024
# yum install epel-release
# yum install npm git vim
# git clone https://github.com/mirrorz-org/mirrorz-help.git
# cd mirrorz-help/
# npm install
# vim .env.local
# npm run og:build

操作系统(OS Version)

CentOS 7 (Container & VM)

浏览器(如果适用)(Browser version, if applicable)

N/A

其他环境(Other environments)

Node.js v16.18.1 from EPEL, Glibc 2.17.

其他需要说明的事项(Anything else we need to know)

(This issue is blocking help.mirrors.cernet.edu.cn from updating its contents.)

taoky commented 1 year ago

The crash seems to be triggered by https://github.com/mirrorz-org/mirrorz-help/tree/master/src/compiled/satori.

taoky commented 1 year ago

npm run build also segfaults in CentOS 7, though I have workarounded this issue by using nix in the production server...