[LLVMbugs] [Bug 15635] New: Crash shell script writer doesn't escape quotes correctly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 1 11:20:13 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15635

            Bug ID: 15635
           Summary: Crash shell script writer doesn't escape quotes
                    correctly
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

If you pass a command-lien flag that contains escaped quotes, the .sh script
written on crash time won't execute correctly:

thakis$ cat test.cc
#pragma clang __debug parser_crash
thakis$ ~/src/llvm-svn/Release+Asserts/bin/clang -c test.cc -D
'WEBCORE_NAVIGATOR_VENDOR="Google Inc.\"'
0  clang             0x00000001106bfbf8 llvm::sys::PrintStackTrace(__sFILE*) +
40
1  clang             0x00000001106c0154 SignalHandler(int) + 548
2  libsystem_c.dylib 0x00007fff87fa194a _sigtramp + 26
3  clang             0x000000011087c41f NaNL + 6320
4  clang             0x000000010f1a9e20
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) + 576
5  clang             0x000000010f1a16e4
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 612
6  clang             0x000000010f207be6
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 694
7  clang             0x000000010f207639
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 361
8  clang             0x000000010f206b4c
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 3020
9  clang             0x000000010f205f04
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 308
10 clang             0x000000010f1932b1 clang::ParseAST(clang::Sema&, bool,
bool) + 257
11 clang             0x000000010f151bd7 clang::CodeGenAction::ExecuteAction() +
215
12 clang             0x000000010ef22457 clang::FrontendAction::Execute() + 119
13 clang             0x000000010eefe70d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 957
14 clang             0x000000010eec718a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3690
15 clang             0x000000010eebe330 cc1_main(char const**, char const**,
char const*, void*) + 816
16 clang             0x000000010eec44a9 main + 7049
17 libdyld.dylib     0x00007fff81ba07e1 start + 0
Stack dump:
0.    Program arguments:
/Volumes/MacintoshHD2/src/llvm-svn/Release+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -main-file-name
test.cc -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -target-linker-version 136 -coverage-file
/Users/thakis/src/chrome-git/src/test.o -resource-dir
/Volumes/MacintoshHD2/src/llvm-svn/Release+Asserts/bin/../lib/clang/3.3 -D
WEBCORE_NAVIGATOR_VENDOR="Google Inc.\"" -fdeprecated-macro
-fdebug-compilation-dir /Users/thakis/src/chrome-git/src -ferror-limit 19
-fmessage-length 302 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fencode-extended-block-signature
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o test.o -x c++ test.cc 
1.    <unknown> parser at unknown location
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (trunk 178474)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
clang: 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: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg:
/var/folders/00/0d5yr000h01000cxqpysvccm001mqv/T/test-HimD0k.cpp
clang: note: diagnostic msg:
/var/folders/00/0d5yr000h01000cxqpysvccm001mqv/T/test-HimD0k.sh
clang: note: diagnostic msg: 

********************

thakis$ chmod +x 
/var/folders/00/0d5yr000h01000cxqpysvccm001mqv/T/test-HimD0k.sh
thakis$  /var/folders/00/0d5yr000h01000cxqpysvccm001mqv/T/test-HimD0k.sh
error: error reading 'Inc.\"'
error: error reading 'test-HimD0k.cpp'
2 errors generated.

-- 
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/20130401/02b74824/attachment.html>


More information about the llvm-bugs mailing list