Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > Projects and Hacks > iPhone > iPhone "2G" (Rev. 1) > PwnageTool

Reply
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-19-2008, 08:09 AM
Mandrake
Status: Offline
Junior Member
 
Join Date: Dec 2007
Posts: 10
Rep Power: 0
Mandrake is on a distinguished road
Lightbulb Workaround for 2.0.x stuck at apple logo after installing apps

Hi All,

I wanted to email this to someone from the iphone dev team for some feedback and discussion before posting but as I don't know how to contact them I'll post my findings to date here, and hopefully anyone else working on this problem can share their findings too.

Until Apple fixes it properly, I think I have a workaround for the infamous "Hangs on Apple Logo after installing/updating apps and needs restore" and an explanation of the root cause.

This is the problem where after a crash or restart during app install/update/uninstall the device will get stuck on the Apple (or pineapple ) boot screen and either spontaneously reboot after a while, or "freeze" requiring a two fingered reboot. On my ipod touch when this freeze occurs the display dims to half brightness and the unit is no longer pingable over wifi.

Usually you get stuck in a loop where no amount of forcibly rebooting will recover the device and you have to restore.

Here's the explanation: When the 3rd party application state changes, Springboard "regenerates the application map" which you can see clearly if you watch the system log with the iPhone Configuration Utility.

(Available here: http://www.apple.com/downloads/macos...formacosx.html )

This can take some time. The more and/or bigger applications you have installed, the longer this takes. This regeneration process happens ANY time a change to installed applications occurs.

Here's the problem - Springboard is watched by a watchdog process which is handled by configd. The location of the watchdog and it's configuration files is /System/Library/SystemConfiguration/mobilewatchdog.bundle

The watchdog constantly monitors Springboard, and if it doesn't respond at least once every 2 minutes, it is killed and forcibly restarted. If this happens approximately 4 times, the watchdog will attempt to reboot the device, but it usually just freezes the system with the half brightness apple logo.

The problem occurs when the number and/or size of applications installed causes a regeneration of the application map to take longer than 2 minutes - it becomes impossible for Sprinboard to complete the task before it is forcibly killed by the watchdog. It will try again the next time and run out of time and be killed again. Hence stuck at the boot screen until doing a restore.

It is unbelievable that Apple allowed this design flaw, yes design flaw, not bug go out into the wild and it still hasn't fixed it in 2.0.1. Clearly the watchdog arrangement was put in place before 3rd party application support, and none of the programmers considered the possibility of Springboard taking more than 2 minutes to regenerate the application map.

So, how to recover from being stuck at the apple logo without doing a full restore wiping everything ? If you have openssh installed so you can log in remotely you can fix it quite easily, as you get nearly 2 minutes of ssh access during the apple logo before the system freezes where you can log in for "emergency surgery".

If you don't have OpenSSH already installed then sorry, it's restore time...

As the device is trying to boot up but still at the apple logo, try to log in as root using ssh. You should find you are able to log in soon after the device is pingable on your wifi network, and you have a few minutes to complete the following steps in time.

For example from a mac, log in with:

ssh -l root 192.168.1.103

Where your iphone/ipods own ip address is substituted.

First we will disable the watchdog timer (by temporarily moving its files elsewhere) and then reboot:

mv /System/Library/SystemConfiguration/mobilewatchdog.bundle/ /
reboot

After a few seconds the device will start to reboot, and after approximately 3-6 minutes (depending on how many apps you have installed) you will reach the lock screen as normal, when that happens we now have to re-enable the watchdog timer, and reboot again, so again log in with ssh, and type:

mv /mobilewatchdog.bundle /System/Library/SystemConfiguration/
reboot

You should find your iphone / ipod touch will reboot normally a second time.

The reason this is a workaround is because you CAN'T leave the watchdog disabled, because as well as monitoring Springboard and killing/restarting it, the watchdog also has to periodically reset the HARDWARE watchdog, if this doesn't happen the device will spontaneously reboot. The hardware watchdog is 10 and a bit minutes, so without the watchdog installed and working your device will reboot itself every 10 minutes.

If anyone knows how to contact or draw this message to the attention of the dev team I have an idea for a simple patch that they could apply to the watchdog as part of the Pwning process (or as a Cydia package) that would for all intents and purposes solve this problem until Apple gets around to fixing it properly. Please send me a PM.

I see Firmware 2.0.2 has just come out so it is possible it has fixed this problem, but my gut feeling is that they probably haven't and I won't be trying 2.0.2 to find out until it is Pwnable

Note: This same issue is the reason why after installing apps with Cydia the system will sometimes freeze. As far as I can tell Cydia is NOT to blame - what Cydia does is tells Springboard to regenerate the application map, and it is that application map regeneration that triggers the problem - Springboard becomes unresponsive for extended periods of time, the watchdog process starts trying to kill Springboard, and all hell breaks loose...this procedure will also recover from that situation.

The reason Installer.app doesn't trigger this problem is it doesn't tell Springboard to regenerate the application map - it just kills Springboard and allows it to launch again.

Last edited by Mandrake; 08-19-2008 at 08:22 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 08-19-2008, 04:12 PM
ximon
Status: Offline
Trial Member
 
Join Date: Aug 2008
Posts: 1
Rep Power: 0
ximon is on a distinguished road
Default

Hmm, interesting.

I have been able to recover from being stuck at the Apple screen after a Cydia install by repeatedly rebooting the device whilst connected to iTunes. Plug it in and switch it on, it will sit there for a while vibrating every now and then, then it will dim to the half brightness Apple logo. When this happens force another reboot by holding home and sleep and repeat the process. It takes a couple of cycles but this usually gets me back to the lock screen after a while.

The important thing seems to be that it is plugged into iTunes, I have tried this method without and got nowhere.

Edit: This method just worked again - I was stuck on the Apple logo after installing scrobble, it took 4 or 5 boot cycles but it broke out of the loop again.

Last edited by ximon; 08-19-2008 at 04:16 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-22-2008, 11:13 AM
paultart
Status: Offline
Senior Member
 
Join Date: Jul 2007
Location: Edinburgh, Scotland
Posts: 105
Rep Power: 8
paultart is on a distinguished road
Default

Quote:
Originally Posted by ximon View Post

I have been able to recover from being stuck at the Apple screen after a Cydia install by repeatedly rebooting the device whilst connected to iTunes. Plug it in and switch it on, it will sit there for a while vibrating every now and then, then it will dim to the half brightness Apple logo. When this happens force another reboot by holding home and sleep and repeat the process. It takes a couple of cycles but this usually gets me back to the lock screen after a while.

The important thing seems to be that it is plugged into iTunes, I have tried this method without and got nowhere.

.

I tried this all night - doesn't work!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #4 (permalink)  
Old 08-23-2008, 12:14 AM
Marco60
Status: Offline
Senior Member
 
Join Date: Jan 2008
Posts: 169
Rep Power: 11
Marco60 is on a distinguished road
Default

Quote:
Originally Posted by Mandrake View Post
Hi All,
As far as I can tell Cydia is NOT to blame.
Of course is not Cydia, jailed iPhones have similar problems with AppStore apps
__________________
Pwned OOTB 1.1.1 iPhone 8 Gb
FW 2.2.1, Jailbroken, Neutered, Unlocked (on AT&T)
Mac OSX 10.5.7, iTunes 8.1.1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 08-29-2008, 01:51 AM
jberk17
Status: Offline
Junior Member
 
Join Date: Aug 2008
Posts: 1
Rep Power: 0
jberk17 is on a distinguished road
Default Thank you so much

This worked perfectly. Thank you so much. I can finally customize my phone and now I have a way to fix the apple freeze if it happens without having to restore. Thanks again. Your the man!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 08-29-2008, 03:02 AM
Mandrake
Status: Offline
Junior Member
 
Join Date: Dec 2007
Posts: 10
Rep Power: 0
Mandrake is on a distinguished road
Default

Quote:
Originally Posted by ximon View Post
Hmm, interesting.

I have been able to recover from being stuck at the Apple screen after a Cydia install by repeatedly rebooting the device whilst connected to iTunes. Plug it in and switch it on, it will sit there for a while vibrating every now and then, then it will dim to the half brightness Apple logo. When this happens force another reboot by holding home and sleep and repeat the process. It takes a couple of cycles but this usually gets me back to the lock screen after a while.

The important thing seems to be that it is plugged into iTunes, I have tried this method without and got nowhere.

Edit: This method just worked again - I was stuck on the Apple logo after installing scrobble, it took 4 or 5 boot cycles but it broke out of the loop again.
That sometimes works for me, sometimes doesn't. If you have a lot of Appstore apps installed it no longer works.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #7 (permalink)  
Old 08-29-2008, 03:03 AM
Mandrake
Status: Offline
Junior Member
 
Join Date: Dec 2007
Posts: 10
Rep Power: 0
Mandrake is on a distinguished road
Default

Quote:
Originally Posted by Marco60 View Post
Of course is not Cydia, jailed iPhones have similar problems with AppStore apps
Yeah I understand that - I was mentioning it because I've seen threads of people talking about Cydia freezing, but it's actually this problem that triggers it...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 08-29-2008, 03:09 AM
Mandrake
Status: Offline
Junior Member
 
Join Date: Dec 2007
Posts: 10
Rep Power: 0
Mandrake is on a distinguished road
Default

Quote:
Originally Posted by jberk17 View Post
This worked perfectly. Thank you so much. I can finally customize my phone and now I have a way to fix the apple freeze if it happens without having to restore. Thanks again. Your the man!!!
Glad to be of help - I've recovered my ipod touch probably close to 30 times this way successfully without having to do a restore, because I have a lot of Appstore Apps installed, some of them very big like Super Monkey Ball, I can't seem to install or uninstall apps without running into problems at least 50% of the time.

If I never add or remove apps the device is nice and stable, but trying to install an app especially via the built in Appstore application is like spinning a roulette wheel, as to whether I'll end up stuck on an Apple Logo or not.

Also I'm now running 2.0.2 - it does NOT fix this issue. From what I'm hearing it wont be fixed until 2.1 at the earliest, some time in September.

This is not really surprising as there are a whole slew of design flaws related to app install/uninstall that interact with each other to cause crashes and corruption of apps - and they really need to redesign the app install/uninstall framework to solve all the issues, it's not just a matter of fixing a couple of bugs.

I've also discovered that the freeze that occurs after Cydia installs a new app, and also the freeze that occurs when stuck on the apple logo (where the screen dims) is actually a Kernel Panic, Argh.....

Unfortunately 2.0 may as well have been called a Beta, it's that buggy, even in 2.0.2, and either Apple's Q&A department missed obvious flaws, or they were rushing right up to the wire to release on July 11th when they knew the software wasn't ready yet...

PS does anyone know how to enable verbose boot mode in 2.0 ? In 1.1.x you could just do nvram boot-args="-v" to enable verbose boot mode which would scroll kernel messages up the screen during bootup etc - this also works on a Mac, but it seems to have been disabled in 2.0 ?

Last edited by Mandrake; 08-29-2008 at 03:15 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 08-29-2008, 03:35 AM
three60guy
Status: Offline
Junior Member
 
Join Date: Apr 2008
Posts: 2
Rep Power: 0
three60guy is on a distinguished road
Default

Here is a copy of my post over at modmyifone referencing this issue:

I want to thank DaveiPhone for sharing that link above. (this tread) When I read it, the post described my problem in such precise terms it was uncanny. I have spent the last 3 days trying to resolve this. I am lucky I am retired because I have spent all of my awake hours each of the last 3 days dealing with this problem. I took this problem and escalated it a number of times with Apple Customer support level 2. Finally, I found a representative who was really tech savvy and could understand the significance of this problem.

Please understand......EVERYONE who has system 2.0 or above is affected by this problem. That is, if they have many applications and/or very large applications the problem is a very real one. No installation procedure being as careful as you want to be will solve this problem. The only option we now have is either the work around discussed in the link OR we are limited to the number of applications we can install. We also are limited by the size of the applications. So if you, like me, had 83 applications you would be doomed to eventual unsuccessful rebooting. If you had Super Monkey Ball and other large programs installed in addition to the large numbers I had, then you are doubly doomed. A user can not fix this problem. It can only be fixed either by Apple for those who do not jailbreak or by the software development team if you jailbreak your phone. But currently, as far as I know we do not have a fix for this issue.

Personally, I have not jailbroken my iPhone 3G. I have reduced the number of installed apps to 32 for now (down from 83). I have not installed Super Monkey Ball even knowing my wife will kill me once she finds out. But I also know she wants a reliable device so I know she will ultimately understand.

I have shared the above thead the link refers to with Apple and hopefully Apple will understand that this is no small issue. This affects each user currently. The tech savvy representative I spoke with understands the importance of this and is going to immediately escalate this to engineering fully describing why this is an important issue.

Thank gawd for the people here who share good knowledge. I just hope we get a fix soon. Then we can start to see the potential for the iPhone to take off. (added: currently it is painful for those of us who have purchased many apps in the app store)

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #10 (permalink)  
Old 08-29-2008, 07:33 AM
adamsweeting
Status: Offline
Member
 
Join Date: Jan 2008
Posts: 89
Rep Power: 7
adamsweeting is on a distinguished road
Default

Quote:
Originally Posted by three60guy View Post
Here is a copy of my post over at modmyifone referencing this issue:

Please understand......EVERYONE who has system 2.0 or above is affected by this problem. That is, if they have many applications and/or very large applications the problem is a very real one. No installation procedure being as careful as you want to be will solve this problem.

Cheers
Errmmm... I have never seen this issue, and I have LOADS of apps. And I mean LOADS. I have Monkey Ball, Cro-Mag rally, BeatMaker, Chess Classics (naming the biggest ones) on my iPhone and they are all well over 100Mb each.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.hackint0sh.org/f146/49782.htm
Posted By For Type Date
itunes stuck in restore loop after jailbreak - Mac Forums This thread Refback 01-14-2009 06:58 PM



All times are GMT +2. The time now is 10:04 PM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107