• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Hard clang crash in Xcode 4.6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hard clang crash in Xcode 4.6


  • Subject: Re: Hard clang crash in Xcode 4.6
  • From: Jim Grosbach <email@hidden>
  • Date: Fri, 08 Feb 2013 11:00:20 -0800

Hi Jean-Denis,

Yep, That's definitely a clang bug. Please file a bug report at the address indicated in the diagnostic message and attach the indicated files.

Thanks!

-Jim

On Feb 8, 2013, at 9:56 AM, Jean-Daniel Dupas <email@hidden> wrote:


Le 8 févr. 2013 à 11:30, Jean-Denis Muys <email@hidden> a écrit :

Hi,

I have this build failure:

clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.1
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ 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/cv/tw4r4vx93vl4dtdtl_5869g00000gp/T/UriDispatcherLibTests-Za5OKO.mm
clang: note: diagnostic msg: /var/folders/cv/tw4r4vx93vl4dtdtl_5869g00000gp/T/UriDispatcherLibTests-Za5OKO.sh
clang: note: diagnostic msg: 

********************
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254

Which looks like a hard clang crash. Can somebody try to reproduce that crash? Here is a reduction source code (objective-C++ code):


#include <map>
#include <string>

std::string NSString2String(NSString *from)
{
    const char *cfrom = [from UTF8String];
    std::string result(cfrom);
    return result;
}

void NSDictionary2stringMap(NSDictionary *from, std::map<std::string,std::string>* to)
{
    for (auto item:from) {    // replace auto with id, to stop clang from crashing
        std::string key = NSString2String(item);
        std::string value = NSString2String(from[item]);
        (*to)[key] = value;
    }
}

The "auto" type declaration that crashes clang is a new C++11 feature, but clang seems to crash when compiling for C++98 too (instead of reporting an error).

So is this some gremlin in my machine or some actual clang bug?


This is an actual clang bug, and it is also present in nightly build (note: your test case lacks a include <Foundation/Foundation.h>):

Assertion failed: (A->isDeduced() && "Cannot request the size of a dependent type"), function getTypeInfoImpl, file clang/lib/AST/ASTContext.cpp, line 1531.
…
6  clang             0x000000010dc27aca clang::ASTContext::getTypeInfoImpl(clang::Type const*) const + 2378
7  clang             0x000000010dc27118 clang::ASTContext::getTypeInfo(clang::Type const*) const + 184
8  clang             0x000000010dc26cc2 clang::ASTContext::getPreferredTypeAlign(clang::Type const*) const + 34
9  clang             0x000000010dc26651 clang::ASTContext::getDeclAlign(clang::Decl const*, bool) const + 689
10 clang             0x000000010d43f6f6 clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(clang::VarDecl const&) + 246


-- Jean-Daniel



Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Hard clang crash in Xcode 4.6 (From: Jean-Denis Muys <email@hidden>)
 >Re: Hard clang crash in Xcode 4.6 (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: lldb equivalent of .gdbinit and future break?
  • Next by Date: Re: lldb equivalent of .gdbinit and future break?
  • Previous by thread: Re: Hard clang crash in Xcode 4.6
  • Next by thread: lldb equivalent of .gdbinit and future break?
  • Index(es):
    • Date
    • Thread