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

LLVM assertion wrt. debuginfos and optimizing/inlining #1989

Open
MrSmith33 opened this issue Jan 30, 2017 · 4 comments
Open

LLVM assertion wrt. debuginfos and optimizing/inlining #1989

MrSmith33 opened this issue Jan 30, 2017 · 4 comments

Comments

@MrSmith33
Copy link
Contributor

MrSmith33 commented Jan 30, 2017

In master 3025.

Happens only in release-debug build

Assertion failed: (!Node || ResNo < Node->getNumValues()) && "Invalid result number for the given node!", file C:\LDC\llvm\include\llvm/CodeGen/SelectionDAGNodes.h, line 864

Wrote crash dump file "C:\Users\andrey\AppData\Local\Temp\ldc2.exe-dcf85a.dmp"

Assertion failed: (!Node || ResNo < Node->getNumValues()) && "Invalid result number for the given node!", file C:\LDC\llvm\include\llvm/CodeGen/SelectionDAGNodes.h, line 864

Wrote crash dump file "C:\Users\andrey\AppData\Local\Temp\ldc2.exe-dcf85a.dmp"

0x0000000001CD4D45 (0x0000000000000301 0x000000000297E4AE 0x0000000000000360 0x0000000001019594)
0x0000000001074A68 (0x0000000000000301 0x0000000000000000 0x0000000000000000 0x00000000008BE580), raise() + 0x1E8 bytes(s)
0x0000000001075A31 (0x0000000000000003 0x0000000000000003 0x0000000002B7DD40 0x0000000002A90680), abort() + 0x31 bytes(s)
0x0000000001077A81 (0x0000000000000360 0x0000000002B7DD40 0x000000000E839998 0x00000000008BE818), _get_wide_winmain_command_line() + 0x1171 bytes(s)
0x0000000001077D8F (0x0000000025043260 0x00000000008BE6F0 0x000000002466E7A0 0x0000000000000020), _wassert() + 0x3F bytes(s)
0x000000000297E4AE (0x00000000008BE818 0x0000000024C00A20 0x00000000223D1B00 0x0000000021404830)
0x0000000002905740 (0x0000000023E06150 0x00000000008BECF0 0x0000000023E06150 0x000000001EAA93A0)
0x00000000027F6422 (0x00000000215EDE38 0x0000000023E06150 0x00000000008BEEE8 0x0000000000000001)
0x00000000027FB07C (0x0000000000000001 0x00000000008BEE80 0x0000000021404500 0x00000000214044F0)
0x00000000027FAE88 (0x0000000023E06150 0x0000000021624928 0x0000000000000000 0x0000000023E06100)
0x0000000002803F87 (0x000000001A698690 0x000000001A3CC330 0x0000000024793EB0 0x0000000000000005)
0x00000000024E7D84 (0x0000000024793EB0 0x0000000023E06150 0x000000002289FF68 0x00000000019247A7)
0x000000000188A3F8 (0x000000001A698590 0x0000000023E06150 0x0000000021624928 0x0000000000000000)
0x00000000019267DF (0x000000001A698590 0x000000001025A701 0x00000000105BC360 0x0000000002A4F818)
0x000000000192693F (0x00000000105BC478 0x0000000000000001 0x000000001025A7F0 0x000000001A698590)
0x0000000001926C03 (0x0000000000000003 0x00000000105BC3A0 0x0000000000000000 0x0000000000000009)
0x0000000001926243 (0x000000000317D410 0x00000000105BC3A0 0x00000000008BF400 0x0000000000000000)
0x000000000159BC2F (0x0000000000B79610 0x00000000008BF429 0x0000000000000000 0x00000000105BC3A0)
0x000000000159DF9A (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x00000000242F9CA0)
0x000000000159DD2C (0x00000000008BF7E0 0x00000000008BF730 0x00000000242F9CA0 0x00000000008BF7E0)
0x00000000015423D6 (0x0000000000B79610 0x00000000008BF890 0x0000000000B79610 0x00000000008BF7E0)
0x00000000015415C0 (0x0000000000000000 0x0000000000000000 0x000000000000008F 0x00000000008BF940)
0x0000000001504A18 (0x0000000000000000 0x00000000000004C9 0x000000000000008F 0x00000000770D3448)
0x00000000013EC1F7 (0x0000000000B802E0 0x00000000008BFAD0 0x0000000000000000 0x0000000003610A20)
0x0000000001505113 (0x00000000008BFB90 0x00000000008BFB00 0x0000000000000000 0x00000000008BFC98)
0x0000000001464EE1 (0x00000000008BFC70 0x0000000000000002 0x0000000003448D60 0x0000000000000000)
0x0000000001493705 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x01D27B127494C11A)
0x0000000002688289 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000)
0x0000000076E7652D (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0xD bytes(s)
0x00000000770AC541 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)

ldc2.exe-dcf85a.dmp.txt
Remove .txt from file name

@kinke
Copy link
Member

kinke commented Jan 30, 2017

Thanks for the report, but I didn't have any success last time I played around with one of those minidumps. A testcase would be much more preferrable. And what exactly do you mean by 'release-debug' build? Something like -O -release -g? Please clarify.

@MrSmith33
Copy link
Contributor Author

release-debug switch in dub

@MrSmith33
Copy link
Contributor Author

MrSmith33 commented Jan 30, 2017

To reproduce:

git clone --recursive https://github.com/MrSmith33/voxelman
cd voxelman/tools/launcher
dub build --build=release-debug --compiler=ldc2

Just checked, dmd fails here with following error:

..\..\plugins\voxelman\world\mesh\sidemeshers\utils.d(147,6): Error: function voxelman.world.mesh.sidemeshers.utils.meshColoredQuad!(true, ubyte).meshColoredQuad cannot inline function
..\..\plugins\voxelman\world\mesh\sidemeshers\utils.d(147,6): Error: function voxelman.world.mesh.sidemeshers.utils.meshColoredQuad!(false, ubyte).meshColoredQuad cannot inline function
..\..\plugins\voxelman\world\mesh\meshgenerator.d(29,6): Error: function voxelman.world.mesh.meshgenerator.genGeometry cannot inline function

@kinke
Copy link
Member

kinke commented Mar 29, 2017

Reproducible on Win64 with current voxelman src, current LDC master and LLVM 4.0. May be an LLVM bug, potentially caused by weird debuginfo emission on the LDC side. Call stack (RelWithDebInfo) with LLVM symbols:

#6 0x00007ff6d590a233 llvm::InstrEmitter::EmitDbgValue(class llvm::SDDbgValue *,class llvm::DenseMap<class llvm::SDValue,unsigned int,struct llvm::DenseMapInfo<class llvm::SDValue>,struct llvm::detail::DenseMapPair<class llvm::SDValue,unsigned int> > &) c:\ldc\llvm\lib\codegen\selectiondag\instremitter.cpp:697:0
#7 0x00007ff6d589ce81 llvm::ScheduleDAGSDNodes::EmitSchedule(class llvm::MachineInstrBundleIterator<class llvm::MachineInstr,0> &) c:\ldc\llvm\lib\codegen\selectiondag\scheduledagsdnodes.cpp:812:0
#8 0x00007ff6d57bb849 llvm::SelectionDAGISel::CodeGenAndEmitDAG(void) c:\ldc\llvm\lib\codegen\selectiondag\selectiondagisel.cpp:890:0
#9 0x00007ff6d57c0a1f llvm::SelectionDAGISel::SelectBasicBlock(class llvm::ilist_iterator<struct llvm::ilist_detail::node_options<class llvm::Instruction,1,0,void>,0,1>,class llvm::ilist_iterator<struct llvm::ilist_detail::node_options<class llvm::Instruction,1,0,void>,0,1>,bool &) c:\ldc\llvm\lib\codegen\selectiondag\selectiondagisel.cpp:684:0
#10 0x00007ff6d57c07e9 llvm::SelectionDAGISel::SelectAllBasicBlocks(class llvm::Function const &) c:\ldc\llvm\lib\codegen\selectiondag\selectiondagisel.cpp:1561:0
#11 0x00007ff6d57ca0f9 llvm::SelectionDAGISel::runOnMachineFunction(class llvm::MachineFunction &) c:\ldc\llvm\lib\codegen\selectiondag\selectiondagisel.cpp:509:0
#12 0x00007ff6d54249b4 `anonymous namespace'::X86DAGToDAGISel::runOnMachineFunction c:\ldc\llvm\lib\target\x86\x86iseldagtodag.cpp:177:0
#13 0x00007ff6d4d2a849 llvm::MachineFunctionPass::runOnFunction(class llvm::Function &) c:\ldc\llvm\lib\codegen\machinefunctionpass.cpp:64:0
#14 0x00007ff6d4dd38ff llvm::FPPassManager::runOnFunction(class llvm::Function &) c:\ldc\llvm\lib\ir\legacypassmanager.cpp:1513:0
#15 0x00007ff6d4dd3a87 llvm::FPPassManager::runOnModule(class llvm::Module &) c:\ldc\llvm\lib\ir\legacypassmanager.cpp:1533:0
#16 0x00007ff6d4dd3d43 `anonymous namespace'::MPPassManager::runOnModule c:\ldc\llvm\lib\ir\legacypassmanager.cpp:1590:0
#17 0x00007ff6d4dd32d3 llvm::legacy::PassManagerImpl::run(class llvm::Module &) c:\ldc\llvm\lib\ir\legacypassmanager.cpp:1694:0
#18 0x00007ff6d4956f44 codegenModule c:\ldc\ldc\driver\toobj.cpp:115:0
#19 0x00007ff6d4959c57 `anonymous namespace'::writeObjectFile c:\ldc\ldc\driver\toobj.cpp:373:0
#20 0x00007ff6d4959a1c writeModule(class llvm::Module *,char const *) c:\ldc\ldc\driver\toobj.cpp:556:0
#21 0x00007ff6d48f5ab6 ldc::CodeGenerator::writeAndFreeLLModule(char const *) c:\ldc\ldc\driver\codegenerator.cpp:192:0
#22 0x00007ff6d48f5685 ldc::CodeGenerator::finishLLModule(class Module *) c:\ldc\ldc\driver\codegenerator.cpp:170:0
#23 0x00007ff6d48f4f81 ldc::CodeGenerator::emit(class Module *) c:\ldc\ldc\driver\codegenerator.cpp:263:0
#24 0x00007ff6d48afdb0 codegenModules(struct Array<class Module *> &) c:\ldc\ldc\driver\main.cpp:1059:0
#25 0x00007ff6d477ddf9 mars_mainBody(struct Array<char const *> &,struct Array<char const *> &) C:\LDC\ldc\ddmd\mars.d:1709:0
#26 0x00007ff6d48b03e9 cppmain(int,char * *) c:\ldc\ldc\driver\main.cpp:1031:0
#27 0x00007ff6d4807182 _Dmain C:\LDC\ldc\driver\main.d:36:0

The command line length is 6K... ;)

@kinke kinke changed the title Assert in SelectionDAGNodes.h, line 864 LLVM assertion wrt. debuginfos and optimizing/inlining Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants