Closed
Bug 56998
Opened 25 years ago
Closed 24 years ago
nsLocalFile::Exists() is wrong
Categories
(Core :: XPCOM, defect, P3)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ccarlen, Assigned: ccarlen)
References
Details
(Whiteboard: [rtm-] r=sfraser, sr=scc, Checked in on trunk)
Attachments
(1 file)
|
865 bytes,
patch
|
Details | Diff | Splinter Review |
See http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsLocalFileMac.cpp#1849. If
ResolveAndStat returns some error other than NS_ERROR_FILE_NOT_FOUND, it is
ignored. If the error caused ResolveAndStat to not set mTargetSpec, it will
(most likely) do the existence test on a zeroed out spec which will always
return noErr. Basically, this method can return TRUE for completely bad files
which don't exist.
| Assignee | ||
Comment 1•25 years ago
|
||
| Assignee | ||
Comment 2•25 years ago
|
||
The patch above fixes this. This really needs to go in. I discovered this while
reviewing bug 56041. Not being able to reliably tell whether files exist
threatens the effectiveness of the patch for 56041.
Comment 3•25 years ago
|
||
You're using FSMakeFSSpec() as a surrogate for a file existence test; ideally,
you should use PBGetCatInfoSync() for this. However FSMakeFSSpec() probably just
calls PBGetCatInfoSync() under the hood.
Do you care if this is a file or folder? Your code won't tell you, but using
PBGetCatInfoSync() and testing the bits in pBlock.hFileInfo.ioFlAttrib will.
Status: NEW → ASSIGNED
| Assignee | ||
Comment 4•25 years ago
|
||
Only if there was a difference in speed. I could use the microsecond timer and
see if there was any difference. I doubt but, while testing, I noticed that this
got called LOTS of times.
No, it doesn't matter if it's a file or folder.
Comment 5•25 years ago
|
||
ok, r=sfraser
| Assignee | ||
Comment 6•25 years ago
|
||
Just for curiosity's sake (and because it was getting called so much), I did
measure it and found that both FSMakeFSSpec and PBGetCatInfo both average about
35 microseconds. Thanks for the quick r=.
| Assignee | ||
Comment 7•25 years ago
|
||
Nominating for rtm. This needs to go in because because it blocks 56041 which is
(hopefully) going onto the branch. This fix is very small. I would say it is
extremely low risk.
Keywords: rtm
Comment 8•25 years ago
|
||
Marking [rtm need info] since you are working on a patch. The patch looks
approvable if you can get your sr=. When you have sr=, please change the
whiteboard to [rtm+].
Whiteboard: [rtm need info]
Updated•25 years ago
|
Whiteboard: [rtm need info] → [rtm need info] r=sfraser, NEED SR=
Comment 9•25 years ago
|
||
This serious bug has been sitting here, waiting for a sr= for the last week now.
Adding waterson to cc to see if he can help us get a sr.
| Assignee | ||
Comment 10•25 years ago
|
||
This has been checked into the trunk on 10/19 with, by now we can say, no ill
effect.
Updated•25 years ago
|
Whiteboard: [rtm need info] r=sfraser, NEED SR= → [rtm need info] r=sfraser, NEED SR=, Checked in on trunk
Comment 11•25 years ago
|
||
This has now been sitting here for *2* weeks, waiting for a sr.
Comment 12•25 years ago
|
||
I'm curious how this got checked into the trunk with out a super reviewer? Anyone?
| Assignee | ||
Comment 13•25 years ago
|
||
Because Simon gave r= and he is a super-reviewer.
Comment 14•25 years ago
|
||
1. It's claimed that this blocks 56041, but that bug is already checked into
the branch. Was that badness, or is this not a blocker for that bug?
2. What existing user-visible symptom exists for this bug? (I am fully aware
of the potential you're describing, but would still like to know what errors a
real user would see with today's build.)
Has an email been sent to the reviewers alias asking for a super review? Let's
get this resolved ASAP!
| Assignee | ||
Comment 15•25 years ago
|
||
The patch for 56041 evolved several times. I think the final patch for 56041 was
not dependent on this. Either way, this patch is very simple, and the previous
code was clearly wrong. Normally, sfraser is the one to ask for Mac-specific
super-review. I'll try scc.
Comment 16•25 years ago
|
||
this looks ok to me and I'm tempted to give it an sr=mscott but to be honest I
don't consider myself a mac expert to properly measure the behavior of
::FSMakeFSSpec.
scc, can you take a quick look at this patch and give the final sr=?
Comment 17•25 years ago
|
||
looks good to me. sr=scc. Changing whiteboard accordingly.
Whiteboard: [rtm need info] r=sfraser, NEED SR=, Checked in on trunk → [rtm+] r=sfraser, sr=scc, Checked in on trunk
Comment 18•25 years ago
|
||
OK, 56041 is out of the picture. What user-visible symptoms can be seen if this
bug is not fixed?
| Assignee | ||
Comment 19•25 years ago
|
||
I don't know of any user-visible symptoms. Being told that a file exists when it
doesn't - sounds like a user-visible symptom waiting to happen though. PDT's
call though. If it can't be checked in to the branch, I would like to mark it
fixed (it is on trunk) and forget it. The time spent on this page is now about
10x what it took to fix the bug.
Comment 20•25 years ago
|
||
rtm-, without such symptoms, can't take the risk now.
Whiteboard: [rtm+] r=sfraser, sr=scc, Checked in on trunk → [rtm-] r=sfraser, sr=scc, Checked in on trunk
| Assignee | ||
Comment 21•25 years ago
|
||
Since it's checked into trunk, at this point, isn't it fixed.
| Assignee | ||
Comment 22•24 years ago
|
||
Checked into trunk long ago. It was left open back then waiting to go into 6.0
branch. Since that's long gone, this is fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•