We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So I'm not sure where to post this, and it's hard to reproduce since it's UB.
I added a test to this crate
Cargo.toml changes
Cargo.toml
[dev-dependencies] piston_window = "0.40" rand = "0.3"
tests/smoke.rs
extern crate gfx_texture; extern crate piston_window; extern crate rand; extern crate image as im; use piston_window::*; #[test] fn create() { let window: PistonWindow = WindowSettings::new("Hello Piston!", (640, 480)) .build() .expect("Failed to build PistonWindow"); let mut img = im::ImageBuffer::new(2, 2); for x in 0..2 { for y in 0..2 { img.put_pixel(x, y, im::Rgba([rand::random(), rand::random(), rand::random(), 255])); } } let mut factory = window.factory.borrow_mut(); let factory = &mut *factory; Texture::from_image(factory, &img, &TextureSettings::new()).unwrap(); } #[test] fn update() { let window: PistonWindow = WindowSettings::new("Hello Piston!", (640, 480)) .build() .expect("Failed to build PistonWindow"); let mut img = im::ImageBuffer::new(2, 2); for x in 0..2 { for y in 0..2 { img.put_pixel(x, y, im::Rgba([rand::random(), rand::random(), rand::random(), 255])); } } let mut factory = window.factory.borrow_mut(); let factory = &mut *factory; let mut tex = Texture::from_image(factory, &img, &TextureSettings::new()).unwrap(); tex.update(&mut *window.encoder.borrow_mut(), &img).unwrap(); }
renaming the update test to segfault prevents the segfault and gives a normal panic. So this might not be reproducable on the target machine.
update
segfault
splitting the window.encoder.borrow_mut() like the factory into multiple bindings will also not segfault on my machine.
window.encoder.borrow_mut()
factory
I'm using rustc 1.9.0-nightly (30a3849f2 2016-03-30)
rustc 1.9.0-nightly (30a3849f2 2016-03-30)
The text was updated successfully, but these errors were encountered:
Do you have a call stack?
Sorry, something went wrong.
The window might be running out of scope before the texture creation/update.
window
Try drop(window); at the end.
drop(window);
@oli-obk is it related to gfx-rs/gfx#928 ?
nope, completely unrelated, it was just found while trying to create an MCVE for that.
No branches or pull requests
So I'm not sure where to post this, and it's hard to reproduce since it's UB.
I added a test to this crate
Cargo.toml
changestests/smoke.rs
renaming the
update
test tosegfault
prevents the segfault and gives a normal panic. So this might not be reproducable on the target machine.splitting the
window.encoder.borrow_mut()
like thefactory
into multiple bindings will also not segfault on my machine.I'm using
rustc 1.9.0-nightly (30a3849f2 2016-03-30)
The text was updated successfully, but these errors were encountered: