GSRegisterPurpleNamedPort SIGABRT in UIApplicationMain Before App Delegate Gets to Run Any Code
Asked Answered
S

8

26

We recently put an update out for one of our apps and many users told us that they could no longer run the app because it crashed on startup.

We have been able to recreate the crash by building and running the previous release build onto a device and then building and running the new build overtop of it on the same device, but the stack trace for this crash is very strange:

Thread 0 Crashed:
0   libSystem.B.dylib             0x000791d0 __kill + 8
1   libSystem.B.dylib             0x000791c0 kill + 4
2   libSystem.B.dylib             0x000791b2 raise + 10
3   libSystem.B.dylib             0x0008d6fa abort + 50
4   GraphicsServices              0x00003aa8 GSRegisterPurpleNamedPort + 172
5   GraphicsServices              0x00003d5a GSEventInitialize + 150
6   UIKit                         0x00004cd6 UIApplicationMain + 350
7   MyApp                         0x0000df5c main (main.m:14)
8   MyApp                         0x00002c84 start + 32

It appears to be crashing in the UIApplicationMain method that main calls. But it crashes before it reaches any of the methods in our app delegate. I have put breakpoints in all of the app delegate methods and none of them are reached.

In addition, this appears to be only occurring for users that are updating the app. Users that are downloading it from the app store without it already being on their iPhones are not seeing the problem.

Has anyone ever encountered a crash like this? Why would this problem only occur for updates?

Statistical answered 28/8, 2010 at 5:41 Comment(4)
FWIW: I don't have any problems with the upgrade. I'm on iOS4 (3GS) and I updated the app.Poorly
Hey Derek, Did you ever find the root cause of this issue? I'm dealing with something similar, and I'm trying to find the solution.Maenad
Seeing the same issue now (6/4/13) on iOS 6.1Asseveration
Same here, for me it started after I installed the OS X 10.8.4 update. Now when I try to debug I mostly have to start it twice to succeed.Cherida
Z
19

Is this under iOS 4.0? This type of error had been reported to occur when a process or thread from the previous install of this app has crashed and somehow hasn't been cleaned up by the OS yet or has hung up in the debugger.

Does a reboot of the iPhone after installation of the new version of the app cause this error to go away? That would be one good indication that something is stuck/corrupted in the OS from the previous install, rather than in the app bundle itself.

Zamora answered 28/8, 2010 at 6:9 Comment(8)
Yes, this appears to be happening under iOS 4.0.x. It's unlikely that the app crashed and hasn't been cleaned up on so many devices, but it could have been in the background in standby mode on many devices at the time the update occurred. After rebooting my dev device, I can no longer recreate the problem using the method I described. I'm wondering if there's anything I can do to fix the problem for our users though. I would rather not ask them to reboot their phones and/or delete it and reinstall it.Statistical
If reseting the device before or just after installing the new version of your app fixes the problem, the problem is possibly with your previous version of the app not exiting background/suspend mode properly; it's obviously too late to fix whatever serious kernel lockup that may be causing. You might want to submit the old version of your app to Apple in an OS bug report.Zamora
Worked for me as well. Thanks for the answer—I was completely stumped.Soluk
Rebooting the device worked, but does anybody know if Apple fixed/will fix this at some point? I had this still happening on iOS 4.3.3 and 4.3.5.Fairing
This doesn't work for me. I'm seeing this on iPhone Simulator.Satisfaction
If you're seeing this in the Simulator, try this solution. It worked for me.Valenevalenka
Still happening on iOS 6.1Asseveration
@Asseveration My answer provides a few more details on what I've found with this issue on iOS 5.x and 6.x. I think its an issue with iOS.Hymnology
H
6

I've been having the same issue (thankfully I caught it before submitting to the AppStore). Unlike this answer states, the issue still occurs on iOS 5.x and 6.x.

So I went into the Console and found a few messages were logged before my app crashed. First was this message:

com.apple.launchd.peruser.503[148]: (UIKitApplication:BUNDLE-ID[0x4fb5][20462]) The following job tried to hijack the service "BUNDLE-ID-1" from this job: UIKitApplication:BUNDLE-ID-1[0xac31]

The next message in the console displays immediately afterwards:

GSRegisterPurpleNamedPort Couldn't register BUNDLE ID with the bootstrap server. Error: unknown error code (1100). This generally means that another instance of this process was already running or is hung in the debugger.

The crash is caused by another almost identical process already running on the system. It sounds like an issue with iOS not the app itself. This should help clear things up. Best thing to do would probably be to tell users to quit the app, try restarting and open again.

I've also submitted a bug report to Apple detailing the issue.

EDIT: It looks as though this might have been an issue with Xcode itself. Apple has just released an update which should fix the issue (at least in the Simulator):

Mac AppStore Xcode Update

Hymnology answered 9/6, 2013 at 18:7 Comment(0)
W
3

I got this problem in a project every time i debugged it a second time. Only rebooting the device would allow me to debug once again.

This particular cause of the above stacktrace was finally solved by reinstalling iTunes.

Watthour answered 30/8, 2011 at 9:40 Comment(0)
U
1

It might be purely co incidence but when ever i debug the application release mode and than without deleting it again tries to debug it in debug mode this problem seems to happen. restarting it however does the trick .

Underthrust answered 9/9, 2011 at 9:56 Comment(0)
M
1

It seems that old app has been launched without quit completely, some handlers is still alive or registered by OS, so when you launch the new version, app crash.

I have also experienced such tough issue, how do you fix it finally? Thanks.

Mccrea answered 27/2, 2012 at 3:23 Comment(0)
G
1

No core data here. Just updated a text file in the main bundle, and all of a sudden this "purple point" fail. IOS 5.1.1, iPad, opengl app with a lot of gestural interfacing. I was real glad to find some clues here. The reset fixed it.

Gasbag answered 9/8, 2012 at 7:8 Comment(0)
B
0

It seems that happend also to me when update to 10.8.4, I guess it is an Xcode bug, I will issue a bug report. If the app is opened and I run it from Xcode, the app crashes, soetimes it restarts by itself and sometimes I need to relaunch it again.

Brandenburg answered 7/6, 2013 at 6:52 Comment(0)
A
-1

If you use Core Data in your app and changed the schema, then you will often see this issue arise. What happens is the old version of the app will have an old version of the database (sqlite presumably) and when the new version of the app starts up, it expects the new version of the database as well. This causes a crash right at startup like this.

The immediate fix for this is to delete the app and re-install it. We do this while in development. But when you are ready to push the new version, you'll need to setup a Mapping Model in order to migrate your database. There is a lot of info on data migration in the developer docs:

http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/CoreDataVersioning/Introduction/Introduction.html

Anselme answered 1/6, 2011 at 14:20 Comment(1)
No Core Data models are loaded this early in the app's lifecycle so seems extremely unlikely to be the culprit.Ligetti

© 2022 - 2024 — McMap. All rights reserved.