[llvm-bugs] [Bug 35325] New: clang-cl crashes when compiling incorrect code

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 15 16:51:36 PST 2017


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

            Bug ID: 35325
           Summary: clang-cl crashes when compiling incorrect code
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tusklahoma at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19426
  --> https://bugs.llvm.org/attachment.cgi?id=19426&action=edit
Auto-generated crash dump

Occasionally when compiling code in the PowerShell terminal in Visual Studio
Code clang-cl will crash instead of displaying the proper error message. I have
only been able to reproduce this crash in Visual Studio Code's PowerShell
terminal. This does not occur in an independent PowerShell session (could be a
Visual Studio Code problem?).

The code being compiled was a simple hello world program, intentionally
malformed using single quotes for the string rather than the proper double
quotes -> 'Hello, World!\n'

Attached is the crash backtrace, preprocessed source, and run script.

Platform: Windows 10 Pro x64 Version 1709 (Fall Creator's Update)
Visual Studio Code Insiders 1.19.0 x64 with
Latest Windows 64-bit LLVM SVN Build from https://llvm.org/builds/
clang-cl options: /std:c++17 /TP /Wall /WX

Steps to reproduce (though only sometimes occurs):

1) Open broken Hello World (using 'Hello, World!\n' rather than "Hello,
World!\n" in std::cout line) source in Visual Studio Code

2) Open integrated PowerShell terminal in Visual Studio Code
3) Compile hello_world with 'clang-cl.exe /std:c++17 /TP /Wall /WX
hello_world.cpp'

Expected results:
clang-cl prints out proper error message and cleanly exits as such:
.\hello_world.cpp(5,15):  error: multi-character character constant
[-Werror,-Wmultichar]
        std::cout << 'Hello, World!\n';
                     ^
.\hello_world.cpp(5,15):  error: character constant too long for its type
[-Werror]
2 errors generated.

Actual results:
clang-cl crashes printing gibberish to the console and displays bug report
notice.

-- 
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/20171116/e6fb5b5c/attachment.html>


More information about the llvm-bugs mailing list