Closed Bug 922123 Opened 12 years ago Closed 12 years ago

Shutdown hang with 100% CPU on Nightly with new cache

Categories

(Core :: Networking: Cache, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: Irving, Assigned: mayhemer)

References

Details

Attachments

(2 files)

I turned on the pref for the new network cache (browser.cache.use_new_backend = 1); during a regular restart for Nightly update, the browser hung after the windows all closed. One core was running at full usage. an Activity Monitor trace is attached; it shows the Cache Mngmnt thread looping below mozilla::net::CacheStorageService::PurgeOverMemoryLimit(). I attached a debugger and tried to follow the loop, but I wasn't picking up symbols correctly so I couldn't clearly see what was going on, and then xcode crashed and killed the browser so I couldn't debug any more.
Seems like often reproducible. I will take a look ASAP. Thanks. (Bad you were not able to debug, I was trying to reproduce this my self, no luck).
Assignee: nobody → honzab.moz
This could be a bug in nsTArray. CacheStorageService::PurgeExpired loops and expects entries on which PurgeAndDoom is called gets removed from the array. But apparently this doesn't happen and the code loops indefinitely. Workaround is to remove the entry by index directly in CacheStorageService::PurgeExpired(). However, the entry is doing RemoveElement(this) on the array, but there is the bug - this doesn't work all the time. I'll report a bug and in the mean time I'll fix this by a direct delete.
Status: NEW → ASSIGNED
Attached patch v1Splinter Review
- the problem is not (cannot be) in nsTArray - my theory (since I cannot reproduce) is that the registration flags are messed up by thread concurrency - since the registry flags are accessed only on a single thread, I wanted to avoid unnecessary locking - hence the flags are moved to a separate state var (also this code is better understandable)
Attachment #812699 - Flags: review?(michal.novotny)
Attachment #812699 - Flags: review?(michal.novotny) → review+
Blocks: cache2enable
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: