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

[clang-cl] Exception Code: 0xC0000005 #107113

Open
mzukovec opened this issue Sep 3, 2024 · 7 comments
Open

[clang-cl] Exception Code: 0xC0000005 #107113

mzukovec opened this issue Sep 3, 2024 · 7 comments
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well

Comments

@mzukovec
Copy link
Contributor

mzukovec commented Sep 3, 2024

I get internal compiler error during C++ compilation of OpenCascade library with clang-cl. The same codebase compiles fine using cl.exe and clang 17.1.6 on MacOS.

I tried versions 17.0.6 and 18.1.8, both crashing.

Error log:

1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'D:\_conan\p\b\openc0bd562cb918d1\b\src\BOPAlgo\BOPAlgo_WireSplitter_1.cxx'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@"?appendList@?$NCollection_List@VBOPAlgo_EdgeInfo@@@@AEAAXPEBVNCollection_ListNode@@@Z"'
Exception Code: 0xC0000005
#0 0x00007ff68742c31b (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x277c31b)
#1 0x00007ff687a98b1a (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x2de8b1a)
#2 0x00007ff686d810dd (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20d10dd)
#3 0x00007ff686ec40c6 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x22140c6)
#4 0x00007ff68506b6b9 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3bb6b9)
#5 0x00007ff686d5472e (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20a472e)
#6 0x00007ff686d75533 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20c5533)
#7 0x00007ff684ff6111 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x346111)
#8 0x00007ff684ff5bdd (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x345bdd)
#9 0x00007ff684fefa69 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x33fa69)
#10 0x00007ff686d70365 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20c0365)
#11 0x00007ff68712f1a8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x247f1a8)
#12 0x00007ff6852617e1 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5b17e1)
#13 0x00007ff685261282 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5b1282)
#14 0x00007ff68525dfb4 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5adfb4)
#15 0x00007ff68525bb30 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5abb30)
#16 0x00007ff68525a4fe (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5aa4fe)
#17 0x00007ff68606e4cd (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x13be4cd)
#18 0x00007ff6853ebc05 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x73bc05)
#19 0x00007ff6853eba08 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x73ba08)
#20 0x00007ff68509f6e8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3ef6e8)
#21 0x00007ff68509f09e (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3ef09e)
#22 0x00007ff68509ebb7 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3eebb7)
#23 0x00007ff685098a47 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3e8a47)
#24 0x00007ff6850960c3 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3e60c3)
#25 0x00007ff6871b4b70 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x2504b70)
#26 0x00007fff1add257d (C:\WINDOWS\System32\KERNEL32.DLL+0x1257d)
#27 0x00007fff1d0eaf28 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x5af28)
clang-cl: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 18.1.8
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\PROGRA~1\LLVM\bin
clang-cl: note: diagnostic msg:
********************

BOPAlgo_WireSplitter_1-153cb5.zip

@EugeneZelenko EugeneZelenko added backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well and removed new issue labels Sep 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2024

@llvm/issue-subscribers-backend-x86

Author: None (mzukovec)

I get internal compiler error during C++ compilation of OpenCascade library with `clang-cl`. The same codebase compiles fine using `cl.exe` and `clang 17.1.6` on MacOS.

I tried versions 17.0.6 and 18.1.8, both crashing.

Error log:

1.      &lt;eof&gt; parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'D:\_conan\p\b\openc0bd562cb918d1\b\src\BOPAlgo\BOPAlgo_WireSplitter_1.cxx'.
4.      Running pass 'X86 DAG-&gt;DAG Instruction Selection' on function '@"?appendList@?$NCollection_List@<!-- -->VBOPAlgo_EdgeInfo@@@@<!-- -->AEAAXPEBVNCollection_ListNode@@@<!-- -->Z"'
Exception Code: 0xC0000005
#<!-- -->0 0x00007ff68742c31b (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x277c31b)
#<!-- -->1 0x00007ff687a98b1a (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x2de8b1a)
#<!-- -->2 0x00007ff686d810dd (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20d10dd)
#<!-- -->3 0x00007ff686ec40c6 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x22140c6)
#<!-- -->4 0x00007ff68506b6b9 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3bb6b9)
#<!-- -->5 0x00007ff686d5472e (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20a472e)
#<!-- -->6 0x00007ff686d75533 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20c5533)
#<!-- -->7 0x00007ff684ff6111 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x346111)
#<!-- -->8 0x00007ff684ff5bdd (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x345bdd)
#<!-- -->9 0x00007ff684fefa69 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x33fa69)
#<!-- -->10 0x00007ff686d70365 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x20c0365)
#<!-- -->11 0x00007ff68712f1a8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x247f1a8)
#<!-- -->12 0x00007ff6852617e1 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5b17e1)
#<!-- -->13 0x00007ff685261282 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5b1282)
#<!-- -->14 0x00007ff68525dfb4 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5adfb4)
#<!-- -->15 0x00007ff68525bb30 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5abb30)
#<!-- -->16 0x00007ff68525a4fe (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x5aa4fe)
#<!-- -->17 0x00007ff68606e4cd (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x13be4cd)
#<!-- -->18 0x00007ff6853ebc05 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x73bc05)
#<!-- -->19 0x00007ff6853eba08 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x73ba08)
#<!-- -->20 0x00007ff68509f6e8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3ef6e8)
#<!-- -->21 0x00007ff68509f09e (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3ef09e)
#<!-- -->22 0x00007ff68509ebb7 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3eebb7)
#<!-- -->23 0x00007ff685098a47 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3e8a47)
#<!-- -->24 0x00007ff6850960c3 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x3e60c3)
#<!-- -->25 0x00007ff6871b4b70 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x2504b70)
#<!-- -->26 0x00007fff1add257d (C:\WINDOWS\System32\KERNEL32.DLL+0x1257d)
#<!-- -->27 0x00007fff1d0eaf28 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x5af28)
clang-cl: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 18.1.8
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\PROGRA~1\LLVM\bin
clang-cl: note: diagnostic msg:
********************

BOPAlgo_WireSplitter_1-153cb5.zip

@EugeneZelenko
Copy link
Contributor

Could you please try 19 or main branch?

@R-Goc
Copy link
Contributor

R-Goc commented Sep 3, 2024

I see you have /EHa set(turns into -fasync-exceptions and the others in the reproducible). Could you try compiling without /EHa and use a different exception handling mode? This would exclude this being #107031. Sadly the issue with /EHa is non-deterministic. I can't get master or older clang 20 to crash on your file while 18.1.8 crashes. I don't have 18.1.8 with debug info to fully confirm it on my end. Clang 17 is the first version to have the offending piece of code.

@mzukovec
Copy link
Contributor Author

mzukovec commented Sep 3, 2024

I just confirmed that the 19.1.0-rc4 version works just fine though.

The /EHa change to /EHs works fine too with older versions tested before.

@R-Goc
Copy link
Contributor

R-Goc commented Sep 3, 2024

The code responsible for the bug is in 19.1.0-rc4 as well. It just doesn't always trigger. Like master not crashing on your code. This does not mean that it won't crash on other code. Since it only affects /EHa I think we can be quite confident that this is the reason. A run with debug info would make it 100% clear, but this doesn't seem necessary.

@mzukovec
Copy link
Contributor Author

mzukovec commented Sep 3, 2024

Weird… It seems to be reproducible on version 17 and 18. I did try at least 20 times with consistemnt crashes.

@R-Goc
Copy link
Contributor

R-Goc commented Sep 3, 2024

#105813 this has more code samples. If you want to check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

No branches or pull requests

4 participants