Stack overflow in s-structured-log-0.2.0, Rust 1.16 #38973

Open
brson opened this Issue Jan 10, 2017 · 9 comments

Projects

None yet

5 participants

@brson
Contributor
brson commented Jan 10, 2017

http://github.com/siphilia/s-structured-log-rs a54b1a7d69261a952fcf8e597d751c5973986ceb

Not on stable/beta.

brian@ip-10-145-43-250:~⟫ rustc +nightly -Vv
rustc 1.16.0-nightly (47c8d9fdc 2017-01-08)
binary: rustc
commit-hash: 47c8d9fdcf2e6502cf4ca7d7f059fdc1a2810afa
commit-date: 2017-01-08
host: x86_64-unknown-linux-gnu
release: 1.16.0-nightly
LLVM version: 3.9
brian@ip-10-145-43-250:~/dev/s-structured-log-rs⟫ cargo +nightly test
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling itoa v0.1.1
   Compiling num-traits v0.1.36
   Compiling log v0.3.6
   Compiling serde v0.8.21
   Compiling dtoa v0.2.2
   Compiling serde_json v0.8.4
   Compiling s-structured-log v0.2.0 (file:///mnt2/dev/s-structured-log-rs)
    Finished debug [unoptimized + debuginfo] target(s) in 15.91 secs
     Running target/debug/deps/s_structured_log-e4fd371411732634

running 5 tests
test tests::json_format ... ok
test tests::no_escape_chars ... ok
test tests::only_escape_chars ... ok
test tests::random_escape_chars ... ok
test tests::simple_logger ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests s-structured-log

running 6 tests

thread '_1' has overflowed its stack
fatal runtime error: stack overflow
error: test failed

cc @siphilia

@brson
Contributor
brson commented Jan 12, 2017

Need to try to extract a test case from the docs.

@brson
Contributor
brson commented Jan 12, 2017 edited

Stack trace. Stack overflow is in rustc.

@brson brson added the I-nominated label Jan 12, 2017
@alexcrichton
Member

The overflow happens on this example and doesn't reproduce in rustc alone, may have to do something with how rustdoc calls the compiler.

@nikomatsakis
Contributor

Seems like rustdoc doesn't use the monitor that allocates a big ol' stack. Some stack size fluctuation does occur from time to time, could be that.

@nikomatsakis
Contributor

triage: P-high

@nikomatsakis
Contributor

Hmm, I can't reproduce the problem, but I can produce a PR to at least get rustdoc to run compiler the same way it runs everything else when doing tests.

@nikomatsakis
Contributor

Hmm, so, I had thought to just run this code in driver::monitor, but that actually swallows panics and invokes exit(), and this code is running in the test harness, so that's not a particularly good idea.

@brson
Contributor
brson commented Jan 17, 2017

I am testing @nikomatsakis's patch. FWIW I cannot repro on the 01-13 nightly, only the one listed in the op.

@brson
Contributor
brson commented Jan 18, 2017

With @nikomatsakis's patch on top of the commit in the op the bug does not reproduce.

@alexcrichton alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 19, 2017
@alexcrichton alexcrichton Rollup merge of #39142 - nikomatsakis:issue-38973, r=brson
run rustdoc tests in the same sort of thread rustc runs in

Not sure yet if this is the problem in #38973 but seems like an improvement regardless.

r? @brson
d72c4a6
@alexcrichton alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 20, 2017
@alexcrichton alexcrichton Rollup merge of #39142 - nikomatsakis:issue-38973, r=brson
run rustdoc tests in the same sort of thread rustc runs in

Not sure yet if this is the problem in #38973 but seems like an improvement regardless.

r? @brson
e1129b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment