Bug 2424159 - rusticl sigsev in a std::string constructor
Summary: rusticl sigsev in a std::string constructor
Keywords:
Status: MODIFIED
Alias: None
Product: Fedora
Classification: Fedora
Component: mesa
Version: 43
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jocelyn Falempe
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-12-20 23:03 UTC by Jacobo Cabaleiro
Modified: 2026-01-29 17:57 UTC (History)
22 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jacobo Cabaleiro 2025-12-20 23:03:25 UTC
RustiCL seems to be crashing on a std::string constructor. 

Detected it when running a custom Darktable build, but reproduceable by simply using the `clinfo` tool.

In clinfo, the crash backtrace looks like this:
```
Thread 1 "clinfo" received signal SIGSEGV, Segmentation fault.
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<true> (this=0x7fffffffaf90, __str=0x555555 <error: Cannot access memory at address 0x555555>, __n=0) at /usr/include/c++/15/bits/basic_string.tcc:298
warning: Source file is more recent than executable.
298		this->_S_copy(_M_data(), __str, __n + _Terminated);
(gdb) bt
#0  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<true> (this=0x7fffffffaf90, __str=0x555555 <error: Cannot access memory at address 0x555555>, __n=0) at /usr/include/c++/15/bits/basic_string.tcc:298
#1  0x00007ffff76b8abf in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=0x7fffffffaf90, __str="") at /usr/include/c++/15/bits/basic_string.h:238
#2  spvtools::LinkerOptions::GetFnVarArchitecturesCsv[abi:cxx11]() const (this=<optimized out>, this=<optimized out>) at /usr/src/debug/spirv-tools-2025.4-1.fc43.x86_64/include/spirv-tools/linker.hpp:76
#3  spvtools::Link (context=..., binaries=binaries@entry=0x555555579b60, binary_sizes=binary_sizes@entry=0x555555579720, num_binaries=<optimized out>, linked_binary=linked_binary@entry=0x7fffffffb730, options=...)
    at /usr/src/debug/spirv-tools-2025.4-1.fc43.x86_64/source/link/linker.cpp:858
#4  0x00007ffff76bc671 in spvtools::Link (context=..., binaries=..., linked_binary=0x7fffffffb730, options=...) at /usr/src/debug/spirv-tools-2025.4-1.fc43.x86_64/source/link/linker.cpp:820
#5  0x00007ffee638df48 in clc_link_spirv_binaries (args=0x7fffffffb870, logger=0x7fffffffb858, out_spirv=out_spirv@entry=0x7fffffffb880) at ../src/compiler/clc/clc_helpers.cpp:1337
#6  0x00007ffee638aec5 in clc_link_spirv (args=<optimized out>, logger=<optimized out>, out_spirv=0x7fffffffb880) at ../src/compiler/clc/clc.c:146
#7  0x00007ffee5a9ed2d in mesa_rust::compiler::clc::spirv::SPIRVBin::link (spirvs=..., library=false) at ../src/gallium/frontends/rusticl/mesa/compiler/clc/spirv.rs:198
#8  0x00007ffee5a6a9ac in rusticl::core::program::Program::build (self=0x555555572020, devs=..., options=...) at ../src/gallium/frontends/rusticl/core/program.rs:580
#9  rusticl::api::program::build_program (program=0x555555572070, num_devices=<optimized out>, device_list=<optimized out>, options=<optimized out>, pfn_notify=<error reading variable: Cannot access memory at address 0x0>, user_data=<optimized out>)
    at ../src/gallium/frontends/rusticl/api/program.rs:340
#10 rusticl::api::program::clBuildProgram (program=0x555555572070, num_devices=<optimized out>, device_list=<optimized out>, options=<optimized out>, pfn_notify=..., user_data=0x0) at ../src/gallium/frontends/rusticl/api/program.rs:316
#11 0x0000555555560434 in getWGsizes (wgm_sz=1, output=<optimized out>, ret=<optimized out>, loc=0x7fffffffbba0, wgm=0x7fffffffbac8) at src/clinfo.c:2019
#12 device_info_wg (ret=0x7fffffffbbe0, loc=0x7fffffffbba0, chk=<optimized out>, output=<optimized out>) at src/clinfo.c:2076
#13 0x0000555555560c58 in printDeviceInfo (dev=dev@entry=0x555558e754e0, plist=plist@entry=0x7fffffffc260, p=p@entry=1, param_whitelist=<optimized out>, param_whitelist@entry=0x0, output=output@entry=0x7fffffffc800) at src/clinfo.c:3709
#14 0x000055555556233c in printPlatformDevices (plist=0x7fffffffc260, p=1, device=0x55555576f560, ndevs=<optimized out>, str=0x7fffffffc2b0, output=0x7fffffffc800, these_are_offline=0) at src/clinfo.c:3993
#15 0x0000555555555ecd in showDevices (plist=0x7fffffffc260, output=0x7fffffffc800) at src/clinfo.c:4051
#16 main (argc=<optimized out>, argv=<optimized out>) at src/clinfo.c:4849
``

Reproducible: Always

Steps to Reproduce:
clinfo -d 1:0       
Actual Results:
➜  ~ clinfo -d 1:0
  Platform Name                                   rusticl
  Device Name                                     AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 21.1.5, DRM 3.64, 6.17.12-300.fc43.x86_64)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 3.0 
  Device UUID                                     00000000-0b00-0000-0000-000000000000
  Driver UUID                                     414d442d-4d45-5341-2d44-525600000000
  Valid Device LUID                               No
  Device LUID                                     0000-000000000000
  Device Node Mask                                0
  Device Numeric Version                          0xc00000 (3.0.0)
  Driver Version                                  25.2.7
  Device OpenCL C Version                         OpenCL C 1.2 
  Device OpenCL C Numeric Version                 0x402000 (1.2.0)
  Device OpenCL C all versions                    OpenCL C                                                         0xc00000 (3.0.0)
                                                  OpenCL C                                                         0x402000 (1.2.0)
                                                  OpenCL C                                                         0x401000 (1.1.0)
                                                  OpenCL C                                                         0x400000 (1.0.0)
  Device OpenCL C features                        __opencl_c_integer_dot_product_input_4x8bit                      0x800000 (2.0.0)
                                                  __opencl_c_integer_dot_product_input_4x8bit_packed               0x800000 (2.0.0)
                                                  __opencl_c_int64                                                 0x400000 (1.0.0)
                                                  __opencl_c_kernel_clock_scope_device                             0x400000 (1.0.0)
                                                  __opencl_c_kernel_clock_scope_sub_group                          0x400000 (1.0.0)
                                                  __opencl_c_images                                                0x400000 (1.0.0)
                                                  __opencl_c_read_write_images                                     0x400000 (1.0.0)
                                                  __opencl_c_3d_image_writes                                       0x400000 (1.0.0)
                                                  __opencl_c_ext_image_unorm_int_2_101010                          0x400000 (1.0.0)
                                                  __opencl_c_subgroups                                             0x400000 (1.0.0)
  Latest conformance test passed                  v0000-01-01-00
  Device Type                                     GPU
  Device PCI bus info (KHR)                       PCI-E, 0000:0b:00.0
  Device Profile                                  EMBEDDED_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               84
  Max clock frequency                             2175MHz
  Device Partition                                (core)
    Max number of sub-devices                     0
    Supported partition types                     None
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             1024
  Preferred work group size multiple (device)     64
[1]    239982 segmentation fault (core dumped)  clinfo -d 1:0


Expected Results:
clinfo runs without crashing

Additional Information:
I have an AMD Radeon 79000 XT:
```
➜  ~ lspci | grep -i "vga.*navi"
0b:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M] (rev cc)
```

Comment 1 Jacobo Cabaleiro 2025-12-20 23:06:34 UTC
`clinfo` does not fail when using the ROCM platform on this same machine:

```
➜  ~ clinfo -l
Platform #0: AMD Accelerated Parallel Processing
 `-- Device #0: gfx1100
Platform #1: rusticl
 `-- Device #0: AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 21.1.5, DRM 3.64, 6.17.12-300.fc43.x86_64)
```

```
➜  ~ rpm -qf $(which clinfo)
clinfo-3.0.25.02.14-1.fc43.x86_64
``

```➜  ~ clinfo -d 0:0
  Platform Name                                   AMD Accelerated Parallel Processing
  Device Name                                     gfx1100
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 2.0 
  Driver Version                                  3649.0 (HSA1.1,LC)
  Device OpenCL C Version                         OpenCL C 2.0 
  Device Type                                     GPU
  Device Board Name (AMD)                         AMD Radeon RX 7900 XT
  Device PCI-e ID (AMD)                           0x744c
  Device Topology (AMD)                           PCI-E, 0000:0b:00.0
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               42
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                32
  SIMD instruction width (AMD)                    1
  Max clock frequency                             2175MHz
  Graphics IP (AMD)                               11.0
  Device Partition                                (core)
    Max number of sub-devices                     42
    Supported partition types                     None
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Preferred work group size (AMD)                 256
  Max work group size (AMD)                       1024
  Preferred work group size multiple (kernel)     32
  Wavefront width (AMD)                           32
  Preferred / native vector sizes                 
    char                                                 4 / 4       
    short                                                2 / 2       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 1 / 1        (cl_khr_fp16)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              21458059264 (19.98GiB)
  Global free memory (AMD)                        20758528 (19.8GiB) 20758528 (19.8GiB)
  Global memory channels (AMD)                    10
  Global memory banks per channel (AMD)           4
  Global memory bank width (AMD)                  256 bytes
  Error Correction support                        No
  Max memory allocation                           18239350368 (16.99GiB)
  Unified memory for Host and Device              No
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   Yes
    Fine-grained system sharing                   No
    Atomics                                       No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       2048 bits (256 bytes)
  Preferred alignment for atomics                 
    SVM                                           0 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Max size for global variable                    18239350368 (16.99GiB)
  Preferred total size of global vars             21458059264 (19.98GiB)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        32768 (32KiB)
  Global Memory cache line size                   128 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            134217728 pixels
    Max 1D or 2D image array size                 8192 images
    Base address alignment for 2D image buffers   256 bytes
    Pitch alignment for 2D image buffers          256 pixels
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             16384x16384x8192 pixels
    Max number of read image args                 128
    Max number of write image args                8
    Max number of read/write image args           64
  Max number of pipe args                         16
  Max active pipe reservations                    16
  Max pipe packet size                            1059481184 (1010MiB)
  Local memory type                               Local
  Local memory size                               65536 (64KiB)
  Local memory size per CU (AMD)                  65536 (64KiB)
  Local memory banks (AMD)                        32
  Max number of constant args                     8
  Max constant buffer size                        18239350368 (16.99GiB)
  Preferred constant buffer size (AMD)            16384 (16KiB)
  Max size of kernel argument                     1024
  Queue properties (on host)                      
    Out-of-order execution                        No
    Profiling                                     Yes
  Queue properties (on device)                    
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                262144 (256KiB)
    Max size                                      8388608 (8MiB)
  Max queues on device                            1
  Max events on device                            1024
  Prefer user sync for interop                    Yes
  Number of P2P devices (AMD)                     0
  Profiling timer resolution                      1ns
  Profiling timer offset since Epoch (AMD)        0ns (Thu Jan  1 01:00:00 1970)
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  No
    Number of async queues (AMD)                  8
    Max real-time compute queues (AMD)            8
    Max real-time compute units (AMD)             42
  printf() buffer size                            4194304 (4MiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics ...
``

Comment 2 Jacobo Cabaleiro 2025-12-20 23:10:07 UTC
Note that my Darktable build works perfectly fine using ROCM in this machine when run with `RUSTICL_ENABLE=0 darktable`.

Comment 3 Vincent Minder 2025-12-21 15:27:16 UTC
Recently released spirv-tools-libs-2025.4-1.fc43 broke rusticl on my system (which is also AMDGPU-based).
Downgrading to spirv-tools-libs-2025.3-4.fc43 fixed the issue. Maybe you could try?

Comment 4 Jacobo Cabaleiro 2025-12-22 08:19:12 UTC
Hi @vincent.minder . Indeed the problem is the spirv-tools pkg. Downgraded to the one you suggested and no more crash in either Darktable or clinfo:
```
➜  ~ clinfo  | echo $?      
0
```

Comment 5 José Expósito 2025-12-22 08:25:18 UTC
Pinging @jfalempe since it looks like a Vulkan SDK issue. There is a new Vulkan SDK version available that might (or not) fix this problem.

Comment 6 Vincent Minder 2025-12-22 19:54:11 UTC
Hi Jacobo. Thanks for confirming.
Here is more detail about my setup. I encountered the problem after a usual system upgrade on two machines running Fedora/KDE 43:
- 1 workstation with AMD Radeon Pro WX 5100 (Polaris 10 - gfx803)
- 1 laptop with AMD Ryzen 5 4500U integrated graphics (Vega/Renoir - gfx90c)
My custom OpenCL application started segfaulting at launch after the upgrade, with dmesg output revealing the following error (example from laptop, similar on other PC):

segfault at 3e ip 00007f7b84c8d280 sp 00007fff63136920 error 4 in libSPIRV-Tools-link.so[7280,7f7b84c86000+1e000] likely on CPU 4 (core 5, socket 0)

Downgrading spirv-tools-libs immediately fixed the issue on both systems. Hope this helps.
Regards

Comment 7 Gilles Duboscq 2026-01-05 18:34:52 UTC
I can also reproduce this and i can confirm downgrading to spirv-tools-libs-2025.3-4.fc43 fixes the issue.

This looks exactly like https://gitlab.freedesktop.org/mesa/mesa/-/issues/14080
According to this, it looks like a rebuild of the mesa package is necessary to fix ABI issues.

Comment 8 Jocelyn Falempe 2026-01-08 08:54:50 UTC
Thanks for the details.

Yes, that looks like an ABI breakage, we need to rebuild mesa with the new spirv-tools.

Comment 9 Christoph Karl 2026-01-29 15:58:23 UTC
See https://bodhi.fedoraproject.org/updates/FEDORA-2026-222c10e880
As mesa is rebuild this is also fixed now.

Comment 10 Fedora Update System 2026-01-29 16:53:55 UTC
FEDORA-2026-222c10e880 (DirectX-Headers-1.618.2-1.fc43 and mesa-25.3.4-7.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-222c10e880


Note You need to log in before you can comment on or make changes to this bug.