llvm / llvm/llvm-project

clang-cl crash

Open
#169,736 2 comments 1 reaction 0 assignees View on GitHub
crash lld:COFF
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

`clang-cl -v`
```
clang version 21.1.6
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\VisualStudio\VC\Tools\Llvm\x64\bin
```

```
1> PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
1> Stack dump:
1> 0. Program arguments: D:\\VisualStudio\\VC\\Tools\\Llvm\\x64\\bin\\lld-link.exe @D:\\TEMP\\MSBuildTemp\\tmpc1b0d3f1de7c4ebfa2304a8660d6345a.rsp
1> Exception Code: 0xC0000005
1> #0 0x00007ff6e4eb049a (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0xe5049a)
1> #1 0x00007ff6e4eade8c (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0xe4de8c)
1> #2 0x00007ff6e489247d (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x83247d)
1> #3 0x00007ff6e489034d (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x83034d)
1> #4 0x00007ff6e46e8720 (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x688720)
1> #5 0x00007ff6e46dbd5a (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x67bd5a)
1> #6 0x00007ff6e46db2ef (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x67b2ef)
1> #7 0x00007ff6e448bee0 (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x42bee0)
1> #8 0x00007ff6e448b4b3 (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x42b4b3)
1> #9 0x00007ff6e5af930c xmlLinkGetData (D:\VisualStudio\VC\Tools\Llvm\x64\bin\lld-link.exe+0x1a9930c)
1> #10 0x00007ffeaf66e8d7 (C:\WINDOWS\System32\KERNEL32.DLL+0x2e8d7)
1> #11 0x00007ffeb0c68d9c (C:\WINDOWS\SYSTEM32\ntdll.dll+0x8d9c)
```

Compiler options:
```
/EHs-c- /GR- /std:c++20 /permissive- -Wno-deprecated-declarations -msse4.2 /Zc:tlsGuards- /GS- /JMC- -Wno-unused-parameter -Wno-microsoft-enum-forward-reference -Wno-inconsistent-dllimport /clang:-fno-threadsafe-statics /clang:-fno-unwind-tables /clang:-fno-asynchronous-unwind-tables -Wno-pragma-pack -Wno-unused-local-typedef -Wno-unknown-pragmas /fp:except-
```

Linker options (exports.def) is an empty file:
```
/FORCE:MULTIPLE /MAP /ENTRY:main /DEF:exports.def
```

Unfortunately i can't reproduce this in the empty project, i assume that's it's caused by the symbol override like this:
```
void* __cdecl malloc(size_t size) {
return 0;
}

decltype(&malloc) __imp_malloc = &malloc;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.