Closed Quuxplusone closed 4 years ago
I'm using MSVC 19.24.28316.0 compiler.
MSVC 19.24 is known to miscompile llvm, and the cmake step should error about it, see https://github.com/llvm/llvm-project/commit/5f940220bf9438e95ffa4a627ac1591be1e1ba6e
Does it still reproduce if you use another MSVC version?
I've tested with MSVC 19.16.27035.0. The same problem:
FAILED: lib/Target/AMDGPU/R600GenDFAPacketizer.inc
cmd.exe /C "cd /D D:\libs\vcpkg\buildtrees\llvm\x86-windows-msvc141-dbg &&
D:\libs\vcpkg\buildtrees\llvm\x86-windows-msvc141-dbg\bin\llvm-tblgen.exe -gen-
dfa-packetizer -I D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-
a535e33c48/llvm/lib/Target/AMDGPU -I
D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-a535e33c48/llvm/include -I
D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-a535e33c48/llvm/lib/Target
D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-
a535e33c48/llvm/lib/Target/AMDGPU/R600.td --write-if-changed -o
lib/Target/AMDGPU/R600GenDFAPacketizer.inc -d
lib/Target/AMDGPU/R600GenDFAPacketizer.inc.d"
Stack dump:
0. Program arguments: D:\libs\vcpkg\buildtrees\llvm\x86-windows-msvc141-
dbg\bin\llvm-tblgen.exe -gen-dfa-packetizer -I
D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-a535e33c48/llvm/lib/Target/AMDGPU -
I D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-a535e33c48/llvm/include -I
D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-a535e33c48/llvm/lib/Target
D:/libs/vcpkg/buildtrees/llvm/src/c8aac023bc-
a535e33c48/llvm/lib/Target/AMDGPU/R600.td --write-if-changed -o
lib/Target/AMDGPU/R600GenDFAPacketizer.inc -d
lib/Target/AMDGPU/R600GenDFAPacketizer.inc.d
0x7A1CB020 (0x01B8EDE0 0x00000001 0xF4D705F3 0x01B8EDB0), _calloc_base() +
0x7A0 bytes(s)
0x7A1CDB3C (0x01B8EDE0 0x00000001 0x00000000 0x00000000), _free_dbg() + 0x7C
bytes(s)
0x7A1CE110 (0x01B8EDE0 0x00000006 0x01B8EBD0 0x01B8EBC4), free() + 0x20 bytes(s)
0x00918C5F (0x01B8EBD0 0x01B8EDB0 0x008FEE0D 0x01B8EE58),
llvm::SmallVectorImpl<unsigned __int64>::~SmallVectorImpl<unsigned __int64>() +
0x2F bytes(s), d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\include\llvm\adt\smallvector.h, line 336 + 0x11 byte(s)
0x00918BB0 (0x01B8EE58 0x01B8EDE0 0x00000001 0x00000004),
llvm::SmallVector<unsigned __int64,4>::~SmallVector<unsigned __int64,4>() +
0x30 bytes(s), d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\include\llvm\adt\smallvector.h, line 844 + 0x8 byte(s)
0x008FEE0D (0x01B8EBD0 0x01B8EF00 0xCCCCCCCC 0x00000001),
llvm::DfaEmitter::visitDfaState() + 0x37D bytes(s),
d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\dfaemitter.cpp, line 85 + 0x8 byte(s)
0x008FEA39 (0x01B8F158 0x00000006 0xCCCCCCCC 0xCCCCCCCC),
llvm::DfaEmitter::constructDfa() + 0xB9 bytes(s),
d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\dfaemitter.cpp, line 94 + 0x3F byte(s)
0x008FE42A (0x01B8EFA0 0x00000004 0x01B8F75C 0x01B8F448),
llvm::DfaEmitter::emit() + 0x2A bytes(s),
d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\dfaemitter.cpp, line 100
0x0093387D (0x01B8F75C 0x044D936C 0x0489FBE8 0xCCCCCC00), `anonymous
namespace'::DFAPacketizerEmitter::emitForItineraries() + 0x5DD bytes(s),
d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\dfapacketizeremitter.cpp, line 336
0x00933DD5 (0x01B8F75C 0x01B8F5B0 0xCCCCCCCC 0x044F9E08), `anonymous
namespace'::DFAPacketizerEmitter::run() + 0x205 bytes(s),
d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\dfapacketizeremitter.cpp, line 227 + 0x27 byte(s)
0x00933F22 (0x01B8F920 0x01B8F75C 0x01B8F960 0x01B8F5C0),
llvm::EmitDFAPacketizer() + 0x52 bytes(s),
d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\dfapacketizeremitter.cpp, line 360 + 0x17 byte(s)
0x00BA4485 (0x01B8F75C 0x01B8F920 0x01B8F9A4 0x005CD332), `anonymous
namespace'::LLVMTableGenMain() + 0x165 bytes(s),
d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\tablegen.cpp, line 179 + 0xD byte(s)
0x00D6F427 (0x01D0900C 0x00BA4320 0x005CD332 0xCCCCCCCC), llvm::TableGenMain()
+ 0x237 bytes(s), d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\lib\tablegen\main.cpp, line 108 + 0x10 byte(s)
0x00BA4997 (0x0000000E 0x01D08FD0 0x01D09E90 0x01B8FA14), main() + 0x87
bytes(s), d:\libs\vcpkg\buildtrees\llvm\src\c8aac023bc-
a535e33c48\llvm\utils\tablegen\tablegen.cpp, line 263 + 0x19 byte(s)
0x00DE971E (0x7CBEAE6F 0x005CD332 0x005CD332 0x010D6000), invoke_main() + 0x1E
bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line
78 + 0x1B byte(s)
0x00DE95B7 (0x01B8FA24 0x00DE9798 0x01B8FA34 0x747C6359),
__scrt_common_main_seh() + 0x157 bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line
288 + 0x5 byte(s)
0x00DE944D (0x01B8FA34 0x747C6359 0x010D6000 0x747C6340), __scrt_common_main()
+ 0xD bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line
331
0x00DE9798 (0x010D6000 0x747C6340 0x01B8FA90 0x76F27B74), mainCRTStartup() +
0x8 bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp, line 17
0x747C6359 (0x010D6000 0xBEA72DD8 0x00000000 0x00000000), BaseThreadInitThunk()
+ 0x19 bytes(s)
0x76F27B74 (0xFFFFFFFF 0x76F48EF7 0x00000000 0x00000000),
RtlGetAppContainerNamedObjectPath() + 0xE4 bytes(s)
0x76F27B44 (0x005CD332 0x010D6000 0x00000000 0x00000000),
RtlGetAppContainerNamedObjectPath() + 0xB4 bytes(s)
Information about compilers from CMake log:
-- The C compiler identification is MSVC 19.16.27035.0
-- The CXX compiler identification is MSVC 19.16.27035.0
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files (x86)/Microsoft Visual
Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x86/cl.exe --
works
Can you share the full cmake invocation and build command?
Attached build.log
(652720 bytes, text/plain): Build log
Thank you! Using VS 2017 (19.12.25834) for x86, I can reproduce the crash like this:
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS="llvm" ..\llvm && ninja lib/Target/AMDGPU/R600GenDFAPacketizer.inc
(When targeting x64, it doesn't crash. It also doesn't crash for Release builds.)
I also tried 19.23.28105.4 (VS 2019) for x86, and 19.25.28610.4 (VS 2019 preview) and they both crash.
Bisection points to this:
---
commit 12092a9691a991a0953512451af0d1421ab4d5dc
Author: James Molloy <jmolloy@google.com>
Date: Thu Oct 17 08:34:29 2019 +0000
[DFAPacketizer] Use DFAEmitter. NFC.
Summary:
This is a NFC change that removes the NFA->DFA construction and emission logic from DFAPacketizerEmitter and instead uses the generic DFAEmitter logic. This allows DFAPacketizer to use the Automaton class from Support and remove a bunch of logic there too.
After this patch, DFAPacketizer is mostly logic for grepping Itineraries and collecting functional units, with no state machine logic. This will allow us to modernize by removing the 16-functional-unit limit and supporting non-itinerary functional units. This is all for followup patches.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68992
llvm-svn: 375086
---
Should be fixed by edae4be8e21c5deb9a8ffc24a8c17e70b878bf39 (2905a48c8790b530709305e984451ddab268c8e4 on the 10.x branch).
Please re-open if there is still a problem.
build.log
(652720 bytes, text/plain)