slint icon indicating copy to clipboard operation
slint copied to clipboard

Clang Release builds fail at runtime

Open mccakit opened this issue 2 months ago • 6 comments

Bug Description

Clang compiled msvc binaries always fail at runtime Only MSVC libraries compile succesfully

Reproducible Code (if applicable)


Environment Details

  • Slint Version:
  • Platform/OS:
  • Programming Language:
  • Backend/Renderer:

Product Impact

No response

mccakit avatar Nov 13 '25 03:11 mccakit

What do you mean by "fail at runtime"? Is there any error, backtrace, or something?

ogoffart avatar Nov 13 '25 07:11 ogoffart

Here you go, it fails on both native windows x64 and wine

Unhandled exception: page fault on execute access to 0x0000000140000000 in 64-bit code (0x00000140000000).
Register dump:
 rip:0000000140000000 rsp:00007ffffe8af908 rbp:00007ffffe8afea0 eflags:00010246 (  R- --  I  Z- -P- )
 rax:00007ffffe8af988 rbx:00007ffffe8afa30 rcx:0000000000000000 rdx:00000000ffffffff
 rsi:00007ffffe8af988 rdi:0000000000000000  r8:0000000000001020  r9:00000000000000ac r10:00006fffffce5aa0
 r11:0000000000000000 r12:0000000000000000 r13:0000000000000000 r14:00007fffffbc3e90 r15:0000000000000000
Stack dump:
0x007ffffe8af908:  000000014000939a 0000000140c253e8
0x007ffffe8af918:  0000000100000004 00007ffffe8dba48
0x007ffffe8af928:  00007ffffe8dba48 00007ffffe8dba48
0x007ffffe8af938:  00007ffffe8afa30 0000000000000000
0x007ffffe8af948:  00007ffffe8afa20 00007fffffbc3e90
0x007ffffe8af958:  0000000140006869 00007ffffe8dba48
0x007ffffe8af968:  00000001400efd18 0000000140ba0d88
0x007ffffe8af978:  00000001400e0ec8 0000000000000001
0x007ffffe8af988:  00007ffffee81a90 0000000140c253e8
0x007ffffe8af998:  00000adb1d794a91 00007fffffbc3ea8
0x007ffffe8af9a8:  00007fffffbc3ec0 00007ffffe8aff20
0x007ffffe8af9b8:  00000001400d0d6e 00007fffffbc3e98
Backtrace:
=>0 0x00000140000000 in main (+0x0) (0x007ffffe8afea0)
  1 0x0000014000939a in main (+0x939a) (0x007ffffe8afea0)
  2 0x00000140006869 in main (+0x6869) (0x007ffffe8afea0)
  3 0x000001400d0d6e in main (+0xd0d6e) (0x007ffffe8afea0)
  4 0x000001400d1937 in main (+0xd1937) (0x007ffffe8afea0)
  5 0x000001400c7378 in main (+0xc7378) (0x007ffffe8afea0)
  6 0x000001401521dd in main (+0x1521dd) (0x007ffffe8afea0)
  7 0x000001400ff34e in main (+0xff34e) (0x007ffffe8afea0)
  8 0x0000014015219d in main (+0x15219d) (0x007ffffe8afea0)
  9 0x00000140153433 in main (+0x153433) (0x007ffffe8afea0)
  10 0x000001400ce6db in main (+0xce6db) (0x007ffffe8afea0)
  11 0x0000014001561e in main (+0x1561e) (0x007ffffe8afea0)
  12 0x000001400095ad in main (+0x95ad) (0x007ffffe8afea0)
  13 0x0000014000101b in main (+0x101b) (0x007ffffe8aff30)
  14 0x00000140b8ca30 in main (+0xb8ca30) (0x007ffffe8affa0)
  15 0x006fffffaa93d1 BaseThreadInitThunk+0x11(unknown=<internal error>, entry=<internal error>, arg=<internal error>) [/usr/src/wine-9.0~repack-4build3/dlls/kernel32/thread.c:61] in kernel32 (0x007ffffe8affa0)
  16 0x006fffffca598b in ntdll (+0x5598b) (0000000000000000)
0x00000140000000 main: pop %r10
Modules:
Module  Address                                 Debug info      Name (65 modules)
PE-Wine         79310000-        79896000       Deferred        opengl32
PE             140000000-       140e5d000       Export          main
ELF         5ea6a5260000-    5ea6a5265000       Deferred        <wine-loader>
PE-Wine     6ffff9d10000-    6ffff9dbc000       Deferred        concrt140
PE-Wine     6ffff9dd0000-    6ffffa358000       Deferred        comctl32
PE-Wine     6ffffa370000-    6ffffa395000       Deferred        dwmapi
PE-Wine     6ffffa3b0000-    6ffffa6d1000       Deferred        dwrite
PE-Wine     6ffffa6f0000-    6ffffa700000       Deferred        bcryptprimitives
PE-Wine     6ffffa710000-    6ffffa72a000       Deferred        vcruntime140
PE-Wine     6ffffa740000-    6ffffab11000       Deferred        msvcp140
PE-Wine     6ffffb090000-    6ffffb158000       Deferred        uxtheme
PE-Wine     6ffffb360000-    6ffffb3b9000       Deferred        winex11
PE-Wine     6ffffb530000-    6ffffb5ad000       Deferred        imm32
PE-Wine     6ffffb810000-    6ffffbcda000       Deferred        oleaut32
PE-Wine     6ffffc550000-    6ffffc5a3000       Deferred        shcore
PE-Wine     6ffffc5c0000-    6ffffc6d7000       Deferred        shlwapi
PE-Wine     6ffffc730000-    6ffffd4ab000       Deferred        shell32
PE-Wine     6ffffd6b0000-    6ffffd6fd000       Deferred        coml2
PE-Wine     6ffffd710000-    6ffffd999000       Deferred        rpcrt4
PE-Wine     6ffffd9b0000-    6ffffd9ee000       Deferred        win32u
PE-Wine     6ffffda00000-    6ffffda2a000       Deferred        zlib1
PE-Wine     6ffffda40000-    6ffffdfe5000       Deferred        user32
PE-Wine     6ffffe000000-    6ffffe2c9000       Deferred        gdi32
PE-Wine     6ffffe2e0000-    6ffffe475000       Deferred        combase
PE-Wine     6ffffe490000-    6ffffea06000       Deferred        ole32
PE-Wine     6ffffeae0000-    6ffffeed6000       Deferred        ucrtbase
PE-Wine     6ffffeef0000-    6ffffefad000       Deferred        sechost
PE-Wine     6ffffefc0000-    6fffff317000       Deferred        msvcrt
PE-Wine     6fffff330000-    6fffff45c000       Deferred        advapi32
PE-Wine     6fffff470000-    6fffffa6c000       Deferred        kernelbase
PE-Wine     6fffffa80000-    6fffffc38000       Dwarf-4         kernel32
PE-Wine     6fffffc50000-    6ffffffeb000       Dwarf-4         ntdll
ELF         78a201a0d000-    78a201b4d000       Deferred        opengl32.so
ELF         78a201b71000-    78a201b79000       Deferred        libxfixes.so.3
ELF         78a201b79000-    78a201b85000       Deferred        libxcursor.so.1
ELF         78a201b85000-    78a201b98000       Deferred        libxi.so.6
ELF         78a201b98000-    78a201b9d000       Deferred        libxcomposite.so.1
ELF         78a201b9d000-    78a201baa000       Deferred        libxrandr.so.2
ELF         78a201baa000-    78a201bb6000       Deferred        libxrender.so.1
ELF         78a201bb6000-    78a201bbd000       Deferred        libxxf86vm.so.1
ELF         78a201bbd000-    78a201bc2000       Deferred        libxinerama.so.1
ELF         78a201bc2000-    78a201bd1000       Deferred        libmd.so.0
ELF         78a201bd1000-    78a201be7000       Deferred        libbsd.so.0
ELF         78a201be7000-    78a201bef000       Deferred        libxdmcp.so.6
ELF         78a201bef000-    78a201bf5000       Deferred        libxau.so.6
ELF         78a201bf5000-    78a201c1e000       Deferred        libxcb.so.1
ELF         78a201c1e000-    78a201d5b000       Deferred        libx11.so.6
ELF         78a201d5b000-    78a201d6f000       Deferred        libxext.so.6
ELF         78a201d88000-    78a201d8e000       Deferred        dwrite.so
ELF         78a201d90000-    78a201e16000       Deferred        winex11.so
ELF         78a201f84000-    78a201fb0000       Deferred        libexpat.so.1
ELF         78a201fb0000-    78a202001000       Deferred        libfontconfig.so.1
ELF         78a202001000-    78a202024000       Deferred        libbrotlicommon.so.1
ELF         78a202024000-    78a20205c000       Deferred        libpng16.so.16
ELF         78a20205c000-    78a202078000       Deferred        libz.so.1
ELF         78a202078000-    78a202161000       Deferred        libm.so.6
ELF         78a202161000-    78a202300000       Deferred        win32u.so
ELF         78a202e26000-    78a202e34000       Deferred        libbrotlidec.so.1
ELF         78a202e34000-    78a202f00000       Deferred        libfreetype.so.6
ELF         78a203000000-    78a203212000       Deferred        libc.so.6
ELF         78a203218000-    78a20322c000       Deferred        libbz2.so.1.0
ELF         78a20322c000-    78a20325e000       Deferred        liblzma.so.5
ELF         78a20325e000-    78a203279000       Deferred        libunwind.so.8
ELF         78a203279000-    78a203334000       Export          ntdll.so
ELF         78a20335a000-    78a203394000       Deferred        ld-linux-x86-64.so.2
Threads:
process  tid      prio    name (all IDs are in hex)
00000020 start.exe
	00000024    0     
00000038 services.exe
	0000003c    0     
	00000040    0     wine_rpcrt4_server
	0000004c    0     wine_rpcrt4_io
	00000050    0     wine_threadpool_worker
	00000070    0     wine_rpcrt4_io
	000000a0    0     wine_rpcrt4_io
	000000b8    0     wine_rpcrt4_io
	000000cc    0     
	000000f4    0     wine_rpcrt4_io
	000000f8    0     wine_threadpool_worker
00000044 winedevice.exe
	00000048    0     
	00000054    0     
	00000058    0     wine_sechost_service
	0000005c    0     
	00000060    0     
	00000064    0     
	000000c4    0     
	000000c8    0     
00000068 winedevice.exe
	0000006c    0     
	00000074    0     
	00000078    0     wine_sechost_service
	00000084    0     
	00000088    0     
	0000008c    0     
	00000098    0     
	0000009c    0     
0000007c explorer.exe
	00000080    0     
	000000d8    0     
	000000dc    0     wine_rpcrt4_server
00000090 plugplay.exe
	00000094    0     
	000000a4    0     
	000000a8    0     wine_sechost_service
	000000ac    0     wine_rpcrt4_server
000000b0 svchost.exe
	000000b4    0     
	000000bc    0     
	000000c0    0     wine_sechost_service
000000d0 conhost.exe
	000000d4    0     
000000e4 rpcss.exe
	000000e8    0     
	000000fc    0     
	00000100    0     wine_sechost_service
	00000104    0     wine_rpcrt4_server
	00000108    0     wine_rpcrt4_server
	0000010c    0     wine_rpcrt4_io
	00000110    0     wine_threadpool_worker
000000ec (D) Z:\home\mccakit\desktop\slint-template\build\apps\main.exe
	000000f0    0 <== 
	0000011c    0     
System information:
    Wine build: wine-9.0 (Ubuntu 9.0~repack-4build3)
    Platform: x86_64 (guest: i386)
    Version: Windows 10
    Host system: Linux
    Host version: 6.8.0-87-generic

mccakit avatar Nov 13 '25 10:11 mccakit

How exactdo you compile? What is the cake invocation. And how is the environment?

ogoffart avatar Nov 13 '25 12:11 ogoffart

I compile with clang-cl + lld-link and with msvc wine as sysroot, I also tried building natively with clang-cl and got the same error.

My cross toolchain uses rust and stdlib compiled from source, native builds use rust up binary toolchain

Only cl.exe builds succeed

mccakit avatar Nov 13 '25 18:11 mccakit

We discussed this a while ago also in our chat: https://chat.slint.dev/public/pl/iqdf3z3xr3fppx1mmsjbarcawa

I could reproduce the issue, but I wasn't able to diagnose the root cause.

tronical avatar Nov 25 '25 14:11 tronical

Oh wait, I remember now. I forgot to create an issue back then I think.

Currently it is enough that the issue is posted I guess, I think eventually some of the clients will want to build with clang-cl and this will get patched.

I'll stick to mingw till then.

mccakit avatar Nov 25 '25 19:11 mccakit