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

Segfault in __udivmodti4 quickcheck when remainder is requested #137

Closed
est31 opened this issue Feb 4, 2017 · 7 comments · Fixed by #287
Closed

Segfault in __udivmodti4 quickcheck when remainder is requested #137

est31 opened this issue Feb 4, 2017 · 7 comments · Fixed by #287

Comments

@est31
Copy link
Member

est31 commented Feb 4, 2017

PR #133 adds quickcheck tests for __udivmodti4 with the code that does checking with remainder enabled commented out. I commented it out as I got a segfault.

@est31
Copy link
Member Author

est31 commented Feb 4, 2017

The segfault happens at:

0x00007ffff55fc22e in __udivmodti4 (a=11837846198047054611, b=10468428215946443262, rem=0x7ffff67fc388)
    at compiler-rt/lib/builtins/udivmodti4.c:47
47                      *rem = n.s.low % d.s.low;

@japaric
Copy link
Member

japaric commented Apr 10, 2017

According to this Travis build, this appears to only happens on MIPS.

EDIT: Actually, this might be a different error.

@est31
Copy link
Member Author

est31 commented Apr 11, 2017

@japaric as you can see from this travis log, it failed on multiple 64 bit platforms (x86_64, aarch64, mips64, powerpc64, ...): https://travis-ci.org/rust-lang-nursery/compiler-builtins/builds/198218713

@japaric
Copy link
Member

japaric commented Apr 11, 2017

From #155, I'm seeing errors in the following unit tests only on 32-bit MIPS

  • divti3, SIGSEGV
  • modti3, fails an assert_eq where both LHS and RHS are the same
  • muloti4, "attempt to subtract with overflow" src/int/mul.rs:58
  • udivmodti4, SIGSEV
  • udivt3, wrong answer
    • expected: ((1844674407370955161400, 18002795302052819272), 11689864710784774277)
    • got: ((1844674407370955161400, 18002795302052819272), 11689864690002821119)
    • format: (inputs, output)
  • umodti3, "attempt to subtract with overflow" src/int/udiv.rs:278

@japaric
Copy link
Member

japaric commented Apr 11, 2017

@est31 AFAICS, all the errors in the build you have linked seem to be due to "missing symbol" which indicates a bad cache.

japaric pushed a commit that referenced this issue Apr 11, 2017
there's an unfixed bug. See #137
@est31
Copy link
Member Author

est31 commented Apr 11, 2017

@japaric ah you are right. I think I remember though reproducing the issue on my native platform (x86_64). Maybe you can try to comment out this code and try whether you can reproduce?

@japaric
Copy link
Member

japaric commented Apr 11, 2017

Maybe you can try to comment out this code and try whether you can reproduce?

I can locally repro on x86_64. The weird thing is that we are not hitting this bug on x86_64 and other arches in #155.

alexcrichton added a commit to alexcrichton/compiler-builtins that referenced this issue May 2, 2019
They seem to be passing locally so let's see what CI has to say.

Closes rust-lang#137
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