Skip to content

time::since_epoch test crashes with overflow when debug assertions are enabled #32268

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

Closed
aturon opened this issue Mar 15, 2016 · 1 comment
Closed
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc

Comments

@aturon
Copy link
Member

aturon commented Mar 15, 2016

On Mac OS, I get the following when building with --enable-debug-assertions:

---- time::tests::since_epoch stdout ----
thread 'time::tests::since_epoch' panicked at 'arithmetic operation overflowed', src/libstd/sys/unix/time.rs:91

We should track down what's going on with this test, and get the builders enabling debug assertions in general to catch this kind of problem.

@aturon aturon added the A-testsuite Area: The testsuite used to check the correctness of rustc label Mar 15, 2016
@aturon
Copy link
Member Author

aturon commented Mar 15, 2016

cc @alexcrichton

alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 15, 2016
This code was currently only exercised on OSX, but this applies the same method
of subtraction used on Linux which doesn't have the same overflow issues.

Note that this currently includes no tests, but that's because this is only
visible with debug assertions enabled. Soon, however, I'll enable debug
assertions on all auto builds on the bots so we should get testing for this.

Closes rust-lang#32268
bors added a commit that referenced this issue Mar 16, 2016
std: Fix overflow when subtracting Instant

This code was currently only exercised on OSX, but this applies the same method
of subtraction used on Linux which doesn't have the same overflow issues.

Note that this currently includes no tests, but that's because this is only
visible with debug assertions enabled. Soon, however, I'll enable debug
assertions on all auto builds on the bots so we should get testing for this.

Closes #32268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc
Projects
None yet
Development

No branches or pull requests

1 participant