Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build with error Command failed with signal "SIGSEGV". #47

Closed
genshen opened this issue Jan 11, 2021 · 5 comments
Closed

build with error Command failed with signal "SIGSEGV". #47

genshen opened this issue Jan 11, 2021 · 5 comments

Comments

@genshen
Copy link

genshen commented Jan 11, 2021

When I use docusaurus-search-local to build my document static site, it raise an error without any more information even if I set DEBUG=search-local:*.

Env

  • OS: Linux docker
  • Arch: amd64
  • docusaurus-search-local: 0.14.2
  • nodejieba: 2.5.1
  • node: 4.15.3

Steps

  1. clone my document project https://github.com/hpcde/cluster-docs and checkout to commit "e74db1218a0607a28d07f998b20355f00bc99b79" if possible.
  2. run docker run -it --rm -v ${PWD}:/root/p --entrypoint ash node:14.15.3-alpine3.12
  3. In docker container, run:
cd /root/p
yarn install
USE_LOCAL_SEARCH=ON yarn build

than there is an error like:

✔ Client
  Compiled successfully in 28.20s

✔ Server
  Compiled successfully in 33.53s

error Command failed with signal "SIGSEGV".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

But, if I disable docusaurus-search-local plugin (just run yarn build), everything works fine.

@weareoutman
Copy link
Member

The SIGSEGV error is probably caused by nodejieba which is a nodejs wrapper of c++ program.

Before I got time to investigate this problem, could you try to set language to ['en'] (without 'zh'), and see whether the problem still exists? Let me know if it works fine or not.

@genshen
Copy link
Author

genshen commented Jan 12, 2021

I changed language to ['en'], now it works fine (But I still have the demand of searching Chinese).
It seems that the problem is caused by nodejieba.

@genshen
Copy link
Author

genshen commented Jan 13, 2021

Update:
Environment: the same as above, docker image node:14.15.3-alpine3.12

Initialize an empty docusaurus document project using:

npx @docusaurus/init@latest init my-website classic # docusaurus 2.0.0-alpha70
cd my-website

then follow docusaurus-search-local document to add search support:

yarn add @easyops-cn/docusaurus-search-local # v0.14.4
yarn add nodejieba  #2.5.1
vi docusaurus.config.js # set search plugin and add Chinese language support by setting `language: ["en", "zh"],`

Last, build it:

yarn build

It still exit with SIGSEGV error (The above steps work fine on my Mac).

@weareoutman
Copy link
Member

This seems to be a known issue.

I have reproduced the problem. And I also tried to downgrade nodejieba to v2.4.2, It builds successfully. So you can pin nodejieba in your package.json to 2.4.2 (without ^), until nodejieba (or CppJieba) fixed the issue.

genshen added a commit to hpcde/cluster-docs that referenced this issue Jan 13, 2021
Fix nodejieba build error: "SIGSEGV" building error and "no module nodejieba.node" building error

See merge request HPCDoc/clusters!33

see also easyops-cn/docusaurus-search-local#47 for "SIGSEGV" building error
@genshen
Copy link
Author

genshen commented Jan 13, 2021

Fixed by downgrading nodejieba to v2.4.2.
Thanks for your nice and patient reply👍!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants