Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upcitybound release crashes with invalid instruction (ud2) some times on mac, nightly-2017-12-12 (and 12-15) #249
Comments
bogdad
referenced this issue
Dec 23, 2017
Closed
fix for 'citybound release crashes with invalid instruction (ud2)' #250
This comment has been minimized.
This comment has been minimized.
|
I suppose illegal instruction is a Rust issue. |
This comment has been minimized.
This comment has been minimized.
|
sure, the cool thing to do would be to construct a minimal failing example that generates ud2. Unfortunately I was not able to do this yet. However it might be a good idea to merge the temporary fix pr which removes ud2 by altering citybound code until the rust issue is found and fixed. |
This comment has been minimized.
This comment has been minimized.
|
Seems rust issue was fixed: After removing clippy from default features in cargo and compiling with nightly-2018-01-06-x86_64-apple-darwin, citybound just crashes with
and there is no ud2 in the asm! |
This comment has been minimized.
This comment has been minimized.
|
This may not be limited to mac. On Ubuntu 17.10 I get:
This occurs when I attempt to spawn cars after creating a small grid. |
This comment has been minimized.
This comment has been minimized.
|
was able to build a smaller playground example when run in release it fails with illegal instruction when run in debug it produces correct output if println on line 346 is uncommented, it works in release also. |
This comment has been minimized.
This comment has been minimized.
|
I suppose it should be reported as |
This comment has been minimized.
This comment has been minimized.
|
I was able to create a smaller failing example using the example @bogdad provided: https://play.rust-lang.org/?gist=8ac595bd97b3cebd3c7df7beb9acfd14&version=nightly&mode=release It looks like even running Looking at the documentation for
But we have the (simplified here) code from
changing
Gives the same behavior in release and debug. So I think that is our culprit. |
Paul-E
referenced this issue
Feb 21, 2018
Merged
Fixes "citybound release crashes with invalid instruction" #257
This comment has been minimized.
This comment has been minimized.
|
Yay!
…On Wed, 21 Feb 2018 at 05:21, Paul Ellenbogen ***@***.***> wrote:
I was able to create a smaller case using the example @bogdad
<https://github.com/bogdad> provided:
https://play.rust-lang.org/?gist=8ac595bd97b3cebd3c7df7beb9acfd14&version=nightly&mode=release
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#249 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEBGo6Pr2Q2W4nNC2rGw0NzrtIANKjOks5tW5nYgaJpZM4RLr2F>
.
|
bogdad commentedDec 23, 2017
Hi!
Stumbled into kind of rust compiler believes citybound code is undefined behaviour for some reason. Hope there is something wrong with my setup, otherwise it would be a hard but interesting thing to track down )
so the bug:
creating some roads, then spawning cars on mac soon results in:
running under release lldb:
the previous instruction being
I think rust compiler believes that everything after the call to wake_up_in would result in undefined bahaviour.
compiling with asm and mir output to get the source of the closure:
then grepping for the closure:
which then has the reference to the file:
move_into method
in the move_into method there is a offers vec
which gets converted to CVec.
altering the source to have this vec![] empty makes rust and llvm remove the undefined behaviour (ud2 instruction immedately after the call to wake_up_in) and generating the code after wake_up_in.
Unfortunately, this is all that I had time to dig, hope that helps!
I'll try to continue in the meantime.