Closed Bug 97408 Opened 23 years ago Closed 19 years ago

download progress information is garbled

Categories

(Core Graveyard :: File Handling, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME
mozilla1.0.1

People

(Reporter: mozilla.org, Assigned: beard)

References

()

Details

(Whiteboard: patch, review)

Attachments

(6 files, 1 obsolete file)

With Mozilla 2001082805 on Mac OS X 10.0.4:

Visit the URL and choose to Save this file to Disk.

The download progress dialog shows nonsense numbers under Status, Time Left, and
Elapsed Time.
Looks like this doesn't happen all the time, but it happens sometimes.
the next time you see this, could you pls attach a screenshot?

i don't think i've seen this recently...
Here's a screen shot of the problem (with 2001082905). Notice that the kb/sec is
negative, and there are minus signs in the time left and elapsed time columns.
The seconds column of elapsed time seems to count up -59, -58, -57 .... I didn't
really catch any other patterns.

This doesn't happen with every download. I don't know what conditions cause this
to happen.
Evidently Mozilla can get in a state where some of the time values that should
be positive integers come up negative.

The 0-0 format comes about when the formatSeconds function adds leading 0s to
the negative numbers.

http://lxr.mozilla.org/seamonkey/source/xpfe/components/ucth/resources/helperAppDldProgress.js
*** Bug 97699 has been marked as a duplicate of this bug. ***
Confirming due to second report. (I have not been able to duplicate however.)

Not sure if this is the right component, though. Blake?
Status: UNCONFIRMED → NEW
Ever confirmed: true
->trudelle for triage.

pink, have you seen this?
Assignee: blakeross → trudelle
i have not seen this, but i haven't played much with this dialog. pchen is 
probably a likely owener for this bug.
Assignee: trudelle → pchen
marking p3 and mozilla1.0
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.0
spam: over to File Handling. i have not changed the assigned developer [or the
other fields for that matter], so if anyone realizes that a bug should have a
more appropriate owner, go ahead and change it. :)
Component: XP Apps: GUI Features → File Handling
*** Bug 106175 has been marked as a duplicate of this bug. ***
moving to mozilla0.9.8
Target Milestone: mozilla1.0 → mozilla0.9.8
Pushing out to mozilla1.0.1
Target Milestone: mozilla0.9.8 → mozilla1.0.1
This still happens with Mozilla 0.9.6 on Mac OS X 10.1.1. Don't know about newer
code.
*** Bug 115449 has been marked as a duplicate of this bug. ***
changing platform to all since at least two of the duped bugs (including the one
from me) are on mac os 9.x.

i have seen this more often since switching to mac os x (10.1.x). it seems to be
very likely after having mozilla open for several hours, and with an opperating
system and a browser that don't crash i don't see many other reasons to ever
quit moz.
OS: MacOS X → All
i poked at the code a little bit, and have an idea for a quick fix, i think.
now stays good, but startTime does not get set correctly. i think i am going to
do something like if (startTime > now) startTime = now; which will give
unreasonably high  KB per second at the begining of a transfer, like the old
code will, but it seems like a good backup to me.
Attached patch workaround patch (obsolete) — Splinter Review
I put together a simple patch. It checks to see if startTime > now, and if so
sets StartTime = now and sets missedBytes to the amount downloaded so far.
Download speed now factors in missedBytes.

I still don't know what is causing a bad value with startTime, but this gives
accurate results even when startTime is wrong.
Whiteboard: patch, review
i doubt pchen will be of much help on this. reassigning to default owner.
Assignee: pchen → law
Status: ASSIGNED → NEW
This bug is still present in Mozilla 2002022108 (OS/2), apparently.  Screen
shot (download.jpg, attached) shows the problem on this platform/build.
*** Bug 129382 has been marked as a duplicate of this bug. ***
Timothy: could you try my patch and see whether that fixes it for you?
*** Bug 130320 has been marked as a duplicate of this bug. ***
Attachment #64352 - Attachment is obsolete: true
*** Bug 130871 has been marked as a duplicate of this bug. ***
As a note, a lot of the dups are on OS/2.  What do OS/2 and mac have in common?
Hardware: Macintosh → All
eero.juhola@capgemini.fi: would you be willing to try my patch? anyone on OS/2?
Don't all speak up at once now.
I am taking a look at this for OS/2.  Yes, mStartTime is getting set
incorrectly, at nsProgressDialog.js:95 ("set startTime(newval)   { return
this.mStartTime = newval/1000; }").  The mStartTime value gets set correctly at
line 55 (constuctor), but someone else is passing in a bogus value that is
greater than the current time, such that elaspedTime becomes negative.

I am trying to put dump() statements in the code, but I cannot get it to work. 
I enabled the pref in Pref->Debug, but nothing shows up in either the console or
JavaScript console.  Any ideas on how I can make dump() work?
OK, this single line patch fixes the issue for me:

Index: nsProgressDialog.js
===================================================================
RCS file: /cvsroot/mozilla/embedding/components/ui/progressDlg/nsProgressDialog.js,v
retrieving revision 1.5
diff -u -r1.5 nsProgressDialog.js
--- nsProgressDialog.js	2002/02/20 07:54:04	1.5
+++ nsProgressDialog.js	2002/03/14 21:34:39
@@ -92,7 +92,7 @@
     get observer()          { return this.mObserver; },
     set observer(newval)    { return this.mObserver = newval; },
     get startTime()         { return this.mStartTime; },
-    set startTime(newval)   { return this.mStartTime = newval/1000; }, //
PR_Now() is in microseconds, so we convert.
+    set startTime(newval)   { return; },
     get lastUpdate()        { return this.mLastUpdate; },
     set lastUpdate(newval)  { return this.mLastUpdate = newval; },
     get interval()          { return this.mInterval; },

I think the incorrect value that is being passed in comes from
nsExternalHelperAppService.cpp:1394.  I'll look into this next.
OK, I took a look at nsExternalHelperAppService.cpp, and the values that they
are passing to SetStartTime() are correct.  I think the bug is actually in the
xptcall code.  Somehow, the value is getting mangled when it goes from C++ to
JavaScript.  Maybe both OS/2 and Mac don't handle 'long long' well.
Attached patch OS/2 patchSplinter Review
The problem on OS/2 was in the xptcall code.  We were not properly handling the
high bit of the long long.  

I have not looked at the Mac code, but I think that it may also have an issue
in xptcall.
Comment on attachment 74234 [details] [diff] [review]
OS/2 patch

r=mkaply
sr=blizzard (platform specific code)
Attachment #74234 - Flags: superreview+
Attachment #74234 - Flags: review+
cc'ing beard on the question of Mac PPC xptcall stubs code perhaps not properly
handling long long.
Comment on attachment 74234 [details] [diff] [review]
OS/2 patch

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #74234 - Flags: approval+
has the OS/2 patch landed? time is running out.
Os/2 patch has landed

I don't understand why we have heard nothing from the Mac folks on this.
Because on the mac it not easily reproduceable, and truth be told i have not
seen it for quite some time.

It would be nice if someone followed in your footsteps and killed this thing on
mac too, but i'm not sure if anyone at netscape has ever seen this (on mac), and
i don't really have the capabilities to dl/compile a package the size of moz.
beard understands the xpt stuff. over to him for some mac luvin
Assignee: law → beard
I haven't seen this for a long time on Mac builds either.
Status: NEW → ASSIGNED
yes, this does still happen. my 3/31 build is doing it as we speak on osx.
Keywords: nsbeta1
Just downloaded OS/2 build 20020402 and can report that the problem 
is now gone on this platform at least. 

*** Bug 135377 has been marked as a duplicate of this bug. ***
*** Bug 135383 has been marked as a duplicate of this bug. ***
*** Bug 136052 has been marked as a duplicate of this bug. ***
*** Bug 136201 has been marked as a duplicate of this bug. ***
*** Bug 144358 has been marked as a duplicate of this bug. ***
GIF screenshot showing RC2 garbled download times, Mac OS 9.2
As I pointed out before, someone needs to debug the long long xpt code on Mac
bryner, would you take a look at this?
Keywords: nsbeta1nsbeta1-
QA Contact: sairuh → petersen
No activity in three years and I have not experienced this problem in a long
time. Please reopen this bug if you still see this problem in recent versions.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: