Can't get Boost Thread pool on dual core ios device(iPhone4s, iPad2, etc) - multicore

In my IOS app, i use a thread pool(Boost Thread) to download resource images.
All build(including OTA build) except appstore build works fine.
After investigating, the appstore build can't get Boost Thread pool ONLY on dual core ios device(iPhone4s, iPad2, etc).
And it occurs only at the first time startup. After i kill and restart app, it works fine.
Could somebody help figure out why?
Can i make such assumption: Boost Thread + Dual Core + Apple post-encryption(for OTA build works fine), that have all added up, led to the problem?
Thanks

Had met the same problem. typically threadpool was not set up or Schedule() doesn't run the task and get callback subsequently.
no clue.

Related

iPhone 4 vs iPhone 5 TestFlight issue

Distributed a build through TestFlight. The ad-hoc build works fine on iPhone 5,but will open and then crash on iPhone 4 and 4s. If compiled and run through Xcode (directly to Phone with dev provisioning profile) the build runs on both iPhone 5, 4s and 4.
Has anyone ran into this?
The first thing to do debugging testflight errors (or any other, for that matter) is to get the error log, and read and understand the error message. In this case the error is:
failed to launch in time
If your app doesn't finish starting up (I believe this is essentially return from the application:DidFinishLaunchingWithOptions: method) in a certain amount of time, it's killed by the system. Either you have an infinite loop or you are trying to do way too much in that method. In this case, the app caches images in that method, which evidently is fast enough to finish in time on the iPhone 5 but not earlier ones. The solution is to queue a dispatch_async call (see Dispatch Queues) that caches the images in the background, and return quickly from the app launch method.

Test If Version update works fine

Some days back i had few problems regarding the version updates from iOS 4.0 to 6.0 . The entire database was cleaned when the new version was installed .
Is there any way I can test version update before submitting to apple ?
I tested version updates via
Hockey
AdHoc build installed via iPhone configuration utility.
Is there any other way i can test the things so i can be sure that the update will not have any problems?
You can test it via TestFlight service. It's a great tool and I use it often to test my updates.
On a fresh phone (or a phone that does not have your app on it), download the current version of the app from the App Store. Setup all the necessary data, create values in your database, etc. Then update your app in the phone via adhoc release or TestFlight. The key point is to have the most up-to-date public version of your app first.
Try out Crashlytics. It provides instant and detailed crash reports, right down the line # at which a problem occurred.
It negligible in size (a few hundred KB), but even works on release distributions! That means even if you miss a few bugs, you will be notified instantly the moment a crash occurs, rather than having to wait for the useless Apple Crash Reports to be published.
Hope that helps you out a bit.

"Watchdog has expired" when I debug app with iPhone in Xcode

From yesterday, My iphone couldnot debug any apps.
In xcode, when I choose my iPhone as the debug target, and xcode build the app, link, and run into my phone, several sencond later, the xcode finish running in my iPhone. And the console below show "Watchdog has expired. Remote device was disconnected? Debugging session terminated."
It is iPhone4s, iOS version is 5.0.1, and had jailbreaked, and update Cydia a few days ago.
It could not work on my other MBP yet.
How can I recover it?
This is because of the bug in Cydia update and Jailbreaking.
Hope this helps.
Refer to this post:
App crashes with "Watchdog has expired." message. No stack trace or crash dump
Here is tc.'s answer from that post
"Watchdog has expired." could mean anything. The way the message is
worded suggests that the "local" GDB (running on your Mac) GDB timed
out waiting for data from the "remote" GDB (running on the phone).
Alternatively, "Watchdog has expired" might be from the phone's
console output shortly before it reboots.
What does it display if you disconnect the device while your app is
running? What if you power it off? What if you issue a hard reset
(Sleep+Home for 10 seconds)?
If it's causing the device to reboot, there's something seriously
wrong happening. Your app shouldn't be able to take the phone down,
but sometimes something slips through (IIRC, UIImagePickerController
on some version of 2.x had a problem where either your app would get
killed or the phone would reboot, depending on which kicked in first).
"Large set of bitmaps" sounds like it might be causing CoreAnimation
(or IOSurface or whatever) to run out of video memory.
I would hesitate to do drawing in a background thread unless you're
very careful about thread-safety (to a first approximation,
CoreAnimation is and UIKit isn't except a few functions that were made
"thread-safe" in 4.0).
Hope this helps you.

huge size library not loading in iphone

I have ported a library (ice , NAT traversal ) for iPhone and encountering issue while actually testing it on iphone device(Version 4.3). Developed a cocoa touch wrapper which is linked with my library. The library routines get called from "test" button placed in my application.
The application is .mm and library is C++ based.
Below are the cases in which my application fails/passes
Case I: I "build and debug" / "build and run" application from Xcode for iphone. The application works fine on iphone and I am able to see logs for the same on the console on my mac machine.
Case II: I try to run application from my iphone, but it just crashes while opening.
Case III: I build and debug application from Xcode, the application get's launched. But as soon as i unplug the debug cable (attached to iphone from my mac), the application get's crashed.
The size of application is 16 MB, and size of library is 288 MB.
I tried to simulate same issue by making a simple test application and a test library. it runs fine in all cases without issues. What can be the issue?
It seems that the application is mapping library code from mac machine while running on iphone. and once the physical link is broken, the app crashes.
size of library is huge?
Thanks in advance
iOS kills apps that blocks the main thread for too long. So that may be the problem and also explains why the app doesn't get killed in debug mode.
Try running your function in the background and see if that helps!
Finally I got answer to my question! Thanks a lot Martin for pointing out "iOS kills apps that blocks the main thread for too long"
Following is the procedure i followed to find the resolve the issue:
Xcode "orgainzer"--> "Device logs" section shows iphone crash report. My application crash report was also generated in the same.
In crash report it was clearly written "mytestapp failed to launch in time" and further it showed the API which was taking too long to return the result. ( in my case it was getlocalhostname API).
I just corrected the API as per my requirement, compiled and run the app on iphone device and it worked!! Also the launch time of application is pretty less now.
Thanks again!

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

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?
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.
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):
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.
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 .
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.
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.
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.
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