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

graphql-client-302-repro segfaults non-deterministically #134028

Closed
adetaylor opened this issue Dec 8, 2024 · 5 comments
Closed

graphql-client-302-repro segfaults non-deterministically #134028

adetaylor opened this issue Dec 8, 2024 · 5 comments
Labels
C-external-bug Category: issue that is caused by bugs in software beyond our control

Comments

@adetaylor
Copy link
Contributor

adetaylor commented Dec 8, 2024

git checkout caa81728c37f5ccfa9a0979574b9272a67f8a286 # latest master
./x.py build
rustup toolchain link stage1 build/host/stage1
cd somewhere
git clone https://github.com/JakeDawkins/graphql-client-302-repro.git
cargo +stage1 "check" "--frozen" "--all" "--all-targets"

Sometimes results in:

    Checking circular-error-reprod v0.1.0 (/usr/local/google/home/adetaylor/graphql-client-302-repro)
error: rustc interrupted by SIGSEGV, printing backtrace

/usr/local/google/home/adetaylor/.rustup/toolchains/stage1/lib/librustc_driver-6f831de594460e04.so(+0xc7b4c6)[0x7fe80c07b4c6]
/lib/x86_64-linux-gnu/libc.so.6(+0x3f590)[0x7fe80b256590]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x209b27)[0x7fe7f1c09b27]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2073a4)[0x7fe7f1c073a4]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x205c24)[0x7fe7f1c05c24]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x1c6342)[0x7fe7f1bc6342]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x23073a)[0x7fe7f1c3073a]

### cycle encountered after 7 frames with period 10
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fe7f1ca9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fe7f1caa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fe7f1ca91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fe7f1c306dd]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2307a8)[0x7fe7f1c307a8]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fe7f1ca9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fe7f1caa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fe7f1ca91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fe7f1c306dd]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2307a8)[0x7fe7f1c307a8]
### recursed 24 times

/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fe7f1ca9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fe7f1caa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fe7f1ca91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fe7f1c306dd]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2307a8)[0x7fe7f1c307a8]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fe7f1ca9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fe7f1caa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fe7f1ca91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fe7f1c306dd]

note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
note: backtrace dumped due to SIGSEGV! resuming signal
error: rustc interrupted by SIGSEGV, printing backtrace

/usr/local/google/home/adetaylor/.rustup/toolchains/stage1/lib/librustc_driver-6f831de594460e04.so(+0xc7b4c6)[0x7fa599a7b4c6]
/lib/x86_64-linux-gnu/libc.so.6(+0x3f590)[0x7fa598c56590]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x209b27)[0x7fa588609b27]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2073a4)[0x7fa5886073a4]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x205c24)[0x7fa588605c24]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x1c6342)[0x7fa5885c6342]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x23073a)[0x7fa58863073a]

### cycle encountered after 7 frames with period 10
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fa5886a9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fa5886aa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fa5886a91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fa5886306dd]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2307a8)[0x7fa5886307a8]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fa5886a9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fa5886aa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fa5886a91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fa5886306dd]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2307a8)[0x7fa5886307a8]
### recursed 24 times

/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fa5886a9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fa5886aa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fa5886a91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fa5886306dd]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2307a8)[0x7fa5886307a8]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a9206)[0x7fa5886a9206]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2aa229)[0x7fa5886aa229]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fa5886a91d7]
/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2306dd)[0x7fa5886306dd]

note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
note: backtrace dumped due to SIGSEGV! resuming signal
error: could not compile `circular-error-reprod` (bin "circular-error-reprod")

Caused by:
  process didn't exit successfully: `/usr/local/google/home/adetaylor/.rustup/toolchains/stage1/bin/rustc --crate-name circular_error_reprod --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=242 --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=e64bad9338ae6dc9 -C extra-filename=-e64bad9338ae6dc9 --out-dir /usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps -C incremental=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/incremental -L dependency=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps --extern graphql_client=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_client-81673cf4002f5bdc.rmeta --extern serde=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libserde-06dcba11d127acfb.rmeta --extern serde_json=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libserde_json-21afa9959c22b931.rmeta` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: could not compile `circular-error-reprod` (bin "circular-error-reprod" test)

Caused by:
  process didn't exit successfully: `/usr/local/google/home/adetaylor/.rustup/toolchains/stage1/bin/rustc --crate-name circular_error_reprod --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=242 --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --test --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=33521454e230bec5 -C extra-filename=-33521454e230bec5 --out-dir /usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps -C incremental=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/incremental -L dependency=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps --extern graphql_client=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_client-81673cf4002f5bdc.rmeta --extern serde=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libserde-06dcba11d127acfb.rmeta --extern serde_json=/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libserde_json-21afa9959c22b931.rmeta` (signal: 11, SIGSEGV: invalid memory reference)

This happens on crater runs and has been seen in (at least) the following cases:
#121545 #132961 #117589 #114303 #101061 #95953 #82322

I couldn't see an existing bug for this so I thought I should raise one. It may well be a problem in the proc macro, so this may well not be a rustc bug: but if nothing else, we should probably exclude this crate from crater since it causes such confusion.

@adetaylor adetaylor added the C-bug Category: This is a bug. label Dec 8, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 8, 2024
@Noratrieb
Copy link
Member

note: rustc unexpectedly overflowed its stack! this is a bug

/usr/local/google/home/adetaylor/graphql-client-302-repro/target/debug/deps/libgraphql_query_derive-146122a8787811bb.so(+0x2a91d7)[0x7fa5886a91d7]

the graphql_query_derive macro is stackoverflowing

@jieyouxu jieyouxu added C-discussion Category: Discussion or questions that doesn't represent real issues. and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 8, 2024
@saethlin saethlin added C-external-bug Category: issue that is caused by bugs in software beyond our control and removed C-discussion Category: Discussion or questions that doesn't represent real issues. labels Dec 8, 2024
@saethlin
Copy link
Member

saethlin commented Dec 8, 2024

I don't think there's anything to discuss here. There are a lot of broken crates in the wild, adding more entries to the list of crates that crater ignores is normal maintenance of the crater codebase. Especially in the case like this where it's just one crate behaving pathologically, we shouldn't hesitate to add it to the crater exclusion list as soon as someone figures out that this is a bug or nondeterminism in the crate.

@saethlin saethlin closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2024
@adetaylor
Copy link
Contributor Author

I agree that the net outcome here is just to add this to the crater blocklist.

However, it seems that @saethlin already added did so in rust-lang/crater@31b9f33. @saethlin , do you have any clues why this addition to the blocklist didn't take effect?

@saethlin
Copy link
Member

saethlin commented Dec 9, 2024

Nope! Sounds like an issue to file on the crater repo or a question for t-infra in Zulip.

@adetaylor
Copy link
Contributor Author

Ah! I figured it out. It was added as skip_tests = true and needs to be skip = true. I'll raise a PR.

adetaylor added a commit to adetaylor/crater that referenced this issue Dec 9, 2024
This crates' errors are during its build process, not its tests. Discussed in rust-lang/rust#134028.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-external-bug Category: issue that is caused by bugs in software beyond our control
Projects
None yet
Development

No branches or pull requests

5 participants