gfx-rs / gfx-ocean

Compute based ocean simulation with gfx_hal :ocean:
116 stars 7 forks source link

Illegal instruction (core dumped) on nightly-2019-04-22 #11

Closed norru closed 5 years ago

norru commented 5 years ago

Building from scratch, the compiler does barf about deprecated behaviour

warning[E0502]: cannot borrow `*self` as immutable because it is also borrowed as mutable
   -->.../nalgebra-0.11.2/src/core/cg.rs:314:44
    |
314 |                 self[(j, i)] += shift[j] * self[(D::dim() - 1, i)];
    |                 ---------------------------^^^^-------------------
    |                 |                          |
    |                 |                          immutable borrow occurs here
    |                 mutable borrow occurs here
    |                 mutable borrow later used here
    |
    = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
    = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future

And then, unsurprisingly, the optimized binary does crash at startup.

~/Projects/3rdParty/gfx_ocean$ cargo run --release --features vulkan
    Finished release [optimized] target(s) in 0.13s
     Running `target/release/ocean`
Illegal instruction (core dumped)

~/Projects/3rdParty/gfx_ocean$ cargo --version
cargo 1.36.0-nightly (b6581d383 2019-04-16)

~/Projects/3rdParty/gfx_ocean$ rustc --version
rustc 1.36.0-nightly (6d599337f 2019-04-22)
msiglreith commented 5 years ago

Hi, I just tried and with latest stable rustc 1.34.0 (91856ed52 2019-04-10) and didn't face any issues or warnings in this regard.

norru commented 5 years ago

Yes, it's only in nightly and likely not a bug - so as soon as 1.36 reaches stable you'll have this problem.

msiglreith commented 5 years ago

Should be fixed, now updated dependencies and runtime ocean generation (panopaea) which dependens on an old nalgebra release. Should help with startup times as well (: