llvm / llvm-project

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

definition with same mangled name as another definition #39388

Closed rubenvb closed 1 year ago

rubenvb commented 5 years ago
Bugzilla Link 40041
Version 7.0
OS Windows XP
CC @zygoloid

Extended Description

The code linked to in the following comment (using Boost.Spirit.X3, so I can't seem to compress it beyond 1.8MB) causes the following error followed by a crash:

C:\PROGRA~1\LLVM\bin\clang-cl.exe /nologo -TP -DNOMINMAX -DSKUI_DEBUG -D_CRT_SECURE_NO_WARNINGS -I\10.0.2.2\ruben\Development\skui -I\10.0.2.2\ruben\Development\skui\3rdparty\boost /DWIN32 /D_WINDOWS /W4 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 -std:c++17 /showIncludes /Focss\CMakeFiles\css.dir\grammar\color.c++.obj /Fdcss\CMakeFiles\css.dir\css.pdb -c \10.0.2.2\ruben\Development\skui\css\grammar\color.c++ In file included from \10.0.2.2\ruben\Development\skui\css\grammar\color.c++:25: In file included from \10.0.2.2\ruben\Development\skui\css/grammar/color.h++:30: In file included from \10.0.2.2\ruben\Development\skui\css/grammar/semantic_factory.h++:29: In file included from \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3.hpp:20: In file included from \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/core.hpp:14: \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/core/action.hpp(35,9): error: definition with same mangled name '??0?$action@U?$real_parser@MU?$ureal_policies@M@x3@spirit@boost@@@x3@spirit@boost@@Vlambda_1>@grammar@css@skui@@@x3@spirit@boost@@QEAA@AEBU?$real_parser@MU?$ureal_policies@M@x3@spirit@boost@@@123@V<lambda_1@grammar@css@skui@@@Z' as another definition action(Subject const& subject, Action f) ^ \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/core/action.hpp(35,9): note: previous definition is here In file included from \10.0.2.2\ruben\Development\skui\css\grammar\color.c++:25: In file included from \10.0.2.2\ruben\Development\skui\css/grammar/color.h++:30: In file included from \10.0.2.2\ruben\Development\skui\css/grammar/semantic_factory.h++:29: In file included from \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3.hpp:14: In file included from \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/auxiliary.hpp:11: In file included from \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/auxiliary/any_parser.hpp:11: \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/core/parser.hpp(54,33): error: definition with same mangled name '??$?AVlambda_1>@grammar@css@skui@@@?$parser@U?$real_parser@MU?$ureal_policies@M@x3@spirit@boost@@@x3@spirit@boost@@@x3@spirit@boost@@QEBA?AU?$action@U?$real_parser@MU?$ureal_policies@M@x3@spirit@boost@@@x3@spirit@boost@@V<lambda_1@grammar@css@skui@@@123@V@grammar@css@skui@@@Z' as another definition action<Derived, Action> operator[](Action f) const ^ \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/core/parser.hpp(54,33): note: previous definition is here \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/core/parser.hpp(54,33): error: definition with same mangled name '??$?AVlambda_1>@grammar@css@skui@@@?$parser@U?$real_parser@MU?$ureal_policies@M@x3@spirit@boost@@@x3@spirit@boost@@@x3@spirit@boost@@QEBA?AU?$action@U?$real_parser@MU?$ureal_policies@M@x3@spirit@boost@@@x3@spirit@boost@@V<lambda_1@grammar@css@skui@@@123@V@grammar@css@skui@@@Z' as another definition action<Derived, Action> operator[](Action f) const ^ \10.0.2.2\ruben\Development\skui\3rdparty\boost\boost/spirit/home/x3/core/parser.hpp(54,33): note: previous definition is here Wrote crash dump file "C:\Users\ruben\AppData\Local\Temp\clang-cl.exe-7452d7.dmp" 0x00007FF7463D3B25 (0x0000025A2B00002B 0x00007FF746936B4F 0x0000025AC76B4F60 0x000031661259B867) 0x00007FF746380FB6 (0x0000025ACD1143E0 0x0000025ACD1143D0 0x000000C462D8C310 0x0000000000000000) 0x00007FF7463854A8 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000025AC4A47D20) 0x00007FF7463852D0 (0x0000025AC4A58220 0x0000025AD2A23E88 0x0000000000000000 0x00007FF7482A8DA4) 0x00007FF74630FAD7 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000) 0x00007FF746931E1F (0x000000C462D8DB40 0x0000025AD1F5B2C0 0x000031661259A057 0x000000C462D8DA48) 0x00007FF74827FA05 (0x0000025AC4840CC0 0x00007FF74827FD15 0x000031661259BD27 0x000000C462D8DA48) 0x00007FF74827DC44 (0x0000025A00000012 0x00007FF749001603 0x0000000000000009 0x0000025A00000013) 0x00007FF747631324 (0x0000000000000000 0x0000000000000000 0x0000025AC49EB6C0 0x0000025AC49D8690) 0x00007FF746D8227D (0x0000025AC49D8690 0x0000025AC4A35E00 0x0000025AC4A23C40 0x00007FF746DDA2F9) 0x00007FF746D46847 (0x000000C462D8DE01 0x0000000000000000 0x0000000000000000 0x0000025AC4A1EF50) 0x00007FF746DDAF5C (0x0000025AC4A34270 0x00007FFA4DD22524 0x0EE603BF00000000 0x00007FFA4DD1EC14) 0x00007FF7453E6E48 (0x0000000000000000 0x0000000000000000 0x000000C462D8E720 0x000000C462D8E4D0) 0x00007FF7453E4317 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000) 0x00007FF748285780 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000) 0x00007FFA4C643034 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s) 0x00007FFA4DD73691 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s) clang-cl.exe: error: clang frontend command failed due to signal (use -v to see invocation) clang version 7.0.0 (tags/RELEASE_700/final) Target: x86_64-pc-windows-msvc Thread model: posix InstalledDir: C:\PROGRA~1\LLVM\bin clang-cl.exe: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. clang-cl.exe: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-cl.exe: note: diagnostic msg: C:\Users\ruben\AppData\Local\Temp\color-1c51ce.sh clang-cl.exe: note: diagnostic msg:


rubenvb commented 5 years ago

I couldn't upload to gist or pastebin so I put it on my cloud storage: preprocessed source cpp: https://rubenvb.stackstorage.com/s/6ydNjoKPNYb1X54 run script: https://rubenvb.stackstorage.com/s/eUSD4wqzArgd8Pi memory dump: https://rubenvb.stackstorage.com/s/2D7s8a7pIHTFhXY

All of these files were generated by Clang itself when it crashed.

If I can/need to upload somewhere else, let me know.

The symbol in question is one defined in Boost Spirit. This only seems to be an issue in the "clang-cl" version, MinGW-w64 Clang on Windows works just fine it seems.

This issue seems to be somewhat related to:

Endilll commented 1 year ago

All links are dead. @rubenvb do you still have those files around?

rubenvb commented 1 year ago

@Endilll I have just tried to rebuild the same code with LLVM/Clang 15.0.6 (installed through VS2022) and it builds fine. I'm quite sure this issue has been fixed since I reported it.