Segmentation fault (wgpu, term)

I'm trying to figure out why my application segfaults.

Commit: Some more · Ploppz/bup@94f0e8f · GitHub

I run it in WSL on Windows 11 with WSLg installed (graphical support for WSL).

It exits immediately with the text Segmentation fault.

$ valgrind target/debug/bup
==24218== Memcheck, a memory error detector
==24218== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==24218== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==24218== Command: target/debug/bup
==24218==
==24218== Syscall param statx(file_name) points to unaddressable byte(s)
==24218==    at 0x59799FE: statx (statx.c:29)
==24218==    by 0x1D2158A: statx (weak.rs:178)
==24218==    by 0x1D2158A: std::sys::unix::fs::try_statx (fs.rs:139)
==24218==    by 0x1D1E60D: std::sys::unix::fs::stat (fs.rs:1186)
==24218==    by 0x57F887: std::fs::metadata (fs.rs:1633)
==24218==    by 0x57AED4: term::terminfo::searcher::get_dbpath_for_term (searcher.rs:74)
==24218==    by 0x598FC5: term::terminfo::TermInfo::from_name (mod.rs:93)
==24218==    by 0x598DF4: term::terminfo::TermInfo::from_env (mod.rs:85)
==24218==    by 0x59B6AE: term::terminfo::TerminfoTerminal<T>::new (mod.rs:378)
==24218==    by 0x583981: term::stderr (lib.rs:111)
==24218==    by 0x56C8D0: slog_term::TermDecoratorBuilder::build (lib.rs:1412)
==24218==    by 0x54333C: bup::log::logger (log.rs:12)
==24218==    by 0x4909CC: <bup::Ui as iced::application::Application>::new (main.rs:335)
==24218==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==24218==
==24218== Syscall param statx(buf) points to unaddressable byte(s)
==24218==    at 0x59799FE: statx (statx.c:29)
==24218==    by 0x1D2158A: statx (weak.rs:178)
==24218==    by 0x1D2158A: std::sys::unix::fs::try_statx (fs.rs:139)
==24218==    by 0x1D1E60D: std::sys::unix::fs::stat (fs.rs:1186)
==24218==    by 0x57F887: std::fs::metadata (fs.rs:1633)
==24218==    by 0x57AED4: term::terminfo::searcher::get_dbpath_for_term (searcher.rs:74)
==24218==    by 0x598FC5: term::terminfo::TermInfo::from_name (mod.rs:93)
==24218==    by 0x598DF4: term::terminfo::TermInfo::from_env (mod.rs:85)
==24218==    by 0x59B6AE: term::terminfo::TerminfoTerminal<T>::new (mod.rs:378)
==24218==    by 0x583981: term::stderr (lib.rs:111)
==24218==    by 0x56C8D0: slog_term::TermDecoratorBuilder::build (lib.rs:1412)
==24218==    by 0x54333C: bup::log::logger (log.rs:12)
==24218==    by 0x4909CC: <bup::Ui as iced::application::Application>::new (main.rs:335)
==24218==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==24218==
==24218== Invalid read of size 8
==24218==    at 0x6479D75: wl_proxy_destroy (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
==24218==    by 0xA214B36: ??? (in /usr/lib/x86_64-linux-gnu/libVkLayer_MESA_device_select.so)
==24218==    by 0xA213FF3: ??? (in /usr/lib/x86_64-linux-gnu/libVkLayer_MESA_device_select.so)
==24218==    by 0x96D1BDA: ??? (in /usr/lib/x86_64-linux-gnu/libvulkan.so.1.2.131)
==24218==    by 0x96D4848: vkEnumeratePhysicalDevices (in /usr/lib/x86_64-linux-gnu/libvulkan.so.1.2.131)
==24218==    by 0x1279711: ash::vk::features::InstanceFnV1_0::enumerate_physical_devices (features.rs:650)
==24218==    by 0x120D778: ash::instance::InstanceV1_0::enumerate_physical_devices (instance.rs:406)
==24218==    by 0x122868D: <gfx_backend_vulkan::Instance as gfx_hal::Instance<gfx_backend_vulkan::Backend>>::enumerate_adapters (lib.rs:666)
==24218==    by 0xDA5A9D: wgpu_core::instance::<impl wgpu_core::hub::Global<G>>::request_adapter (instance.rs:748)
==24218==    by 0xC59209: <wgpu::backend::direct::Context as wgpu::Context>::instance_request_adapter (direct.rs:662)
==24218==    by 0xDFBCAC: wgpu::Instance::request_adapter (lib.rs:1404)
==24218==    by 0x4E6158: iced_wgpu::window::compositor::Compositor::request::{{closure}} (compositor.rs:34)
==24218==  Address 0x18 is not stack'd, malloc'd or (recently) free'd
==24218==
==24218==
==24218== Process terminating with default action of signal 11 (SIGSEGV)
==24218==  Access not within mapped region at address 0x18
==24218==    at 0x6479D75: wl_proxy_destroy (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
==24218==    by 0xA214B36: ??? (in /usr/lib/x86_64-linux-gnu/libVkLayer_MESA_device_select.so)
==24218==    by 0xA213FF3: ??? (in /usr/lib/x86_64-linux-gnu/libVkLayer_MESA_device_select.so)
==24218==    by 0x96D1BDA: ??? (in /usr/lib/x86_64-linux-gnu/libvulkan.so.1.2.131)
==24218==    by 0x96D4848: vkEnumeratePhysicalDevices (in /usr/lib/x86_64-linux-gnu/libvulkan.so.1.2.131)
==24218==    by 0x1279711: ash::vk::features::InstanceFnV1_0::enumerate_physical_devices (features.rs:650)
==24218==    by 0x120D778: ash::instance::InstanceV1_0::enumerate_physical_devices (instance.rs:406)
==24218==    by 0x122868D: <gfx_backend_vulkan::Instance as gfx_hal::Instance<gfx_backend_vulkan::Backend>>::enumerate_adapters (lib.rs:666)
==24218==    by 0xDA5A9D: wgpu_core::instance::<impl wgpu_core::hub::Global<G>>::request_adapter (instance.rs:748)
==24218==    by 0xC59209: <wgpu::backend::direct::Context as wgpu::Context>::instance_request_adapter (direct.rs:662)
==24218==    by 0xDFBCAC: wgpu::Instance::request_adapter (lib.rs:1404)
==24218==    by 0x4E6158: iced_wgpu::window::compositor::Compositor::request::{{closure}} (compositor.rs:34)
==24218==  If you believe this happened as a result of a stack
==24218==  overflow in your program's main thread (unlikely but
==24218==  possible), you can try to increase the size of the
==24218==  main thread stack using the --main-stacksize= flag.
==24218==  The main thread stack size used in this run was 8388608.
==24218==
==24218== HEAP SUMMARY:
==24218==     in use at exit: 2,691,640 bytes in 6,239 blocks
==24218==   total heap usage: 22,690 allocs, 16,451 frees, 17,723,592 bytes allocated
==24218==
==24218== LEAK SUMMARY:
==24218==    definitely lost: 0 bytes in 0 blocks
==24218==    indirectly lost: 0 bytes in 0 blocks
==24218==      possibly lost: 117,814 bytes in 1,533 blocks
==24218==    still reachable: 2,573,826 bytes in 4,706 blocks
==24218==                       of which reachable via heuristic:
==24218==                         newarray           : 1,536 bytes in 16 blocks
==24218==         suppressed: 0 bytes in 0 blocks
==24218== Rerun with --leak-check=full to see details of leaked memory
==24218==
==24218== For lists of detected and suppressed errors, rerun with: -s
==24218== ERROR SUMMARY: 4 errors from 3 contexts (suppressed: 2 from 2)
Segmentation fault

It seems to have something to do with graphics indeed. But where is the fault exactly? Where should I open an issue?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.