• 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
Xcode 5.x crashing reproducibly while debugging C++ template lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xcode 5.x crashing reproducibly while debugging C++ template lists


  • Subject: Xcode 5.x crashing reproducibly while debugging C++ template lists
  • From: Ulrich Frotscher <email@hidden>
  • Date: Mon, 31 Mar 2014 13:08:44 +0200

Hi,

We heavily use C++  templates including template meta programming in our projects. Starting with Xcode 5.01 we cannot debug our products in Xcode anymore because Xcode reproducibly crashes if the program stops at a breakpoint. Normally the spinning progress indicator in the variables display pane shows up and finally Xcode crashes. Debugging on the lldb command line still works.

I was able to create a simple example to reproduce the problem and also filed a bug (#16431645) at https://bugreport.apple.com

I am curious whether anybody else has seen such problems and probably knows a workaround. Currently we need to use Xcode 4 if we want to debug inside Xcode.

Here is the code snippet: compile and set a breakpoint in main. Xcode 5.* will crash if the program stops at the breakpoint.

Ulrich Frotscher

//
//  main.cpp
//  xcode5_lldb_crash
//
//  Created by Ulrich Frotscher on 3/26/14.
//  Copyright (c) 2014 callas. All rights reserved.
//

#include <iostream>

#define CRASH_XCODE_5_0
#define CRASH_XCODE_5_1

struct NullType{};

template<typename H, class T>
struct TypeList
{
  typedef H Head;
  typedef T Tail;

//  Head h;
  Tail t;
};

typedef TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int, //40
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int, //80
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int,
        TypeList< int, TypeList< int, TypeList< int, TypeList< int, //92
        TypeList< int,                                              //93
#if defined(CRASH_XCODE_5_0) || defined(CRASH_XCODE_5_1)
		TypeList< int,                                              //94 - crash on 5.1
#endif
#if defined(CRASH_XCODE_5_0)
		TypeList< int,
		TypeList< int,
		TypeList< int,
		TypeList< int,
		TypeList< int,
		TypeList< int,
		TypeList< int,
		TypeList< int,                                              //102 - crash on 5.01 and 5.02
#endif
//		TypeList< int,                                              //103
		NullType

		> > > > > > > > > >  > > > > > > > > > >  > > > > > > > > > >  > > > > > > > > > >
		> > > > > > > > > >  > > > > > > > > > >  > > > > > > > > > >  > > > > > > > > > >
		> > > > > > > > > >  > > >
#if defined(CRASH_XCODE_5_0) || defined(CRASH_XCODE_5_1)
		>
#endif
#if defined(CRASH_XCODE_5_0)
		>
		>
		>
		>
		>
		>
		>
		>
#endif
//		>
		MyList;

int main(int argc, const char * argv[])
{
	MyList list;
	// Set breakpoint here:
	std::cout << "Hello, World!\n";
	std::cout << "sizeof(MyList) = " << sizeof(list) << std::endl;
    return 0;
}

// EOF




 _______________________________________________
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


  • Prev by Date: Re: Xcode 5.1 crashing reproducibly
  • Next by Date: Xcode 5.0.2 display of Objective-C source in Japanese on an English system?
  • Previous by thread: Re: Xcode 5.1 crashing reproducibly
  • Next by thread: Xcode 5.0.2 display of Objective-C source in Japanese on an English system?
  • Index(es):
    • Date
    • Thread