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

Fixup wgpu segfault on exit #226

Merged
merged 2 commits into from
Nov 30, 2024
Merged

Fixup wgpu segfault on exit #226

merged 2 commits into from
Nov 30, 2024

Conversation

PolyMeilex
Copy link
Owner

This fixes this segfault on app exit (ctx drop), should probably report this upstream, but I'm too lazy.

Thread 1 "neothesia" received signal SIGSEGV, Segmentation fault.
0x00007ffff7fac08c in wl_map_insert_at (map=map@entry=0x55555823c930, flags=flags@entry=1, i=39, data=<optimized out>) at ../src/wayland-util.c:290
290		start[i].next |= (flags & 0x1) << 1;
(gdb) backtrace
#0  0x00007ffff7fac08c in wl_map_insert_at (map=map@entry=0x55555823c930, flags=flags@entry=1, i=39, data=<optimized out>) at ../src/wayland-util.c:290
#1  0x00007ffff7fac201 in proxy_destroy (proxy=proxy@entry=0x5555583a3990) at ../src/wayland-client.c:574
#2  0x00007ffff7fadf57 in wl_proxy_destroy_caller_locks (proxy=0x5555583a3990) at ../src/wayland-client.c:598
#3  wl_proxy_marshal_array_flags (proxy=proxy@entry=0x5555583a3990, opcode=opcode@entry=0, interface=interface@entry=0x0, version=version@entry=4, flags=flags@entry=1, args=args@entry=0x7fffffff8e90) at ../src/wayland-client.c:939
#4  0x00007ffff7faeb0a in wl_proxy_marshal_flags (proxy=proxy@entry=0x5555583a3990, opcode=opcode@entry=0, interface=interface@entry=0x0, version=4, flags=flags@entry=1) at ../src/wayland-client.c:857
#5  0x00007ffff4033a8e in wl_buffer_destroy (wl_buffer=0x5555583a3990) at /usr/include/wayland-client-protocol.h:2149
#6  dri2_teardown_wayland (dri2_dpy=dri2_dpy@entry=0x5555583a3ab0) at ../src/egl/drivers/dri2/platform_wayland.c:3043
#7  0x00007ffff4028158 in dri2_display_destroy (disp=disp@entry=0x5555583a2f00) at ../src/egl/drivers/dri2/egl_dri2.c:1153
#8  0x00007ffff40287e0 in dri2_display_release (disp=0x5555583a2f00) at ../src/egl/drivers/dri2/egl_dri2.c:1114
#9  dri2_display_release (disp=0x5555583a2f00) at ../src/egl/drivers/dri2/egl_dri2.c:1099
#10 dri2_terminate (disp=0x5555583a2f00) at ../src/egl/drivers/dri2/egl_dri2.c:1243
#11 0x00007ffff4014f74 in eglTerminate (dpy=<optimized out>) at ../src/egl/main/eglapi.c:774
#12 0x0000555557b71010 in khronos_egl::{impl#97}::eglTerminate<libloading::safe::Library> (self=0x55555830c880, display=0x5555583a2f00) at /home/poly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/khronos-egl-6.0.0/src/lib.rs:2321
#13 khronos_egl::Instance<khronos_egl::Dynamic<libloading::safe::Library, khronos_egl::EGL1_4>>::terminate<khronos_egl::Dynamic<libloading::safe::Library, khronos_egl::EGL1_4>> (self=0x55555830c880, display=...)
    at /home/poly/.cargo/registry/src/index.crates.io-6f17d22bba15001f/khronos-egl-6.0.0/src/lib.rs:1181
#14 0x0000555557aad636 in wgpu_hal::gles::egl::terminate_display (egl=0x55555830c880, display=...) at src/gles/egl.rs:501
#15 0x0000555557ab1361 in wgpu_hal::gles::egl::{impl#11}::drop (self=0x5555583972b8) at src/gles/egl.rs:718
#16 0x0000555557b48a37 in core::ptr::drop_in_place<wgpu_hal::gles::egl::Inner> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#17 0x0000555557b4b04b in core::ptr::drop_in_place<core::cell::UnsafeCell<wgpu_hal::gles::egl::Inner>> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#18 0x0000555557b45c0f in core::ptr::drop_in_place<lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, wgpu_hal::gles::egl::Inner>> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#19 0x0000555557b48e7c in core::ptr::drop_in_place<wgpu_hal::gles::egl::Instance> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#20 0x00005555578f0204 in core::ptr::drop_in_place<alloc::boxed::Box<dyn wgpu_hal::dynamic::instance::DynInstance, alloc::alloc::Global>> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#21 0x00005555578dee4f in core::ptr::drop_in_place<(wgpu_types::Backend, alloc::boxed::Box<dyn wgpu_hal::dynamic::instance::DynInstance, alloc::alloc::Global>)> ()
    at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#22 0x00005555578e075e in core::ptr::drop_in_place<[(wgpu_types::Backend, alloc::boxed::Box<dyn wgpu_hal::dynamic::instance::DynInstance, alloc::alloc::Global>)]> ()
    at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#23 0x0000555557766247 in alloc::vec::{impl#25}::drop<(wgpu_types::Backend, alloc::boxed::Box<dyn wgpu_hal::dynamic::instance::DynInstance, alloc::alloc::Global>), alloc::alloc::Global> (self=0x555558396018)
    at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/vec/mod.rs:3316
#24 0x00005555578e1b87 in core::ptr::drop_in_place<alloc::vec::Vec<(wgpu_types::Backend, alloc::boxed::Box<dyn wgpu_hal::dynamic::instance::DynInstance, alloc::alloc::Global>), alloc::alloc::Global>> ()
    at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#25 0x00005555578e57cc in core::ptr::drop_in_place<wgpu_core::instance::Instance> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#26 0x0000555557712d84 in core::ptr::drop_in_place<wgpu_core::global::Global> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#27 0x0000555557713c54 in core::ptr::drop_in_place<wgpu::backend::wgpu_core::ContextWgpuCore> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#28 0x000055555771337d in core::ptr::drop_in_place<dyn wgpu::context::DynContext> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#29 0x000055555773d8ba in alloc::sync::Arc<dyn wgpu::context::DynContext, alloc::alloc::Global>::drop_slow<dyn wgpu::context::DynContext, alloc::alloc::Global> (self=0x555558d5ca98)
    at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/sync.rs:1831
#30 0x000055555773df01 in alloc::sync::{impl#37}::drop<dyn wgpu::context::DynContext, alloc::alloc::Global> (self=0x555558d5ca98) at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/sync.rs:2524
#31 0x000055555771467b in core::ptr::drop_in_place<alloc::sync::Arc<dyn wgpu::context::DynContext, alloc::alloc::Global>> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#32 0x0000555556bf5f17 in core::ptr::drop_in_place<wgpu::api::bind_group::BindGroup> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#33 0x0000555556b3a5ba in core::ptr::drop_in_place<wgpu_jumpstart::uniform::Uniform<neothesia_core::render::background_animation::TimeUniform>> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#34 0x0000555556222ada in core::ptr::drop_in_place<neothesia_core::render::background_animation::BgPipeline> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#35 0x000055555622011a in core::ptr::drop_in_place<neothesia::scene::menu_scene::MenuScene> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#36 0x0000555556222844 in core::ptr::drop_in_place<alloc::boxed::Box<dyn neothesia::scene::Scene, alloc::alloc::Global>> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#37 0x000055555621dcef in core::ptr::drop_in_place<neothesia::Neothesia> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#38 0x00005555562218f2 in core::ptr::drop_in_place<core::option::Option<neothesia::Neothesia>> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#39 0x000055555621ed77 in core::ptr::drop_in_place<neothesia::NeothesiaBootstrap> () at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ptr/mod.rs:574
#40 0x000055555625d1a3 in neothesia::main () at neothesia/src/main.rs:341

@PolyMeilex
Copy link
Owner Author

This is probably caused by gfx-rs/wgpu#4650 or gfx-rs/wgpu#5655

@PolyMeilex PolyMeilex merged commit 7c1ae2e into master Nov 30, 2024
5 checks passed
@PolyMeilex PolyMeilex deleted the fixup-wgpu-segfault-on-exit branch November 30, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant