Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Panic in pprust::print_crate from Registry::expand #33

Closed
reem opened this issue Feb 26, 2016 · 3 comments
Closed

Panic in pprust::print_crate from Registry::expand #33

reem opened this issue Feb 26, 2016 · 3 comments

Comments

@reem
Copy link

reem commented Feb 26, 2016

I'm not really sure how to reduce this example, but I am seeing a panic during Registry::expand when using syntex 0.29:

   Compiling google-storage1 v0.1.11+20151229 (file:///Users/reem/code/rust/google-apis-rs/gen/storage1)
failed to run custom build command for `google-storage1 v0.1.11+20151229 (file:///Users/reem/code/rust/google-apis-rs/gen/storage1)`
Process didn't exit successfully: `/Users/reem/code/rust/google-apis-rs/target/debug/build/google-storage1-91992d23db032e43/build-script-build` (exit code: 101)
--- stderr
thread '<main>' panicked at 'assertion failed: (self.right != self.left)', /Users/reem/.multirust/toolchains/nightly/cargo/registry/src/github.com-88ac128001ac3a9a/syntex_syntax-0.29.0/src/print/pp.rs:447
stack backtrace:
   1:        0x109e33e38 - sys::backtrace::tracing::imp::write::h4c3934d94b73ae74jYu
   2:        0x109e35855 - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.43867
   3:        0x109e35478 - panicking::default_handler::h31854fe07604bc37Ipz
   4:        0x109e2a466 - sys_common::unwind::begin_unwind_inner::hb0e3e92ad83708955Wt
   5:        0x109a55717 - sys_common::unwind::begin_unwind::h13310149087117287422
   6:        0x109c2de40 - print::pp::Printer<'a>::advance_right::h2fd3d40c1346a166N2Z
   7:        0x109c2c08b - print::pp::Printer<'a>::pretty_print::h8b60fbda5e54804cJFZ
   8:        0x109c331b2 - print::pp::break_offset::hb7326f3ba29f680alv0
   9:        0x109c33395 - print::pp::spaces::hb56287ba8248dd6c8w0
  10:        0x109c33422 - print::pp::hardbreak::h8eadc47bce97d74aPx0
  11:        0x109c38431 - print::pprust::PrintState::print_comment::h11066382073331049449
  12:        0x109c367df - print::pprust::PrintState::maybe_print_comment::h13073139524935217014
  13:        0x109c4deee - print::pprust::State<'a>::print_item::h74f5b5971fbec341Fh2
  14:        0x109c3cd2f - print::pprust::State<'a>::print_mod::h500a09ca414ea7159Q1
  15:        0x109c52ff2 - print::pprust::State<'a>::print_item::h74f5b5971fbec341Fh2
  16:        0x109c3cd2f - print::pprust::State<'a>::print_mod::h500a09ca414ea7159Q1
  17:        0x109c3485d - print::pprust::print_crate::h351e124c4e4ef40e1C0
  18:        0x1099f61d3 - Registry::expand::hc5fe903efc538e6fvfa
  19:        0x1098799cc - main::h963dff89d0848740iaa
  20:        0x109e35082 - sys_common::unwind::try::try_fn::h1579330920516057840
  21:        0x109e3338b - __rust_try
  22:        0x109e34f40 - rt::lang_start::h68f017568afbc542Ohz
  23:        0x10988bcf9 - main

the crate in question is the google-storage1 crate from https://github.com/Byron/google-apis-rs.

The panic can be reproduced by cloning the repo and running make storage1-cargo ARGS=build. I believe this to be a bug in syntex, not in google-storage1, but I could be incorrect.

@causal-agent
Copy link

Also getting this failure on various google-apis-rs crates, namely google-gmail1.

@Byron
Copy link

Byron commented Mar 6, 2016

Please note that the current workaround is to use serde_codegen <= 0.6.13 .
More information can be found in this comment.

@erickt
Copy link

erickt commented Mar 7, 2016

Thanks for filing this. This seems to be some bug in the upstream libsyntax. I'll poke around and see if updating syntex to the latest libsyntax will fix things.

bors added a commit to rust-lang/rust that referenced this issue May 29, 2016
Prevent overflows by increasing ring buffer size

Please note that this change is just done to prevent
issues as currently seen by syntex_syntax in future.
See serde-deprecated/syntex#47 for details.

As shown in serde-deprecated/syntex#33,
complex code can easily overflow the ring-buffer and
cause an assertion error.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants