淘客熙熙

主题:问题: Firefox crash -- truth

共:💬13 新:
全看分页树展 · 主题 跟帖
家园 看来此问题短期内无解

除非有人take time to fix the core, mozilla那帮人似乎并不热心. 此bug是mozilla的设计问题, 已有数年历史, 曾被列为won't fix. 现在reopen了, 但fix还是遥遥无期. 怎么IE和Opera就没有这个问题呢?

外链出处

If Mozilla crashes, then all the images in the cache are lost (and presumably

the cached HTML pages as well). This is easy to reproduce: just go to a site

with a lot of graphics (like http://megatokyo.com), do "killall -9 mozilla-bin",

then restart Mozilla and go back to that site; it will start reloading all of

the images.

This is by design. The cache is primarily an optimization. Rather than add a

bunch of extra code to verify it and fix any potential corruption, we toss it

and start again.

unfortunately, there is no code to detect a bad cache. what mozilla does

currently is detect that the cache was never closed after being previously

opened. what this means simply is that when the cache is opened, a flag is set

indicating that its on disk representation is dirty (i.e., possibly incomplete).

at shutdown everything is sync'd to disk and the dirty flag is cleared.

however, what you are proposing requires determining if a cache is corrupt or

not, and that is a very complicated problem to solve. we are no where close to

having enough support in gecko to determine if the cache files are consistent.

i think you do not understand how the cache is implemented. in a nut-shell (and

this explains why this bug is hard to fix), the index of cache entries is an

in-memory data structure that is only written to disk when the browser exits

cleanly. however, data files are written as we load pages. the result is that

the data files on disk are not in sync (at all) with the index of cache entries

stored on disk. hence, if we do not shutdown cleanly, we do not have a

meaningful index of cache entries on disk.

the "solution" that you propose would cause the browser to crash or load

incorrect content in many cases.

i understand that this bug matters to some people, but so do many other bugs.

fixing this bug is a non-trivial task. if it were a trivial task, we wouldn't

be having this discussion. please try to temper your comments in the future.

getting angry doesn't solve anything.

FYI, we are planning a rewrite of the cache based on SQLite. Part of this

rewrite should solve this bug (hopefully). If you are interested, see the

beginnings of this code here:

http://lxr.mozilla.org/mozilla/source/netwerk/cache/src/nsDiskCacheDeviceSQL.cpp

全看分页树展 · 主题 跟帖


有趣有益,互惠互利;开阔视野,博采众长。
虚拟的网络,真实的人。天南地北客,相逢皆朋友

Copyright © cchere 西西河