You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why does Safari hang in OS X Lion?

Hi. A restart after installing Lion got Mail and Twitter going. Not Safari though: it starts to load pages then hangs. I've had to switch to Firefox. Any ideas?
thanks,

Aidan

Macbook Pro 320GB 4gb RAM, Mac OS X (10.7)

Posted on Jul 20, 2011 11:16 AM

Reply
132 replies

Feb 21, 2012 3:50 AM in response to Aidan Byrne

Hello everyone,


Here's the situation I had:

  • When at home, with Airport Express, no problems of connecting and using the internet and whatever programs whatsoever;
  • In friends place where Wifi is NOT Apple product, same, works fine;
  • I arrive at my University: impossible to connect, Safari would hangup by bouncing for a while in the Dock, then simply never showing up;
  • As I cannot log in (please see the excellent description of nicoladie for this matter), no access for other software either (Mail, Address Book, iCal, etc.);
  • Only Firefox would be able to start and be the access to the Internet (Mail, Address Book, iCal, etc. would still not work, worse, they would hang, like Mail);
  • First I thought that this situation was due to 10.7.2, since previous versions did not present the problem, but the problem persists with 10.7.3, althoug I found a workaround (see herebelow).



Here's how I "solved" the problem, but it is not straightforward:

  1. Turn off Wifi and BT (not sure that turning off BT is necessary, but anyway I did it);
  2. Shut down the computer;
  3. Reset PRAM (optional);
    1. Start the computer;
    2. Immediately after, press simultaneously the followin four keys ⌘-⌥-P-R (that's Command, Option, P and R);
    3. Keep keys depressed until the computer restarts and the start chime sounds again;
    4. Release keys and wait until computer starts;
    5. (some settings might have to be reset like date & time, volume strength, screen luminosity, etc.).
  4. Login (for those who set a login);
  5. Start Safari (I have version 5.1.3 - 7534.53.10);

    wait until it is fully running and shows a page like it cannot connect to the internet,

  6. Turn Wifi on;
  7. Works for me.


I'm not sure whether it will work for everyone. It works for me, and I hope it will help at least some of you folks.


Best regards,

Peter 🙂


++++

Feb 29, 2012 12:00 PM in response to Peter Deli

I think turning off the "Stealth mode" in your Firewall may fix the problem.


Resetting the PRAM doesn't really work.


What I think the problem could very well be caused by "Stealth mode" being turned on, causing the wi-fi ISP fail to detect a response from your computer (as if your wi-fi connection never existed under stealth mode).


That caused Lion/Safari to keep waiting for the wi-fi connection handshake to be established, but never got a response from the ISP (because the ISP would not know you existed in stealth).


This causes the classic "deadlock" when your Mac waits for the wi-fi ISP to respond, and the wi-fi ISP never knew you existed, so both sit there and wait forever.


Because Lion's Airport's auto-join algorithm failed to detect the wi-fi probe from the ISP, it never popup the auto-join dialog window to ask you to authenticate as a user to release the IP address to connect with the internet. (That is why it works for other wi-fi connections that does not ask for authentication, and it works for the WEP and WPA authentication even with stealth mode on.)


I think that is why not only Safari, but also any Apple-made apps that uses the internet to connect, including iCloud and Mail, will also hang just like Safari.


The reason why Firefox works, I think is because Firefox (a pre-Lion app) does not wait for Airport to trigger the Auto-join dialog-window , and went ahead to probe the wi-fi ISP connection explicitly, thus bypassing the stealth mode, and get a response from the ISP.


But since all Apple-made apps are Lion-compatible, and rely on Auto-join to establish the wi-fi connection, if you are in stealth mode, auto-join fails.


In fact, if you put your computer to sleep or inactive for awhile, the wi-fi ISP will time-out, which cut off your IP connection. When you wake up, Lion still assumes you were connected to the deactivated IP, without asking for a new connection, that is when it hangs again too – not just during your initial connection, but also any subsequent timed-out connections.

Feb 29, 2012 1:38 PM in response to nicoladie

Hello nicoladie,


Nope, that's not the one. Never had Stealth mode on (just checked it again and I confirm this). However, tomorrow I will try a connection without any firewall just to see how it behaves and revert.


As a matter of fact, I really have the impression that these connection problems started since 10.7.2. I did not have, as far as I can remember, any problems with earlier version (10.7.1, 10.7.0 and Snow Leopard). I wanted to reinstall from scratch the computer and check this fact, but it is highly time consuming and I don't really have the time for that... Maybe I'll do it, who knows.



Anyway, thanks for your reply.


Regards,

Peter 🙂


++++

Feb 29, 2012 6:02 PM in response to Peter Deli

Yes, it is true that Safari still hangs with Stealth mode turned off. But at least Safari browser window will attempt to redirect to the wi-fi ISP authentication page (even though it hangs there forever). When Stealth mode is on, it never even get to redirect to that authentication page.


It never hangs when I connect to my wi-fi at home because it saved my wi-fi password in Airport. But it always hangs when I connect to a wi-fi that redirects to the ISP authentication page. Even when you successfully logged in using Firefox and established the wi-fi connection, Safari still hangs. In fact, it hangs iCloud, iCal, Mail, even AirDrop, and Finder, for that matter. The only way to clear that is to reboot after establishing wi-fi connection using Firefox previously.


The error log shows Airport failed to make the new connection via Auto-join when it found the connection had already associated (to the stale connection). That is why.


Yes, it is true that I never experience this problem prior to 10.7.2 or 10.6.8 either.

Mar 1, 2012 8:10 PM in response to davemacb

You may have to give up on Safari and use Firefox to avoid the hanging problem until Apple fixes it.


I think it probably may have something to do with Macbook Pro, because I have identical setting on both my MBP and my iMac, it is always my MBP that causes the Safari hanging problem. And it always have problems with the wi-fi connection that requires redirection from the ISP to get an authentication that caused the problem. On my iMac, it can detect auto-join or redirection without any problem. But it is always my MBP that does not detect the redirection to the ISP website for authentication that causes Safari (or any Apple app that attempts to make connection to the internet, such as iCloud) to hang, and subsequently hanging Finder also, unless you reboot it.

Mar 2, 2012 2:55 AM in response to nicoladie

Thanks Nicoladie. The suggestion to switch away from safari is a common one and I think I finally will! It's a sad state of affairs though isn't it? I switched from PC because it was so unreliable and made up of 3rd party software. Apple is now heading in the same direction imho and it's about time they wiped the greed out of their eyes and concentrated on the product! Do we really need a new iphone, ipod, imac, apple tv, operating system, macbook air, MBP etc etc every calendar year?? I've got to apply for that job again now and explain why I am reapplying!!!

Mar 5, 2012 2:12 AM in response to Peter Deli

Hello All,


A quick message just to do the follow-up on what I wrote I would do: namely try to connect without the Firewall on...


Well, sadly, it worked!!! I write "sadly", because I think I should be able to log into a network, and from there to the Internet, without having to turn off the sacred Firewall!!!


Anyway, I turned it back on after having connected and everything works too (I'm writing right now on a network I could not access with Safari and all the seemingly dependent software such as iTunes, Mail, iCal, Address Book, etc. All needed Safari to connect in order to follow suit, those software would not connect even though Firefox would happily connect).


So, here's what I did:

  • turn off the firewall;
  • restart the computer;
  • log in normally;
    • BTW: my account IS NOT administrator, but Standard and I DON'T want to raise my account to Admin;
    • I have an Admin account that I use when needed (in other words VERY rarely);
  • Started Safari;
  • Connected to the internet;
  • Launched System Preferences and turned back on the Firewall;
  • Launched my usual iTunes, Mail and other network requiring apps, they ALL worked WITHOUT hanging!


Now I'm happy. Let's hope this situation lasts. I will obviously keep the community informed of any evolution of the situation.


Take care,

Peter 🙂


++++

Mar 5, 2012 4:03 AM in response to bernardp

Finally I bit the bullet and backed up all files, erased hard drive and reinstalled. Then went through the process of replacing files updating lion etc and in some cases fixing permissions. Took about a day..... Not fun.


Months of struggling with repeated attempts to trash prefs, create new accounts only gave small benefits. Finally ( but not at first) disk utility started reporting disk errors, unfixable except via erasing hard disk. That persuaded me I was living on borrowed time and might as well start again.


Erasing hard disk and going through the major hassle of reinstalling files and apps from a time machine backup has been totally worth it for me. The mid 2009 MacBook pro now runs like a new mac with Lion ought . no spinning, crashing or freezing! Hopefully won't need these threads any more.


I still suspect that the disk errors and freezes were a bit too coincidental with my lion upgrade on top of Snow Leopard, but like an episode of House the final diagnosis was the correct one: spinning beach ball = Lupus: wipe and reinstall.

Mar 5, 2012 2:54 PM in response to bernardp

I narrowed it down to the problem that lies in OSX 10.7.3. OSX 10.7.0 works perfectly fine.

What I did was do a clean install on my extra disk partition on my MacBook Pro using the Lion USB drive. I purposely did not install anything in it, no software update, no user account restore from TimeMachine. It should be a clean pristine 10.7.0


After install with a barebone system, everything works fine. Airport did detect auto-join, and pop-up with redirection to the ISP authentication page. If I ignored it, and came back later, Airport will pop-up that auto-joint redirection window again. So far so good.


Then, I merely did a MacOSX combo software update from 10.7.0 to 10.7.3. Guess what? After the update, and restart, it hangs immediately.


This proves that it is the problem of OSX 10.7.3. Furthermore, it is the problem with MacBook Pro, because I never had this problem with my iMac running 10.7.3, with identical cloned configuration.


It has to do with the problem with attempting to get an IP address from the internet but AirPort failed to return the IP, causing Safari, iCal, iCloud, Mail, anything that uses the internet to hang. Amazingly, Firefox works fine without hanging. I think that is because FireFox bypasses the Auto-join process from Airport. Auto-join is a new feature in Lion that Firefox had not used yet.


Oh, by the way, I just did the firmware update for MacBook Pro too, which just released today, but the firmware update did not change anything. Still crash in 10.7.3, but works fine in 10.7.0.

Mar 6, 2012 1:29 AM in response to nicoladie

Hi nicoladie,



Have you tried with my description above? I put it here again:

  1. turn off Firewall;
  2. turn off WiFi;
  3. restart computer;
  4. if necessary, log into your account;
  5. launch Safari (and wait until it is fully started);
  6. turn on WiFi;
  7. connect Safari to any site on the Internet;
  8. launch System Preferences and turn Firewall back on.


From there everything should work (Safari, Mail, and all the dependent "iThings"...)


Just as an addendum, I don't think the problem is tied to 10.7.3. I think its a remnant from 10.7.2. That's at least where all the problems started for me. Since 10.7.3, I have this workaround, however (which I did not have with 10.7.2).


Additionally, in my case, Safari does not crash per se. It bounces forever and I have to force quit it.


Finally, I noticed that if the computer went to sleep, I had to restart the whole process, meaning that no other programs than Firefox could connect back to the Internet... Even if I temporarily turn off the Firewall again. No, it's the whole procedure mentioned above that I have to restart.



Best regards,

Peter 🙂

++++

Mar 12, 2012 1:03 PM in response to nicoladie

nicoladie wrote:


I think Apple finally fixed the problem with the latest software updates on both Airport Utility and MacBook Pro firmware updates.


Now, Airport wi-fi kicks in Auto-Join window with redirection to the ISP authentication page automatically. (It works with Firewall on or off, it does not make any difference now).

Whe you mentioned that Safari hangs... does it freeze with a spinning beachball?

Mar 27, 2012 4:10 AM in response to Aidan Byrne

My Safari has been acting up for about 2-3 weeks with serious hanging and sporadic hanging for about the past 3 months. I have followed all of the ideas put forward here and none helped me solve it. What I found on my own and it has been tested quite a bit by me is to go to Safari/Preferences/Extensions and turn it OFF. then restart Safari. This should stop the hanging problem but it might cause some others who use Extensions a few problems obviously. First stop the hanging and confirm it works for you. Then, IF YOU MUST, turn extensions on and add in each one you need ONE-AT-A-TIME. Go to your favorite HANGING page and see if it hangs after each test. I think the Extensions option needs more work myself so I am staying away for now and opting for a smoother running computer. Hope this works for you! Let me know.

Why does Safari hang in OS X Lion?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.