llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.1k stars 11.6k forks source link

clang 9.0.0 release crashes when generating LLVM IR for std::regex_search (std::_Is_word) #42749

Closed llvmbot closed 4 years ago

llvmbot commented 5 years ago
Bugzilla Link 43404
Resolution DUPLICATE
Resolved on Sep 26, 2019 04:25
Version 9.0
OS Windows NT
Attachments clang-cl diagnostic msg
Reporter LLVM Bugzilla Contributor
CC @thebrandre,@zygoloid

Extended Description

Stack dump:

  1. Program arguments: C:\PROGRA~1\LLVM\bin\clang-cl.exe -cc1 -triple x86_64-pc-windows-msvc19.22.27905 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name GCodeParser.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -mllvm -x86-asm-syntax=intel -D_DEBUG -D_MT -D_DLL --dependent-lib=msvcrtd --dependent-lib=oldnames --show-includes -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile -fdiagnostics-format msvc -gcodeview -debug-info-kind=limited -momit-leaf-frame-pointer -coverage-notes-file C:\repo\craft\build\Debug\GCodeParser.gcno -resource-dir C:\PROGRA~1\LLVM\lib\clang\9.0.0 -D _USE_MATH_DEFINES -I C:\repo\craft\src\craftSlicer -I C:\repo\craft\src\craftCommon -I C:\repo\craft\src\craftCommon..\deps -I C:\repo\craft\src\craft3d..\deps\openmesh\src -D WIN32 -D _WINDOWS -internal-isystem C:\PROGRA~1\LLVM\lib\clang\9.0.0\include -internal-isystem C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\include -internal-isystem C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include -internal-isystem C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt -O0 -Wall -fdeprecated-macro -fdebug-compilation-dir C:\repo\craft\build\Debug -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.22.27905 -std=c++17 -fno-inline -fobjc-runtime=gcc -fdiagnostics-show-option -fopenmp -faddrsig -o craftSlicer\CMakeFiles\craftSlicer.dir\gCode\parser\GCodeParser.cpp.obj -x c++ C:\repo\craft\src\craftSlicer\gCode\parser\GCodeParser.cpp
  2. parser at end of file
  3. Per-file LLVM IR generation
  4. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\regex:566:13: Generating code for declaration 'std::_Is_word'

    ​0 0x00007ff645ab524f (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x119524f)

    ​1 0x00007ff6449f32a1 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0xd32a1)

    ​2 0x00007ff6449f31cf (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0xd31cf)

    ​3 0x00007ff64619a755 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x187a755)

    ​4 0x00007ff6463eaa13 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1acaa13)

    ​5 0x00007ff6462d4fdc (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x19b4fdc)

    ​6 0x00007ff6462c68f6 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x19a68f6)

    ​7 0x00007ff6462bce58 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x199ce58)

    ​8 0x00007ff6462c51aa (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x19a51aa)

    ​9 0x00007ff6463f1b95 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1ad1b95)

    ​10 0x00007ff6463f67dd (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1ad67dd)

    ​11 0x00007ff6463e390e (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1ac390e)

    ​12 0x00007ff64639416d (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1a7416d)

    ​13 0x00007ff6463910f4 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1a710f4)

    ​14 0x00007ff646399dc0 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1a79dc0)

    ​15 0x00007ff6462b5cae (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1995cae)

    ​16 0x00007ff6462b6599 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1996599)

    ​17 0x00007ff64613cb1d (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x181cb1d)

    ​18 0x00007ff64613618c (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x181618c)

    ​19 0x00007ff64612bb45 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180bb45)

    ​20 0x00007ff64612bab8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180bab8)

    ​21 0x00007ff64612bab8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180bab8)

    ​22 0x00007ff64612bab8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180bab8)

    ​23 0x00007ff64612bab8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180bab8)

    ​24 0x00007ff64612bab8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180bab8)

    ​25 0x00007ff64612bab8 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180bab8)

    ​26 0x00007ff64612abe1 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x180abe1)

    ​27 0x00007ff647cebd75 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x33cbd75)

    ​28 0x00007ff647ce98cb (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x33c98cb)

    ​29 0x00007ff64707b4c3 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x275b4c3)

    ​30 0x00007ff6465d3492 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1cb3492)

    ​31 0x00007ff6465971cf (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1c771cf)

    ​32 0x00007ff646629c87 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x1d09c87)

    ​33 0x00007ff644926e87 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x6e87)

    ​34 0x00007ff644924564 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x4564)

    ​35 0x00007ff647cfda20 (C:\PROGRA~1\LLVM\bin\clang-cl.exe+0x33dda20)

    ​36 0x00007fffee8a7bd4 (C:\WINDOWS\System32\KERNEL32.DLL+0x17bd4)

    ​37 0x00007fffef50cee1 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6cee1)

llvmbot commented 4 years ago

I believe this is the same bug as 43175.

There is a fix for it, but it's not in 9.0.0 or the branch for a 9.0.1 release.

This bug has been marked as a duplicate of bug llvm/llvm-project#42520

36b91afb-f5cc-49ee-aa5a-982348a9b5aa commented 4 years ago

I changed the component to OpenMP because I get the same issue with std=c++14 and nailed it down to a problem with OpenMP and std::regex used together.

Note that this is a regression from 8.0.1. It works with the old clang-cl.

I'm pretty sure that this is the same issue as described by Celestin because her/his example also contains OpenMP and prints a similar error message related to std::regex.

36b91afb-f5cc-49ee-aa5a-982348a9b5aa commented 4 years ago

Error message when compiled with OpenMP (std::regex usage) Trigger the crash via: clang-cl regex.cpp -Xclang -fopenmp This runs smoothly: clang-cl regex.cpp

Both of them were working with clang-cl 8.0.0 and 8.0.1 on my system.

36b91afb-f5cc-49ee-aa5a-982348a9b5aa commented 4 years ago

Example code that triggers the bug (std::regex usage)