Redirecting the Favorites folder is technically legal, but you wouldn’t like it

A customer liaison asked for assistance in debugging why Internet Explorer frequently stops responding at their customer's site. "We have tried a number of things like clearning the temporary Internet files, disabling add-ons, and resetting Internet Explorer settings. Please let me know if you can provide guidance based on the dump files provided below to indicate what could be causing Internet Explorer to hang here."

The dump file showed 23 threads, and all of them seemed to be normal, except for one which looked like this:


(Remember, you can get symbols for operating system binaries.)

General debugging tip: If you see a really huge stack, that's a good sign that something interesting is going on. Boring stacks tend to be small.

Furthermore, frames near the bottom of the stack tend to describe what the purpose of the thread is, whereas frames near the top of the stack tend to describe what the thread is actually doing right now. (Exercise: Why?)

In this case, we see a stack that was probably created to manage a tab window (CTab­Window::_Tab­Window­Thread­Proc) and it's currently stuck in an I/O operation. You can then look at the file name to see what file is stuck.

0:001> du 04cd6aac
04cd6aac "\\server\share\abcdefg\Favorites\Mail.url"

It looks like this user stored their Favorites on a network share that is not responding.

The customer liaison replied,

Thanks a lot for this information. Can you help me understand how do we tell that the dump indicates this file I/O is causing IE to hang? Having this information would help me better explain this to the customer.

I wasn't sure how to respond to this. If you see a function with the words File and one of Open, Read, or Write in its name, there's a good chance that it opens, reads, or writes a file. You probably want to look to see what file is being opened, read from, or written to, because that may give a clue why the I/O operation is stuck.

It turns out that this customer redirected the user's Favorites to a network location. The Internet Explorer folks tell me that this is not an explicitly supported scenario in the sense that they did not do any tuning to make this scenario work well, and frequent hangs are consequently not unexpected. If you redirect the Favorites to a network location, then you get what you get. And if that server frequently becomes unavailable, then what you get often sucks.

Comments (47)
  1. Joshua says:

    How about I redirect favorites to NUL and be done with it. Waste of screen.

  2. Chris B says:

    For the exercise, I would say that frames near the bottom of the stack reflect the purpose of a thread because threads are spawned in order to execute a job asynchronously. The name method in that frame should give a clue about the overall job being done. Moving up the call stack, we start to see increasingly fine-grained operations necessary to complete that job. The ones closest to the top reflect what that thread is doing "now" because that is where the thread was stopped (hung, terminated, paused, etc…).

  3. Antonio 'Grijan' says:

    People tend to keep long lists of unsorted favorites/bookmarks, without using folders. But they love them because of the same reason they love graphical interfaces over the command line: favorites avoids them the hassle of having to remember each site's address, as a GUI avoids an user having to remember all the commands available with their particular syntaxes and options.

  4. Bob says:

    People also like "favorites/bookmarks" for security reasons. Typing invites typos which can bring one to a similar, but not identical site.

    Otherwise, one can set a search engine as one's home page and always type one's bank's name into the search engine and hope that it gets the right site each time.

  5. jader3rd says:

    I wish Microsoft would rename favorites to bookmarks. I realize they're the same thing, but some OCD-ish part of me only wants to put my favorite websites in the favorites list. But it turns out that's unnecessary because I can remember my favorite sites (they are my favorite after all). So what I put in my favorites lists are websites which are not my favorite, but ones that I think I'll need to remember later. So the collection of sites in my favorites list would probably be better renamed as the "Unfortunately Necessary" list. It would be fortunate if I could remember this necessary site later, but I wouldn't be able to.

  6. Matt says:

    It seems to me that the IE team and the group policy team need to get together and have a little chat.

    All that work adding favourites redirection to the group policy editor and client have gone to waste if it's "not explicitly supported." And corporate customers have a right to be peeved when some options in a folder redirection policy have "explicit" support and others don't. Microsoft heavily promotes folder redirection as a benefit of its directory services, and I'm sure many customers would be aghast that the feature is viewed so dismissively by the IE team.

  7. Koro says:

    I wonder what's the two levels of subclassing for…

  8. I know. I will use this post to ask this question. because... stuff and things. like testing lengths. says:

    Why does opening one problematic tab in new IE halt the whole program (tree)? Does it need to pass through some cthtchacha gateway?

    [The user wasn't opening a tab. The user had a tab already open and then clicked the Favorites button. That hung the tab, and since it was the focus tab, it hung the window. -Raymond]
  9. Joshua says:

    @I know: Because multithreaded GUI can block due to attached input queues. They say Chrome managed to bypass the problem but I doubt it.

  10. Wayne says:

    This is probably a dumb question but how did you find the address that contains the filename string?

    [It's a parameter to Get­Private­Profile­StringW. -Raymond]
  11. prasun says:

    I'm also curious about the filename as Wayne mentioned above.

  12. dave says:

    "Why?"  — because programs generally consist of layers of function; and layer N is built on the smaller-sized pieces that make up layer N+1.

    Top level goal: balance my checkbook.

    Eventual low-level operation: add two numbers.

  13. SimonRev says:

    As far as I know IE never ran on 16-bit windows, so the real question is: Why is it calling a deprecated function in 32 bit windows (GetPrivateProfileSectionNames: This function is provided only for compatibility with 16-bit Windows-based applications. Applications should store initialization information in the registry.)

    [Look at the URL file format. It should look awfully familiar. -Raymond]
  14. lefty says:

    The remedy for these kinds of problems is as old as the hills:

    Patient: Doctor, it hurts when I do this.

    Doctor:  Don't do that.

  15. DWalker says:

    @jader3rd:  Exactly!  The names of things are important.  I agree with you 100%.

  16. Romeo says:

    @DWalker: Shakespeare didn't think so.

  17. Anonymous Coward says:

    If a Chrome tab hangs, that doesn't affect the browser as a whole, regardless of whether it has focus or not. You can easily test this for yourself (how to go about it is left as an exercise for the reader). I don't know how it works under the covers, but whatever it's doing, it does it remarkably well. Other browsers tend to hang or even crash almost daily, but Chrome always stays responsive. (Well, at least the area with the tabs, menu and address bar. I've seen lots of tabs hang and plug-ins crash.)

    [The problem here is that the part that hung is outside the tab. (It's the Favorites menu.) So it's sort of the reverse of the hung tab problem. The tab itself is fine, but the frame is hung. -Raymond]
  18. SimonRev says:

    Ok, I get it now.  On the other hand a recurring theme on this blog is: Heed the scary MSDN warnings, they are there for a reason — we don't want to have to write a compatibility shim due to your inability to follow directions.

    Sounds like in this case MSDN ought to have a gentler warning.

  19. John Muller says:

    Everything .INI should be .XML nowadays.

  20. Jon says:

    Raymond, any thoughts on whether it's a good idea to do synchronous I/O in a UI thread?

    [I think the answer is obvious. -Raymond]
  21. Anonymous Coward says:

    Raymond, I didn't intend to suggest that Chrome's way of dealing with tabs would have helped here; it was just a reply to Joshua. I suspect that if the GUI thread of the main browser process went south, the entire browser would become unresponsive. Unfortunately for our current purposes, but fortunately for every day use, it never hangs (although maybe it will react the same as IE if you coax it to store its settings on a network drive) whereas tabs do hang, as do other browsers. (Incidentally, Chrome proves that you can isolate GUI processes without ill effects.)

  22. mfh says:

    @Antonio 'Grijan' – it's not just site addresses though, it's also (and more often) page addresses, and page addresses can often contain lengthy query strings.  You may need to update your assumptions about how people actually use the internet!

  23. Mark VY says:

    @Jon: I have never heard of anyone saying it's a good idea to do synchronous I/O in a UI thread.  And this blog post shows exactly why: it may take longer than you expected it to.

  24. Tim says:

    >As far as I know IE never ran on 16-bit windows

    I definitely remember running IE on Windows 3.1, and I don't remember it requiring Win32s.

  25. alegr1 says:

    >I definitely remember running IE on Windows 3.1

    Nope, IE1 was an add-on for Windows 95. IE 1.5 could run on Windows 3.5. Netscape could have been running, though.

    [There was a version of IE3 that ran on Windows 3.1. -Raymond]
  26. Joe D says:

    I redirect my Desktop and Documents folders to a network share.  The server they're on gets backed up nightly.

  27. John Doe says:

    @Anonymous Coward, Chrome is getting slower by the day, isn't that an ill effect?  This is the browser syndrome: every single one starts fast, lightweight, until it can compete with Emacs as a heavier, prettier desktop and dog replacement.

    The processes share significant chunks of memory, such that the isolation helps most resources to be cleaned up and most uncaught exceptions to have lesser side effects, but it doesn't help memory corruption in general.  In the 32-bit world, more processes also means more address space (other than the shared memory chunks, of course).  In practical terms, you need a lot of memory to even feel the advantage, which is only possible in a 64-bit architecture, so an effort to go 64-bit (hell, it's 2014!) should have already finished, not just started.

    I'm sure you've seen groups of tabs going down, and a very few times, all tabs going down, in every modern browser, so it's not the silver bullet.

    From what I gather, isolating plugins is the real gain.

  28. Yuhong Bao says:

    [There was a version of IE3 that ran on Windows 3.1. -Raymond]

    IE4 and IE5 too.

  29. HomeCloset says:

    > It seems to me that the IE team and the group policy team need to get together and have a little chat.

    Agreed, but I think in this case the customer should have enabled Offline Files for the redirected folder, as IntelliMirror :) does it by default.

  30. cheong00 says:

    Btw, instead of placing it on network location, maybe they should try profile roaming strategy instead.

  31. alegr1 says:

    >(GetPrivateProfileSectionNames: This function is provided only for compatibility with 16-bit Windows-based applications. Applications should store initialization information in the registry.

    This recommendation is a bit misguided. There is nothing wrong with using a file with INI format to store a bunch of items in human readable format. I suspect the same API is used to read those desktop.ini, autorun.ini and other similarly formatted files.

    An .URL file has INI file format. You use those *Profile* functions to work with it.

  32. SomeGuyOnTheInternet says:

    @Jader3rd – if "bookmarks" is the correct term, then WHERE IS THE BOOK?! :-)

  33. Harry Johnston says:

    In a roaming profile environment, the alternative to redirecting Favorites is uploading and downloading them whenever the user logs on or off.  That's not great either, since SMB doesn't exactly perform brilliantly when you're dealing with lots of small files, and you can also get synchronization issues if you log into more than one machine at a time.

    If you're redirecting other folders, such as the Desktop, Documents, and Application Data, it's probably safe to redirect Favorites as well: if the server goes down, you're in trouble anyway.  Just make sure they all go to the same server.

  34. Neil says:

    Firefox 1 and 2 stored its bookmarks in an HTML in a user-defined location which IIRC was read and parsed on the UI thread about a second after the main window opened. Later versions store bookmarks in the same sqlite database as history. (Of course this does mean that you can't trivially just move that database on to a network drive, and storing the entire profile on a network drive is probably a bad move.) They have tried very hard to ensure that no access to the backing file happens on the UI thread, but I couldn't personally give you a cast-iron guarantee.

  35. GWO says:

    @Jader3rd Correct. The only sensible name for Favourites/Bookmarks is "Links to URLs that I think I'll need again but are too complex for me to remember in their entirety, and will probably just sit here unclicked until they either link-rot away anyway or I forget why I saved them in the first place".

  36. Paul Coddington says:

    IE and some other applications really choke when disk IO is up, even in the default configuration. The main culprit I've been seeing of late is continuous background defragging causing the system to hang. Uninstall the third party defragmenter and suddenly the system can multitask again. It seems strange that IE needs disk IO to load a webpage, but I guess it probably gets stuck trying to read files from the local cache.

  37. Rick C says:

    @John Muller: you have to overcome the <a href="…/57985.aspx">minus 100 point</a> rule.

    In particular, what does redoing the format gain you?

  38. Nick says:

    You'd have to dig through historical records to find out for sure but maybe the reason IE chose "Favorites" was because "Bookmarks" was protected by Netscape? This is 100% pure speculation.

  39. Alex Cohn says:

    @Nick: IE followed the Windows conceptthe concept that everything is just a shortcut. Links to files, links to URLs, whatnot – all small regular files that can be placed even on a FAT diskette. So, Favorites was born as a collection of links which are just the same as links elsewhere.

  40. Gpoguy says:

    Sadly, this is yet another example of GP and IE product teams not being in sync in the slightest. If you're going to expose the option to redirect favorites, then the IE team says we don't optimize for it, then all you're doing is messing with the customer. Honestly, how are folks supposed to keep up with this stuff if you "sorta, kinda" support the scenario that you expose through UI?

  41. John says:

    How strange we've got a similar issue currently now with customer support, except in our case it hangs the whole machine. *Shakes fist angrily at RDBSS and Windows 2012R2*

  42. @John: if your server uses SAN or SSD storage, try turning off the Windows slimming support.

    fsutil behavior set DisableDeleteNotify 1

    (You might then need a reboot, I'm not sure.)

    We had dreadful problems with our file server for most of a year, defeating all our efforts to diagnose the underlying cause, and they all went away as soon as we turned slimming off.

  43. Cupnoodleboy says:

    Can anyone enlight me why there is no problem to put a word or excel file in a redirected folder,  but there is such a problem when putting favourite shortcut files in a redirected folder?  A folder may have hundreds or thousands of word or excel files, and word or excel do not appear to have problem in such case.

    [Lots of people put Word and Excel files on network locations, so the Word and Excel people consider it worth the effort to design their applications to do as much I/O as possible in the background. On the other hand, at the time IE was originally written, it wasn't even possible to put your Favorites on a network location. And feedback from users say that they are much more interested in standards compliance than in having good performance when Favorites are on a network. Furthermore, IE needs to access Favorites in response to the user clicking a button. It's not like you can put up a progress bar and say "Why don't you watch this little animation while I go and see what your Favorites are right now." -Raymond]
  44. One word: ReadDirectoryChangesW.  Wait, is that four words? :-)

    (Yes, I know: -100 points.  I just couldn't resist.)

    [That doesn't help you show the menu the first time. And the menu does use ReadDirectoryChangesW while it is open, but the menu is designed to destroy submenus that aren't being used (conserve UI resources). Yes, you could fix all this, but it's a shared component, so you have to be careful not to break any other clients. -Raymond]
  45. You could load the menu content ahead of time, as soon as IE starts up.  But yes, I understand this would be more work than it's worth, especially with the compatibility restraints.

    It actually works perfectly well as-is for us; we've been redirecting the Favorites folder for years with no problems.  Of course, it's redirected to the same server as everything else: roaming application data, Documents, Desktop, everything.  So if the server is down, the Favorites menu is the least of our worries. :-)

  46. alegr1 says:

    >Uninstall the third party defragmenter and suddenly the system can multitask again.

    This is the guy who has the coveted time machine. He writes to us from 1997.

  47. Nick says:

    @Alex Cohn: I wasn't talking about the implementation, I was talking about the name.

Comments are closed.

Skip to main content