Re: Strange app crash

2016-01-05 Thread Jens Alfke

> On Jan 1, 2016, at 6:54 PM, SevenBits  wrote:
> 
> Setting an exception breakpoint didn’t help; the app crashes anyway, leading 
> me to believe that the problem either a) is not an uncaught exception or b) 
> it is an exception, but occurs before the ObjC runtime is initialized.

It’s not an exception in the Obj-C or C++ sense; it’s a _CPU exception_, which 
is usually called a crash. (Note "Thread 0 Crashed” at the top of the main 
thread’s backtrace.) The log also tells you that the crash is an 
EXC_BAD_ACCESS, which is triggered by accessing an invalid memory address.

Most importantly, the crash is in objc_msgSend and the log’s App-Specific Info 
section says "objc_msgSend() selector name: respondsToSelector:”. 99.9% of the 
time, a crash in objc_msgSend means a bogus Obj-C object pointer is being 
messaged; usually that’s a pointer to a dealloced object, although it could be 
a garbage pointer retrieved from an ivar of a dealloced object.

Since the caller is -[NSApplication updateWindows], it’s a pretty good bet that 
the offending pointer is to an NSWindow.

The usual tool for diagnosing calls to dealloced objects is NSZombies. You can 
turn this on in the Diagnostics tab of the Run page of the scheme editor.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread Graham Cox

> On 2 Jan 2016, at 1:26 PM, SevenBits  wrote:
> 
> here’s a screenshot from Xcode 


You can copy any text from Xcode and paste it into an email. Same for a crash 
report or log output. There’s no reason to take a screenshot and make everyone 
run around just to get a look at it (and you can’t attach images to emails on 
this list).

—Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread Roland King

> On 2 Jan 2016, at 10:54, SevenBits  wrote:
> 
> Okay, I reproduced the error. Setting an exception breakpoint didn’t help; 
> the app crashes anyway, leading me to believe that the problem either a) is 
> not an uncaught exception or b) it is an exception, but occurs before the 
> ObjC runtime is initialized.
> 
> I’ve run the app outside of Xcode and got the following crash report:
> 
> https://gist.github.com/SevenBits/dfff392c19f0332d81ef
> 

well it’s not a) because it is an uncaught exception, you can see that because 
it has the word exception all over the crash logs and it’s not been caught
and b) is meaningless

So what do you know - that it’s sending respondsToSelector() to something which 
isn’t an object. So usual things, turn on NSZombies, turn on the address 
sanitizer, whatever else you can find on that options page which looks handy. 
Address sanitizer is new, I haven’t used it, but I’ve heard wonderful things 
about it. GuardMalloc too if you like. The crash is so early you may as well 
just turn on the lot. 

I’d also try stuffing it through instruments to see if I can work out which 
bits of my code have already been run by the time it gets here. It’s unpacked 
the NIB, made windows, views too, so it’s run some stuff. 

Start with those. You could breakpoint in NSApplication updateWindows and poke 
around your threads see what else may be going on, not sure I’d go right there 
however. Would be interesting to see what selector it’s asking something 
whether it responds to. 




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread Alex Zavatone
Am I correct in assuming that it's throwing an exception before it's drawn the 
first window?

If that is the case, check your window XIB.  It's possible that you have 
something mis-wired there.  If you replace your first XIB with a placeholder, 
does the problem go away?

On Jan 1, 2016, at 9:54 PM, SevenBits wrote:

> Okay, I reproduced the error. Setting an exception breakpoint didn’t help; 
> the app crashes anyway, leading me to believe that the problem either a) is 
> not an uncaught exception or b) it is an exception, but occurs before the 
> ObjC runtime is initialized.
> 
> I’ve run the app outside of Xcode and got the following crash report:
> 
> https://gist.github.com/SevenBits/dfff392c19f0332d81ef
> 
>> On Jan 1, 2016, at 9:31 PM, Roland King  wrote:
>> 
>> 
>>> On 2 Jan 2016, at 10:26, SevenBits  wrote:
>>> 
>>> OS X.
>>> 
>>> Sorry, it’s been a frustrating process.
>>> 
>>> I’m working on gathering the other info; in the meantime, here’s a 
>>> screenshot from Xcode at the moment that crash happens: 
>>> http://i.imgur.com/i7qsNOQ.png?1
>>> 
>> 
>> Looks more like an uncaught exception showing at the top level. Do you have 
>> the breakpoint for ‘All Exceptions’ set so you can see where it is?
>> 
>> Or temporarily wrap that call in a try/catch to catch it.
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread SevenBits
Okay, I reproduced the error. Setting an exception breakpoint didn’t help; the 
app crashes anyway, leading me to believe that the problem either a) is not an 
uncaught exception or b) it is an exception, but occurs before the ObjC runtime 
is initialized.

I’ve run the app outside of Xcode and got the following crash report:

https://gist.github.com/SevenBits/dfff392c19f0332d81ef

> On Jan 1, 2016, at 9:31 PM, Roland King  wrote:
> 
> 
>> On 2 Jan 2016, at 10:26, SevenBits  wrote:
>> 
>> OS X.
>> 
>> Sorry, it’s been a frustrating process.
>> 
>> I’m working on gathering the other info; in the meantime, here’s a 
>> screenshot from Xcode at the moment that crash happens: 
>> http://i.imgur.com/i7qsNOQ.png?1
>> 
> 
> Looks more like an uncaught exception showing at the top level. Do you have 
> the breakpoint for ‘All Exceptions’ set so you can see where it is?
> 
> Or temporarily wrap that call in a try/catch to catch it.



signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread SevenBits
Okay, trying to reproduce…

> On Jan 1, 2016, at 9:31 PM, Roland King  wrote:
> 
> 
>> On 2 Jan 2016, at 10:26, SevenBits  wrote:
>> 
>> OS X.
>> 
>> Sorry, it’s been a frustrating process.
>> 
>> I’m working on gathering the other info; in the meantime, here’s a 
>> screenshot from Xcode at the moment that crash happens: 
>> http://i.imgur.com/i7qsNOQ.png?1
>> 
> 
> Looks more like an uncaught exception showing at the top level. Do you have 
> the breakpoint for ‘All Exceptions’ set so you can see where it is?
> 
> Or temporarily wrap that call in a try/catch to catch it.



signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread Roland King

> On 2 Jan 2016, at 10:26, SevenBits  wrote:
> 
> OS X.
> 
> Sorry, it’s been a frustrating process.
> 
> I’m working on gathering the other info; in the meantime, here’s a screenshot 
> from Xcode at the moment that crash happens: http://i.imgur.com/i7qsNOQ.png?1
> 

Looks more like an uncaught exception showing at the top level. Do you have the 
breakpoint for ‘All Exceptions’ set so you can see where it is? 

Or temporarily wrap that call in a try/catch to catch it. 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Fwd: Strange app crash

2016-01-01 Thread SevenBits
OS X.

Sorry, it’s been a frustrating process.

I’m working on gathering the other info; in the meantime, here’s a screenshot 
from Xcode at the moment that crash happens: http://i.imgur.com/i7qsNOQ.png?1


> Begin forwarded message:
> 
> From: SevenBits 
> Subject: Re: Strange app crash
> Date: January 1, 2016 at 9:23:52 PM EST
> To: Alex Zavatone 
> 
>> On Jan 1, 2016, at 9:18 PM, Alex Zavatone  wrote:
>> 
>> Mac OS or iOS?
>> 
>> You state there is a crash, but don't supply a crash log or tell us what 
>> type of a crash it is.
>> 
>> How do you expect us to help you?  Help us help you.
>> 
>> On Jan 1, 2016, at 9:14 PM, SevenBits wrote:
>> 
>>> Hi list,
>>> 
>>> Xcode has decided not to cooperate with me.
>>> 
>>> My latest app is crashing constantly when I launch it. It crashes 
>>> immediately, without showing any UI or starting the app delegate, so I know 
>>> that my code isn’t the cause. The app will be able to run 3 or 4 times 
>>> before this happens. This did not happen before I started accessing, and 
>>> writing to, my app’s Application Support directory.
>>> 
>>> The app is sandboxed, destined for the MAS, and is using ARC. Deleting my 
>>> app’s sandbox container fixes the problem, until it tries to write to the 
>>> Application Support directory and the cycle starts all over.
>>> 
>>> Does anyone have any pointers? Seen this before?
>>> 
>>> Thanks in advance.
>>> ___
>>> 
>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>> 
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>> 
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
>>> 
>>> This email sent to z...@mac.com
>> 
> 



signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread Roland King

> On 2 Jan 2016, at 10:14, SevenBits  wrote:
> 
> Hi list,
> 
> Xcode has decided not to cooperate with me.
> 
> My latest app is crashing constantly when I launch it. It crashes 
> immediately, without showing any UI or starting the app delegate, so I know 
> that my code isn’t the cause. The app will be able to run 3 or 4 times before 
> this happens. This did not happen before I started accessing, and writing to, 
> my app’s Application Support directory.
> 
> The app is sandboxed, destined for the MAS, and is using ARC. Deleting my 
> app’s sandbox container fixes the problem, until it tries to write to the 
> Application Support directory and the cycle starts all over.
> 
> Does anyone have any pointers? Seen this before?
> 
> Thanks in advance.
> ___

crash report? stack trace? Anything from any of the logfiles in /var/log. If 
it’s crashing it’s dumping a crash report somewhere. Without that it’s just 
guesswork. 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Strange app crash

2016-01-01 Thread Alex Zavatone
Mac OS or iOS?

You state there is a crash, but don't supply a crash log or tell us what type 
of a crash it is.

How do you expect us to help you?  Help us help you.

On Jan 1, 2016, at 9:14 PM, SevenBits wrote:

> Hi list,
> 
> Xcode has decided not to cooperate with me.
> 
> My latest app is crashing constantly when I launch it. It crashes 
> immediately, without showing any UI or starting the app delegate, so I know 
> that my code isn’t the cause. The app will be able to run 3 or 4 times before 
> this happens. This did not happen before I started accessing, and writing to, 
> my app’s Application Support directory.
> 
> The app is sandboxed, destined for the MAS, and is using ARC. Deleting my 
> app’s sandbox container fixes the problem, until it tries to write to the 
> Application Support directory and the cycle starts all over.
> 
> Does anyone have any pointers? Seen this before?
> 
> Thanks in advance.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Strange app crash

2016-01-01 Thread SevenBits
Hi list,

Xcode has decided not to cooperate with me.

My latest app is crashing constantly when I launch it. It crashes immediately, 
without showing any UI or starting the app delegate, so I know that my code 
isn’t the cause. The app will be able to run 3 or 4 times before this happens. 
This did not happen before I started accessing, and writing to, my app’s 
Application Support directory.

The app is sandboxed, destined for the MAS, and is using ARC. Deleting my app’s 
sandbox container fixes the problem, until it tries to write to the Application 
Support directory and the cycle starts all over.

Does anyone have any pointers? Seen this before?

Thanks in advance.


signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com