Closed Bug 149090 Opened 22 years ago Closed 22 years ago

viewing an image three times corrupts web pages [leaks file descriptors on all platforms]

Categories

(Core :: Networking: Cache, defect, P1)

PowerPC
All
defect

Tracking

()

VERIFIED FIXED
mozilla1.0.1

People

(Reporter: waldemar, Assigned: darin.moz)

References

()

Details

(Whiteboard: [adt1 RTM][verified-trunk][verified-branch])

Attachments

(1 file)

Go to the URL above.  Click on the the Welcome pose 001 image to load a second
web page with a larger version of that image.  Right-click on that image and use
the context menu to save it on the local disk.  Press the browser's back button
to go back to the original page.

Now click on the Welcome pose 001 image to load the second web page again.  That
page is now corrupted -- it no longer has any image!  Reload and shift-reload
don't bring it back.

This bug occurs on both the 1.0 branch and the trunk.
Not sure which component is responsible for this behavior.  Cache?  Layout?
Keywords: nsbeta1
simple testcase:
click on http://www.mozillazine.org/weblogs/asa/wall.jpg then hit the back
button, then the forward button, then the back button and forward again. The
browser will not be able to find that URL after the second time you navigate
forward.
also when clicking on the save as dialog mentioned above you don't actually have
to save, you can cancel out of the save dialog and still manifest the problem.
Summary: Saving an image corrupts web page → saving or viewing an image image corrupts web page
To clarify, there are several independent ways to trigger this bug.

1.  View any JPEG or PNG image three times, as in comment 2.
2.  Try to save a JPEG or PNG image, and then go back and forward.  The bug
occurs even if the save was canceled out.
3.  Use the "View Image" context menu, and then go back and forward.

In all cases the image in question disappears from its host page and cannot be
brought back through any browser action (not even shift-reload) until the
browser is quit.
Summary: saving or viewing an image image corrupts web page → viewing an image three times corrupts web pages
-> me
Assignee: gordon → darin
finally, a reproducible testcase ... thank you waldemar!!
Severity: major → critical
Priority: -- → P1
Target Milestone: --- → mozilla1.0.1
This bug is also in Mac OS Classic (9.0.4 for me) latest build 2002060408 as
well as 1RC3 in Mac OS 10.1.4.

Manifests whenever you go Back and Forward from ANY image alone (that is, not
inline on an HTML page, a directory listing for example, as well as ways
mentioned in comments #2 and #3).
this bug does not seem to be reproducible in chimera (which makes sense given
that it uses the XP_UNIX backend).  at any rate, it must have something to do
with the carbon file i/o code.
ok, i discovered the source of the problem.  basically, we are leaking a file
descriptor that was opened with read/write access.  as a result, future attempts
to open the file for read/write access fail.  the leak occurs the second time
the image is loaded because it has to do with imagelib deciding to use the copy
it has in its memory cache, which was created as a result of the first image load.

the leak is reproducible on linux as well, however, under linux the consequences
of the leak are far less severe.
Attached patch v1 patchSplinter Review
turns out when we load a large enough image, the file transport suspends itself
until imagelib consumes the first part of the file.  however, in this case,
imagelib decides not to consume the data and instead cancels the request. 
well, the file transport fails to unsuspend itself properly... turns out the
file transport service still has a reference to the file transport in its
suspended file transports list.  the file transport gets canceled, but a
reference to it remains forever with the file transport service until we
shutdown.  as a result we effectively leak the cache file until the app quits.
i verified this patch on linux and macosx.
Status: NEW → ASSIGNED
OS: MacOS X → All
Summary: viewing an image three times corrupts web pages → viewing an image three times corrupts web pages [leaks file descriptors on all platforms]
Comment on attachment 86525 [details] [diff] [review]
v1 patch

good catch.  r=dougt
Attachment #86525 - Flags: review+
Keywords: mozilla1.0.1
Whiteboard: [adt1 RTM]
*** Bug 146357 has been marked as a duplicate of this bug. ***
Comment on attachment 86525 [details] [diff] [review]
v1 patch

a=asa (on behalf of drivers) for checkin to the 1.1 trunk.
Attachment #86525 - Flags: approval+
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Keywords: adt1.0.1
Resolution: --- → FIXED
tever - can you pls verify this one on the trunk? thanks!
Blocks: 143047
Keywords: nsbeta1nsbeta1+, verifyme
checked with asa's test case, image is now found after hitting back/forward a
few times.

verified trunk - 2002060708 - mac osX
Status: RESOLVED → VERIFIED
Whiteboard: [adt1 RTM] → [adt1 RTM][verified-trunk]
*** Bug 147761 has been marked as a duplicate of this bug. ***
please checkin to the 1.0.1 branch. once there, remove the "mozilla1.0.1+"
keyword and add the "fixed1.0.1" keyword.
adding adt1.0.1+ for checkin to the 1.0.1 branch.
Keywords: adt1.0.1adt1.0.1+
WFM under 1.1a (Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.1a)
Gecko/20020610)
verified branch - 07/18/2002 builds - win32, linux, mac
Keywords: verifyme
Whiteboard: [adt1 RTM][verified-trunk] → [adt1 RTM][verified-trunk][verified-branch]
Keywords: verified1.0.1
removing fixed1.0.1 keyword
Keywords: fixed1.0.1
*** Bug 141831 has been marked as a duplicate of this bug. ***
*** Bug 146957 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: