Closed Bug 367817 Opened 18 years ago Closed 18 years ago

nsJAR::GetInputStreamWithSpec closes same fd twice in failure case

Categories

(Core :: Networking: JAR, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Whiteboard: [patch])

Attachments

(1 file)

I've (as of very recently) been seeing crashes when I rebuild JAR files underneath a running Mozilla. (In the past, I sometimes saw runtime problems, but not crashes.) From the stack of the crash, I suspect the problem *may* be the following bug (although I'm not convinced). When nsJAR::GetInputStreamWithSpec's call to jis->InitFile fails, in some of the failure cases, jis owns the file descriptor (which it closes when it is released). This means we'll call PR_Close on the same file descriptor twice. I'll attach a patch that fixes this bug (I'm not yet sure if it fixes the crashes I've been seeing, though).
Attached patch patchSplinter Review
Attachment #252410 - Flags: superreview?
Attachment #252410 - Flags: review?
Attachment #252410 - Flags: superreview?(darin.moz)
Attachment #252410 - Flags: superreview?
Attachment #252410 - Flags: review?(darin.moz)
Attachment #252410 - Flags: review?
From a quick skim, looks like a regression from bug 337561, which added this PR_Close(fd).
Blocks: 337561
I haven't seen the crash since I wrote this patch, so I think it does fix the crash.
Attachment #252410 - Flags: superreview?(darin.moz)
Attachment #252410 - Flags: superreview+
Attachment #252410 - Flags: review?(darin.moz)
Attachment #252410 - Flags: review+
Checked in to trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: