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

ICE when compiling with -Z ast_json #14940

Closed
schmee opened this issue Jun 16, 2014 · 4 comments · Fixed by #14945
Closed

ICE when compiling with -Z ast_json #14940

schmee opened this issue Jun 16, 2014 · 4 comments · Fixed by #14945

Comments

@schmee
Copy link
Contributor

schmee commented Jun 16, 2014

Compiling https://github.com/schmee/rust/blob/counted-set/src/libcollections/counted_set.rs on Windows 7 with rustc counted_set.rs -Z ast-json or rustc counted_set.rs -Z ast-json-noexpand results in the following ICE:

$ rustc counted_set.rs -Z ast-json
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'called `Result::unwrap()` on an `Err` value: OS Error 8: Not enough storage is available to process this command.
', C:\bot\slave\nightly-win\build\src\libcore\result.rs:545

stack backtrace:
   1: 0x70dcc1a5
   2: 0x701c92e1
   3: 0x701c8f08
   4: 0x701c8cee
   5: 0x7021d648
   6: 0x65b97899
   7: 0x65b90b55
   8: 0x65c47e2f
   9: 0x65c4552d
  10: 0x65c5ee21
  11: 0x65c5a55e
  12: 0x64171623
  13: 0x701c67bc
  14: 0x701c657e
  15: 0x641714ac
  16: 0x701c844f
  17: 0x77d99f72

Version:

$ rustc --version
rustc 0.11.0-pre-nightly (7ec7805 2014-06-16 08:16:49 +0000)
host: i686-pc-mingw32
@alexcrichton
Copy link
Member

Could you provide a gdb stack trace as well?

@schmee
Copy link
Contributor Author

schmee commented Jun 16, 2014

Sure! First time using gdb, I hope this is correct:

Breakpoint 1, 0x701c8ac0 in rust_fail () from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
(gdb) bt
#0  0x701c8ac0 in rust_fail () from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#1  0x701c95a6 in unwind::begin_unwind_inner::he0051bbad957d0946zd::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#2  0x701c8f08 in unwind::begin_unwind_fmt::h0d0f954482e3389ezxd::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#3  0x701c8cee in rust_begin_unwind () from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#4  0x70215898 in failure::begin_unwind::h1ee234800f8570f923v::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#5  0x65b97f39 in driver::driver::phase_2_configure_and_expand::h8d96f8c3f8496f2aQjv::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustc-d252d482-0.11.0-pre.dll
#6  0x65b911f5 in _fu2123___ZN9LOG_LEVEL20h1b062b54018c9f0ejia11v0.11.0.preE ()
   from c:\Program Files (x86)\Rust\bin\rustc-d252d482-0.11.0-pre.dll
#7  0x65c4874a in driver::run_compiler::h10885a06abea3df3gXx::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustc-d252d482-0.11.0-pre.dll
#8  0x65c45e5d in driver::main_args::closure.98681 ()
   from c:\Program Files (x86)\Rust\bin\rustc-d252d482-0.11.0-pre.dll
#9  0x65c5f851 in driver::monitor::closure.99774 ()
   from c:\Program Files (x86)\Rust\bin\rustc-d252d482-0.11.0-pre.dll
#10 0x65c5af8e in task::TaskBuilder::try::closure.99534 ()
   from c:\Program Files (x86)\Rust\bin\rustc-d252d482-0.11.0-pre.dll
#11 0x641715e3 in task::spawn_opts::closure.7185 ()
   from c:\Program Files (x86)\Rust\bin\native-1fb5e2c0-0.11.0-pre.dll
#12 0x701c67bc in task::Task::run::closure.5421 ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#13 0x701c8ab5 in unwind::try::try_fn::haab7172debb57904Sqd::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#14 0x7022eca6 in rust_try () from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#15 0x701c8935 in unwind::try::hce2ffb3335cad393vod::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#16 0x701c657e in task::Task::run::he2dac0e0baab6665fTc::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#17 0x6417146c in task::spawn_opts::closure.7156 ()
   from c:\Program Files (x86)\Rust\bin\native-1fb5e2c0-0.11.0-pre.dll
#18 0x701c844f in thread::thread_start::h0d16693d392cfdf3Ead::v0.11.0.pre ()
   from c:\Program Files (x86)\Rust\bin\rustrt-d8560cb2-0.11.0-pre.dll
#19 0x7586338a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
#20 0x77d99f72 in ntdll!RtlInitializeExceptionChain () from C:\Windows\system32\ntdll.dll
#21 0x77d99f45 in ntdll!RtlInitializeExceptionChain () from C:\Windows\system32\ntdll.dll
#22 0x00000000 in ?? ()

@alexcrichton
Copy link
Member

On windows I've seen I/O errors when you're reading into a very large buffer, so this may be triggering errors when you're writing a very large buffer. Does this program fail for you?

use std::io::stdio;

fn main() {
    let mut out = stdio::stdout();
    out.write(['a' as u8, ..128 * 1024]).unwrap();
}

@schmee
Copy link
Contributor Author

schmee commented Jun 16, 2014

Yes, yes it does!

$ rustc test.rs && ./test
task '<main>' failed at 'called `Result::unwrap()` on an `Err` value: OS Error 8 (FormatMessageW() returned error 15100)', C:\bot\slave\nightly-win\build\src\libcore\result.rs:545

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jun 17, 2014
This just takes a similar approach to reading stdin on windows by artificially
limiting the size of the buffers going in and out.

Closes rust-lang#14940
bors added a commit that referenced this issue Jun 17, 2014
This just takes a similar approach to reading stdin on windows by artificially
limiting the size of the buffers going in and out.

Closes #14940
alexcrichton added a commit to alexcrichton/rust that referenced this issue Sep 8, 2014
I've found that 64k is still too much and continue to see the errors as reported
in rust-lang#14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed
the size down to 8192 which libuv happens to use as well.

It sounds like the limit can still be hit with many threads in play, but I have
yet to reproduce this, so I figure we can wait until that's hit (if it's
possible) and then take action.
bors added a commit that referenced this issue Sep 8, 2014
… r=brson

I've found that 64k is still too much and continue to see the errors as reported
in #14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed
the size down to 10000 which the included links in the added comment end up
recommending.

It sounds like the limit can still be hit with many threads in play, but I have
yet to reproduce this, so I figure we can wait until that's hit (if it's
possible) and then take action.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants