[llvm-bugs] [Bug 33300] New: Crash when using macho with win32

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 4 06:38:32 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33300

            Bug ID: 33300
           Summary: Crash when using macho with win32
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: piotr.padlewski at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Clang crashes with this target: x86_64-pc-win32-macho. To replicate use any
c/c++ file with this target:

prazek at 0x01:~ $ cat 1.cpp 
// empty

prazek at 0x01:~ $ ~/llvm-build-release/bin/clang++ 1.cpp -o - -emit-llvm -S
-target x86_64-pc-win32-macho
clang-5.0: /home/prazek/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:479:
void clang::CodeGen::CodeGenModule::Release(): Assertion `(LangOpts.ShortWChar
|| llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) ==
Target.getWCharWidth() / 8) && "LLVM wchar_t size out of sync"' failed.
#0 0x0000000003327c14 PrintStackTraceSignalHandler(void*)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3327c14)
#1 0x0000000003327f56 SignalHandler(int)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3327f56)
#2 0x00007f02b8955390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#3 0x00007f02b74c0428 gsignal
/build/glibc-9tT8Do/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#4 0x00007f02b74c202a abort /build/glibc-9tT8Do/glibc-2.23/stdlib/abort.c:91:0
#5 0x00007f02b74b8bd7 __assert_fail_base
/build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92:0
#6 0x00007f02b74b8c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#7 0x00000000035c0c8e (/home/prazek/llvm-build-release/bin/clang-5.0+0x35c0c8e)
#8 0x0000000003b06575 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3b06575)
#9 0x0000000003b04401
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3b04401)
#10 0x000000000426ebf5 clang::ParseAST(clang::Sema&, bool, bool)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x426ebf5)
#11 0x0000000003a565a8 clang::FrontendAction::Execute()
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3a565a8)
#12 0x00000000039adeb1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x39adeb1)
#13 0x0000000003afea1d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/prazek/llvm-build-release/bin/clang-5.0+0x3afea1d)
#14 0x0000000001bce733 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/prazek/llvm-build-release/bin/clang-5.0+0x1bce733)
#15 0x0000000001bccfce main
(/home/prazek/llvm-build-release/bin/clang-5.0+0x1bccfce)
#16 0x00007f02b74ab830 __libc_start_main
/build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:325:0
#17 0x0000000001bca029 _start
(/home/prazek/llvm-build-release/bin/clang-5.0+0x1bca029)
Stack dump:
0.      Program arguments: /home/prazek/llvm-build-release/bin/clang-5.0 -cc1
-triple x86_64-pc-windows-macho -emit-llvm -disable-free -main-file-name 1.cpp
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/home/prazek/-.gcno -resource-dir
/home/prazek/llvm-build-release/lib/clang/5.0.0 -internal-isystem
/home/prazek/llvm-build-release/lib/clang/5.0.0/include -fdeprecated-macro
-fdebug-compilation-dir /home/prazek -ferror-limit 19 -fmessage-length 233
-fms-extensions -fms-compatibility -fms-compatibility-version=18 -std=c++11
-fno-threadsafe-statics -fdelayed-template-parsing -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
- -x c++ 1.cpp 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (trunk 304553)
Target: x86_64-pc-windows-macho
Thread model: posix
InstalledDir: /home/prazek/llvm-build-release/bin
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-5.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-5.0: note: diagnostic msg: /tmp/1-d953dc.cpp
clang-5.0: note: diagnostic msg: /tmp/1-d953dc.sh
clang-5.0: note: diagnostic msg:

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170604/9e3c8321/attachment.html>


More information about the llvm-bugs mailing list