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

SIGSEGV on long line #1735

Closed
s4n-cz opened this issue Jan 29, 2022 · 1 comment · Fixed by #1809 or #1833
Closed

SIGSEGV on long line #1735

s4n-cz opened this issue Jan 29, 2022 · 1 comment · Fixed by #1809 or #1833
Labels
A-Search Area: Search C-panic Category: A bug that causes a panic or crash

Comments

@s4n-cz
Copy link

s4n-cz commented Jan 29, 2022

Hello,

I have noticed that providing long line of text (around 21 000 characters) crashes the build.

Steps to reproduce

  1. Paste a long line of text into the source Markdown file (generate e.g. with Python 'a' * 21000)
  2. run mdbook build
    mdbook build
    2022-01-29 16:20:21 [INFO] (mdbook::book): Book building has started
    2022-01-29 16:20:21 [INFO] (mdbook::book): Running the html backend
    
    thread 'main' has overflowed its stack
    fatal runtime error: stack overflow
    zsh: IOT instruction (core dumped)  mdbook build
    

Backtrace from rust-gdb

backtrace.txt

@mattheww
Copy link
Contributor

Note you need a very long single word to cause this problem; just having a long line won't trigger it.

The crash is caused by the search indexing code trying to create a very deeply nested JSON file (it has a nested object for each letter in the word).

I've filed mattico/elasticlunr-rs#44 about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Search Area: Search C-panic Category: A bug that causes a panic or crash
Projects
None yet
3 participants