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

Wayland: segmentation fault in examples/standalone/02_hello_window on version 24.0.1 #7025

Closed
artemious3 opened this issue Jan 29, 2025 · 3 comments

Comments

@artemious3
Copy link

artemious3 commented Jan 29, 2025

Description

After changing wgpu version from 24.0.0 to 24.0.1, the example application at examples/standalone/02_hello_window receives SEGFAULT after the close request.

Repro steps

  1. cd examples/standalone/02_hello_window
  2. Replace wgpu = "24.0.0" with wgpu = "24.0.1" in Cargo.toml
  3. cargo run
  4. Close the window

Expected vs observed behavior

Expected behavior : graceful termination
Observed behavior : SIGSEGV

Extra materials

Logs with RUST_LOG=trace

...
The close button was pressed; stopping
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] Texture::create_view(Id(0,176)) -> Id(0,176)
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] Device::create_command_encoder -> Id(0,176)
[2025-01-29T18:30:56Z TRACE wgpu_core::device::queue] Queue::submit
[2025-01-29T18:30:56Z TRACE wgpu_core::resource] Destroy raw TextureView with '' label
[2025-01-29T18:30:56Z TRACE wgpu_core::device::queue] Queue::submit returned submit index 176
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] CommandBuffer::drop Id(0,176)
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] CommandEncoder::drop Id(0,176)
[2025-01-29T18:30:56Z TRACE wgpu_core::command] Drop CommandBuffer with '' label
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] Texture::drop Id(0,176)
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] TextureView::drop Id(0,176)
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] Device::drop Id(0,1)
[2025-01-29T18:30:56Z TRACE wgpu_core::device::global] Queue::drop Id(0,1)
[2025-01-29T18:30:56Z TRACE wgpu_core::device::queue] Drop Queue with '' label
[2025-01-29T18:30:56Z TRACE wgpu_core::device::queue] Waiting on last submission. try: 1/6. timeout: 100ms
[2025-01-29T18:30:56Z TRACE wgpu_core::resource] Destroy raw TextureView with '' label
[2025-01-29T18:30:56Z TRACE wgpu_core::instance] Surface::drop Id(0,1)
[1]    74678 segmentation fault (core dumped)  env RUST_LOG=trace ../../../target/debug/wgpu-example-02-hello-window

Backtrace from GDB

Thread 24 "wgpu-example-02" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc2ffd6c0 (LWP 75644)]
0x00007ffff7fb488c in wl_map_insert_at (map=map@entry=0x555556c8b350, flags=flags@entry=1, i=47, data=<optimized out>) at ../wayland-1.23.1/src/wayland-util.c:290
290		start[i].next |= (flags & 0x1) << 1;
(gdb) bt
#0  0x00007ffff7fb488c in wl_map_insert_at (map=map@entry=0x555556c8b350, flags=flags@entry=1, i=47, data=<optimized out>) at ../wayland-1.23.1/src/wayland-util.c:290
#1  0x00007ffff7fb4a01 in proxy_destroy (proxy=proxy@entry=0x7fffc4001f40) at ../wayland-1.23.1/src/wayland-client.c:574
#2  0x00007ffff7fb4b30 in wl_proxy_destroy_caller_locks (proxy=0x7fffc4001f40) at ../wayland-1.23.1/src/wayland-client.c:598
#3  wl_proxy_destroy (proxy=proxy@entry=0x7fffc4001f40) at ../wayland-1.23.1/src/wayland-client.c:621
#4  0x00007ffff7fb74e5 in wl_callback_destroy (wl_callback=0x7fffc4001f40) at src/wayland-client-protocol.h:1284
#5  wl_display_roundtrip_queue (display=0x555556c8b2c0, queue=0x55555733e2e0) at ../wayland-1.23.1/src/wayland-client.c:1451
#6  0x00007fffe0a07cc5 in ?? () from /usr/lib/amdvlk64.so
#7  0x00007fffe0a07d95 in ?? () from /usr/lib/amdvlk64.so
#8  0x00007fffe0a12724 in ?? () from /usr/lib/amdvlk64.so
#9  0x00007fffe0a7d651 in ?? () from /usr/lib/amdvlk64.so
#10 0x00007ffff7d002ce in start_thread (arg=<optimized out>) at pthread_create.c:447
#11 0x00007ffff7d8529c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Platform
OS: EndeavourOS x86_64
Kernel: Linux 6.12.10-arch1-1
DE: KDE Plasma 6.2.5
WM: KWin (Wayland)

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Jan 29, 2025

Try running inside the repository does that fix it?

@artemious3
Copy link
Author

artemious3 commented Jan 29, 2025

Only after git reset --hard the problem is fixed.

@cwfitzgerald
Copy link
Member

Alright, then this was likely fixed by #6997 and we should probably backport it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants