<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Crash shell script writer doesn't escape quotes correctly"
   href="http://llvm.org/bugs/show_bug.cgi?id=15635">15635</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash shell script writer doesn't escape quotes correctly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>