Closed
Bug 49813
Opened 25 years ago
Closed 21 years ago
"threadsafe" nsDirectoryIndexStream uses nsDirEnumeratorUnix triggering "not thread-safe" assertion
Categories
(Core :: Networking, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jesup, Assigned: timeless)
References
()
Details
(Keywords: assertion)
Attachments
(2 files)
982 bytes,
patch
|
darin.moz
:
review-
|
Details | Diff | Splinter Review |
2.37 KB,
patch
|
darin.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
Got this assertion when browsing to file:///tmp on FreeBSD 3.4. Build was
a fresh pull and clobber 8/21/00. Probably related to bug 47356.
Breakpoint 2, nsDebug::Assertion (
aStr=0x281eab80 "nsDirEnumeratorUnix not thread-safe",
aExpr=0x281f5ca0 "owningThread == NS_CurrentThread()",
aFile=0x281f5c7d "nsDebug.cpp", aLine=487) at nsDebug.cpp:191
(gdb) bt
#0 nsDebug::Assertion (
aStr=0x281eab80 "nsDirEnumeratorUnix not thread-safe",
aExpr=0x281f5ca0 "owningThread == NS_CurrentThread()",
aFile=0x281f5c7d "nsDebug.cpp", aLine=487) at nsDebug.cpp:191
#1 0x281972f8 in NS_CheckThreadSafe (owningThread=0x8767600,
msg=0x281eab80 "nsDirEnumeratorUnix not thread-safe")
at nsDebug.cpp:487
#2 0x28171c03 in nsDirEnumeratorUnix::Release (this=0x8f24220)
at nsLocalFileUnix.cpp:150
#3 0x805eb57 in nsCOMPtr<nsISimpleEnumerator>::~nsCOMPtr (
this=0x90c5f64, __in_chrg=2) at ../../dist/include/nsCOMPtr.h:489
#4 0x28749ce3 in nsDirectoryIndexStream::~nsDirectoryIndexStream (
this=0x90c5f00, __in_chrg=3) at nsDirectoryIndexStream.cpp:92
#5 0x28749f0b in nsDirectoryIndexStream::Release (this=0x90c5f00)
at nsDirectoryIndexStream.cpp:114
#6 0x805b4c9 in nsCOMPtr<nsIInputStream>::assign_assuming_AddRef (
this=0x8bd8858, newPtr=0x0) at ../../dist/include/nsCOMPtr.h:471
#7 0x281cbab5 in nsCOMPtr<nsIInputStream>::assign_with_AddRef (
this=0x8bd8858, rawPtr=0x0)
at ../../../../dist/include/nsCOMPtr.h:848
#8 0x281cbced in nsCOMPtr<nsIInputStream>::operator= (this=0x8bd8858,
rhs=0x0) at ../../../../dist/include/nsCOMPtr.h:583
#9 0x28738b6c in nsFileTransport::Process (this=0x8bd8800)
at nsFileTransport.cpp:512
#10 0x287381bd in nsFileTransport::Run (this=0x8bd8800)
at nsFileTransport.cpp:360
#11 0x2819088b in nsThreadPoolRunnable::Run (this=0x8258680)
at nsThread.cpp:689
#12 0x2818e4cd in nsThread::Main (arg=0x81e4de0) at nsThread.cpp:84
#13 0x282fd271 in _pt_root (arg=0x8238f80) at ptthread.c:198
#14 0x28346a5e in _thread_start () from /usr/lib/libc_r.so.3
#15 0x0 in ?? ()
(gdb)
Reporter | ||
Comment 1•24 years ago
|
||
After checking a little more on non-thread-safe issues, I'm raising this to
Major. thread-safety issues could cause crashes and/or dataloss.
Severity: normal → major
Updated•24 years ago
|
Target Milestone: --- → mozilla0.9.2
Updated•24 years ago
|
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Comment 6•23 years ago
|
||
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1
(you can query for this string to delete spam or retrieve the list of bugs I've
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Comment 7•22 years ago
|
||
Moving all threading bugs to XPCOM. See bug 160356.
Component: Threading → XPCOM
Assignee | ||
Comment 10•21 years ago
|
||
I attached one way that should resolve this problem
Assignee: rpotts → timeless
Component: XPCOM → Networking
Keywords: assertion
QA Contact: rpotts → benc
Summary: nsDirEnumeratorUnix not thread-safe → "threadsafe" nsDirectoryIndexStream uses nsDirEnumeratorUnix triggering "not thread-safe" assertion
Target Milestone: Future → ---
Attachment #134506 -
Flags: superreview?(darin)
Attachment #134506 -
Flags: review?(darin)
Comment 11•21 years ago
|
||
Comment on attachment 134506 [details] [diff] [review]
fix caller
i think it'd be better to not store mDir. it doesn't even seem to be used for
anything past Init(), so i think you can just stop storing it :-)
Attachment #134506 -
Flags: superreview?(darin)
Attachment #134506 -
Flags: review?(darin)
Attachment #134506 -
Flags: review-
Comment 12•21 years ago
|
||
I have this vague recollection that I needed this for something. this ties into
the THREADSAFE_I18N stuff too, of course.
Assignee | ||
Comment 13•21 years ago
|
||
Attachment #134810 -
Flags: review?(darin)
Comment 14•21 years ago
|
||
Comment on attachment 134810 [details] [diff] [review]
fix caller, skip the useless member
hmm... if we are no longer saving mDir, then is the Clone really necessary?
Assignee | ||
Comment 15•21 years ago
|
||
darin: well, the "interface" doesn't specify whether the nsIFile it takes is
usable. it turns out that you "fixed" the caller (nsFileChannel) by having it
create a new nsIFile which it passed to nsDirectoryIndexStream. Given the way
the code is today, I'll drop the clone and add comments to the .h indicating
that the nsIFile will be used on its calling thread.
Status: NEW → ASSIGNED
Comment 16•21 years ago
|
||
Comment on attachment 134810 [details] [diff] [review]
fix caller, skip the useless member
r+sr=darin w/ dir cloning dropped.
Attachment #134810 -
Flags: superreview+
Attachment #134810 -
Flags: review?(darin)
Attachment #134810 -
Flags: review+
Assignee | ||
Comment 17•21 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 18•21 years ago
|
||
VERIFIED:
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsDirectoryIndexStream.cpp&branch=&root=/cvsroot&subdir=mozilla/netwerk/base/src&command=DIFF_FRAMESET&rev1=1.27&rev2=1.28
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsDirectoryIndexStream.h&branch=&root=/cvsroot&subdir=mozilla/netwerk/base/src&command=DIFF_FRAMESET&rev1=1.8&rev2=1.9
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•