Freigeben über


more on why ie will only let you save as bmp

...and why View->Source sometimes stops working.

I had previously discussed this here.  In that post I mentioned the reason for this was IE's cache was filling up.  This brings up the question, "Why does the cache scavanger not kick in and do its job at that point?" 

To answer, I must first explain a bit about how the Temporary Internet Files folder (TIFF) works.  We have an internal set of APIs that map URLs to blobs of data.  Imagine a hash table.  For caching purposes, the blob of data mapped to the URLs is the cache file name in the TIFF.  So really, and this is the crux of the issue, there are two limits on the cache: the size on disk that the TIFF is limited to, and the number of entries in the index that maps URLs to cache file names.

When the TIFF gets full, the scavager kicks in.  When the table that maps URLs to blobs runs out of entries, the scavanger is not invoked.  Running out of entries is the cause of the problem, because at that point IE cannot map new URLs to the cache filename.  The files are in the cache, the cache is not full, but we cannot find them because the index was full when they were added.    This usually happens when you have lots of small files in the cache.

This is an interesting bug from a software engineering perspective.  The reasons why particular actions are failing are not clear, i.e. you can debug and see that the cache file name was not found, but since it got added at an earlier time you do not know why it is not in the cache.  The cache itself is not full because it has not reached its limits.  This behavior will only be reproducable for some pages, depending on whether they were in the cache before or after it filled up. Furthermore this will bug will only be reproducable on some machines.  The mandelbug nature is probably why this was never fixed before.

So clearing the cache is still the solution to the BMP only/View->Source problem, for now.  This will be fixed in an upcoming release.

Comments

  • Anonymous
    October 29, 2004
    The comment has been removed

  • Anonymous
    October 29, 2004
    >When the table that maps URLs to blobs runs out of entries

    Do I understand right, there's some hardcoded limit of entries in that table?

  • Anonymous
    October 29, 2004
    Cool, I wondered what was going on with IE in those cases, I've seen them both.

  • Anonymous
    October 29, 2004
    Alex--

    There is an upper limit. I have not gone looking through the code to see exactally what it is.

  • Anonymous
    October 29, 2004
    I'm glad to hear this bug will be addressed :-)

  • Anonymous
    October 29, 2004
    Go to http://alltheweb.com , go to pictures and search for something. Then right click on any pictrure found, open in new window, then try "save as". IE will offer you to save it as .bmp file. If you hit refresh and then try to save as, IE will save it as .bmp.

  • Anonymous
    October 29, 2004
    lexp--

    When I do that IE offered me the option to save as .jpg, which is the original image format. I recently cleared my cache.

  • Anonymous
    October 29, 2004
    not trying to be a grammar freak, just trying to save you some embarassment... it raised the question. Begging the question is something different, relying on an obscure use of "beg". To "beg the question" means to use your hypothesis as the proof of your argument, like "bitmaps are better than jpegs because because they are a superior file format."

  • Anonymous
    October 29, 2004
    Shannon -

    Yeah, I briefly considered looking it up before I posted. I guess I should fix it and take my own advice of not using terms which I do not have a good definition for. :)

  • Anonymous
    October 29, 2004
    I have to say that I'm happy for you, or for whoever figured this one out. As a programmer, I know how great it feels to finally catch a really complex bug.

  • Anonymous
    October 29, 2004
    Can you explain why the cache file names are not encoded, so it'll be more difficult to exploit vulnerabilities using the TIFF?

  • Anonymous
    October 30, 2004
    Jeff finding nasties like this is cool - I take it that reducing the TIFF disk size to something more rational would force the scavenger to kick in before running out of entries more frequently? (even if only to mitigate but not eliminate the occurence of the problem)

    Dunno what the default is now but I seem to remember IE 4.x using 10% of disk as its cache opening gambit. (fine when my largest volume was only 1Gb!)

  • Anonymous
    October 30, 2004
    The cache file names are not encoded, but the directories they live in are encoded. If you open a cmd prompt, then go to "documents and settingsusernamelocal settingstemporary internet files" and look at the directory listing, you will see one or more directories that are 8 "random" letters and numbers. Actual files are cached in those directories to prevent squatting.

  • Anonymous
    November 01, 2004
    This is one of the BIG reasons why I switched to firefox.
    This still seems preposterous to me - the map for cached binary objects has fewer entries than the cache can hold? Surely the caching process should be driven by the indexing system, not vice versa? I mean, this is the equivalent to a library saying, oh well, we ran out of indexing cards, just throw the book into that big heap over there...

  • Anonymous
    November 03, 2004
    For those who consider this to be a big problem, it sounds as if reducing the size of the cache would help - so that it would run out of space (and invoke the scavenger) before it ran out of entries. Does that sound reasonable?

  • Anonymous
    November 03, 2004
    Mike--

    It could; depends on browsing habits. If you view lots of pages with lots of small images, it may not help.

  • Anonymous
    January 21, 2009
    PingBack from http://www.hilpers.it/1854001-tasto-destro-in-ie6-xp

  • Anonymous
    January 22, 2009
    PingBack from http://www.hilpers.pl/401278-grafika-z-inetu