rust-windowing / rust-windowing/winit
Toggle Fullscreen segfaults in application example
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
Description
When running cargo run --example application and toggling fullscreen, the application segfaults with the following logs:
2026-02-08T12:20:33.503457Z INFO application: User wake up
2026-02-08T12:20:33.579934Z INFO application: Modifiers changed to ModifiersState(CONTROL)
2026-02-08T12:20:33.659226Z INFO application: Executing action: ToggleFullscreen
thread 'main' (12295040) panicked at winit/examples/application.rs:975:21:
index out of bounds: the len is 1920000 but the index is 1920000
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2026-02-08T12:20:33.724373Z INFO application: Application exited
2026-02-08T12:20:33.724518Z ERROR winit_common::event_handler: tried to run event handler, but no handler was set
2026-02-08T12:20:33.749846Z ERROR winit_common::event_handler: tried to run event handler, but no handler was set
[1] 68120 segmentation fault cargo run --example application
Seems like the buffer size in draw() is being calculated before the resize, leading to index out-of-bounds issue.
Bug exists on macOS, but could also be on Windows and Linux. Don't have them to test.
macOS version
ProductName: macOS
ProductVersion: 15.6.1
BuildVersion: 24G90
Winit version
0.31-beta2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run cargo run --example application and reproduce the panic by toggling fullscreen. Inspect winit/examples/application.rs around line 975 and trace how draw() calculates its buffer size before and after resizing. Done means fullscreen toggling no longer produces the out-of-bounds panic or subsequent segmentation fault.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100