rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
18.11k stars 1.63k forks source link

Segmentation Fault: 11 seen when running mdbook on Rust RFCs #731

Closed shortsightedsid closed 6 years ago

shortsightedsid commented 6 years ago

I'm trying to build a book for rust RFCs. Running mdbook results in segmentation fault. Ran mdbook with valgrind, and here's the output.

2018-07-23 12:57:35 [INFO] (mdbook::book): Book building has started
==13916==
==13916== Process terminating with default action of signal 11 (SIGSEGV)
==13916==  General Protection Fault
==13916==    at 0x1003F8E4B: thread_local::thread_id::get (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x10039B223: regex::re_unicode::Regex::captures_iter (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x10017FC1D: mdbook::preprocess::links::replace_all (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x100150404: _ZN6mdbook4book4book12for_each_mut17hc802152b56c99200E.llvm.12738868326457675377 (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x10017FAED: <mdbook::preprocess::links::LinkPreprocessor as mdbook::preprocess::Preprocessor>::run (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x1001530FD: mdbook::book::MDBook::build (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x1000366CD: mdbook::build::execute (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x100045735: mdbook::main (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x100067185: std::rt::lang_start::{{closure}} (in /Users/sheroor/.cargo/bin/mdbook)
==13916==    by 0x10047BE77: _ZN3std9panicking3try7do_call17hc7b9e6190a1d9f3eE.llvm.7628423903506348692 (rt.rs:59)
==13916==    by 0x10049517E: __rust_maybe_catch_panic (lib.rs:102)
==13916==    by 0x100479D71: std::rt::lang_start_internal (panicking.rs:285)
==13916==
==13916== HEAP SUMMARY:
==13916==     in use at exit: 414,811 bytes in 749 blocks
==13916==   total heap usage: 1,336 allocs, 587 frees, 717,961 bytes allocated
==13916==
==13916== LEAK SUMMARY:
==13916==    definitely lost: 16,936 bytes in 79 blocks
==13916==    indirectly lost: 3,783 bytes in 92 blocks
==13916==      possibly lost: 1,951 bytes in 43 blocks
==13916==    still reachable: 28,733 bytes in 276 blocks
==13916==         suppressed: 363,408 bytes in 259 blocks
==13916== Rerun with --leak-check=full to see details of leaked memory
==13916==

The versions that I'm running are

macbook:rfcs sheroor$ mdbook -V
mdbook v0.1.8

macbook:rfcs sheroor$ rustc -V
rustc 1.27.2 (58cc626de 2018-07-18)

I'm running OSX El Capitan.

mattico commented 6 years ago

I believe this issue is caused by https://github.com/rust-lang/rust/issues/51758. Please try building mdbook with the latest nightly to see if it fixes the issue.

shortsightedsid commented 6 years ago

Yup. Does the trick. Thanks!