Closed Bug 856743 Opened 11 years ago Closed 3 years ago

CachedFileHolder::Release does I/O on the main thread

Categories

(Core Graveyard :: Plug-ins, defect, P3)

22 Branch
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: vladan, Unassigned)

Details

(Keywords: main-thread-io, Whiteboard: [Snappy:P2])

Attachments

(1 obsolete file)

I got a 3-second main thread hang on Windows with the following stack. I think I triggered it by closing a YouTube tab. 
Would it be possible to do the file remove off the main thread, perhaps using OS.File?

NtClose (in wntdll.pdb)
nsLocalFile::Remove(bool) (in xul.pdb)
CachedFileHolder::~CachedFileHolder() (in xul.pdb)
CachedFileHolder::`scalar deleting destructor'(unsigned int) (in xul.pdb)
CachedFileHolder::Release() (in xul.pdb)
nsRefPtr<CachedFileHolder>::~nsRefPtr<CachedFileHolder>() (in xul.pdb)
nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer() (in xul.pdb)
nsPluginStreamListenerPeer::`vector deleting destructor'(unsigned int) (in xul.pdb)
nsPluginStreamListenerPeer::Release() (in xul.pdb)
DoDeferredRelease<nsISupports *> (in xul.pdb)
XPCJSRuntime::GCCallback(JSRuntime *,JSGCStatus) (in xul.pdb)
Collect (in mozjs.pdb)
js::GCSlice(JSRuntime *,js::JSGCInvocationKind,JS::gcreason::Reason,__int64) (in mozjs.pdb)
js_InvokeOperationCallback(JSContext *) (in mozjs.pdb)
js_HandleExecutionInterrupt(JSContext *) (in mozjs.pdb)
js::mjit::stubs::Interrupt(js::VMFrame &,unsigned char *) (in mozjs.pdb)

From a source comment:

"When a plugin requests opens multiple requests to the same URL and the request must be satified by saving a file to disk, each stream listener holds a reference to the backing file: the file is only removed when all the listeners are done."
Attached patch Reinstate Node.hasAttributes. (obsolete) — Splinter Review
Attachment #731969 - Flags: review?(khuey)
Assignee: nobody → bzbarsky
Comment on attachment 731969 [details] [diff] [review]
Reinstate Node.hasAttributes.

Bugzilla db corruption clobbered the original bug 856743 after I filed it but before I wrote this patch... :(
Attachment #731969 - Attachment is obsolete: true
Attachment #731969 - Flags: review?(khuey)
Assignee: bzbarsky → nobody
(In reply to Vladan Djeric (:vladan) from comment #0)
> Would it be possible to do the file remove off the main thread, perhaps
> using OS.File?

Lookup of the cached files is via existing peers in nsPluginStreamListenerPeer::SetupPluginCacheFile() and falls back to creating a new file with CreateUnique().
So this seems safe to me.
Priority: -- → P3
Resolving as wont fix, plugin support deprecated in Firefox 85.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: