The default bug view has changed. See this FAQ.

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

NEW
Unassigned

Status

()

Core
Plug-ins
P3
normal
4 years ago
3 years ago

People

(Reporter: vladan, Unassigned)

Tracking

({main-thread-io})

22 Branch
main-thread-io
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Snappy:P2])

Attachments

(1 obsolete attachment)

(Reporter)

Description

4 years ago
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."
Created attachment 731969 [details] [diff] [review]
Reinstate Node.hasAttributes.
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
You need to log in before you can comment on or make changes to this bug.