Last Comment Bug 758410 - Installs of service should not attempt to clear prefetch as indicated in maintenanceservice-install.log
: Installs of service should not attempt to clear prefetch as indicated in main...
Status: VERIFIED FIXED
[qa!]
:
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: 15 Branch
: x86_64 Windows XP
: -- normal (vote)
: mozilla15
Assigned To: Brian R. Bondy [:bbondy]
:
: Jim Mathies [:jimm]
Mentors:
Depends on:
Blocks: 692255
  Show dependency treegraph
 
Reported: 2012-05-24 15:06 PDT by Jason Smith [:jsmith]
Modified: 2012-06-12 17:45 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1. (1.98 KB, patch)
2012-05-24 18:05 PDT, Brian R. Bondy [:bbondy]
robert.strong.bugs: review+
Details | Diff | Splinter Review

Description Jason Smith [:jsmith] 2012-05-24 15:06:05 PDT
Steps:

1. Install the 5/23 Elm Build without the maintenance service previously installed, with a nightly build already installed, with pref set
2. Complete the installation but do not launch the browser
3. Check the maintenance log

Expected:

I'd expect to see no errors in relation to the prefetch service.

Actual:

The prefetch clear service happened on install (thought originally it was supposed to be on launch?). The PF files it targeted were not read only and greater than 0 KB. Log messages in maintenanceservice-install:

Clearing prefetch files...
Error replacing prefetch path FIREFOX.EXE-0196A814.pf (5)
Error replacing prefetch path FIREFOX.EXE-28641590.pf (5)
Done searching prefetch paths. (18)
Comment 1 Jason Smith [:jsmith] 2012-05-24 15:28:33 PDT
Also happens with the 5/18 elm build.
Comment 2 Jason Smith [:jsmith] 2012-05-24 15:32:20 PDT
Also occurs with the most recent elm build during an update from 5/18 --> 5/24.
Comment 3 Brian R. Bondy [:bbondy] 2012-05-24 15:34:45 PDT
This has no harmful effects but ya I'll provide a patch for only doing this on updates of the service.  The prefetch files would normally not be generated at the point you see in the log.  

Nice find :)

Maybe the access denied errors are because the install doesn't run as the system account in that case.
Comment 4 Jason Smith [:jsmith] 2012-05-24 15:39:15 PDT
Additional Notes:

I cleared the pref and launched firefox. The prefetch service isn't even running (been waiting for it to run for 6 minutes right now).
Comment 5 Jason Smith [:jsmith] 2012-05-24 15:40:37 PDT
(In reply to Jason Smith [:jsmith] from comment #4)
> Additional Notes:
> 
> I cleared the pref and launched firefox. The prefetch service isn't even
> running (been waiting for it to run for 6 minutes right now).

Oh wait, it finally ran. But that took a while...
Comment 6 Brian R. Bondy [:bbondy] 2012-05-24 15:43:13 PDT
The log message pasted in Comment 0 is from maintenanceservice-install.log right? (and not maintenanceservice.log)
Comment 7 Brian R. Bondy [:bbondy] 2012-05-24 15:46:23 PDT
oh ya sorry, I'm telling you one minute but this changed to 3 minutes recently.
Comment 8 Brian R. Bondy [:bbondy] 2012-05-24 15:46:55 PDT
> Oh wait, it finally ran. But that took a while...

.pf files are 0 bytes and read only right?
Comment 9 Jason Smith [:jsmith] 2012-05-24 15:47:37 PDT
(In reply to Brian R. Bondy [:bbondy] from comment #8)
> > Oh wait, it finally ran. But that took a while...
> 
> .pf files are 0 bytes and read only right?

Yes

(In reply to Brian R. Bondy [:bbondy] from comment #6)
> The log message pasted in Comment 0 is from maintenanceservice-install.log
> right? (and not maintenanceservice.log)

Yes
Comment 10 Jason Smith [:jsmith] 2012-05-24 15:54:18 PDT
(In reply to Brian R. Bondy [:bbondy] from comment #3)
> Maybe the access denied errors are because the install doesn't run as the
> system account in that case.

That's probably it. The machine I'm on (Windows XP) does not allow deletion of the PF files from the prefetch folder - likely a permissions issue with the account.
Comment 11 Brian R. Bondy [:bbondy] 2012-05-24 16:00:59 PDT
OK glad to know the system account running this helps some situations. Could you confirm that upgrades do clear the pf files on that same machine?

I think installs would run as the admin account you're logged in with and upgrades I think would run as the system account so should clear them.
Comment 12 Brian R. Bondy [:bbondy] 2012-05-24 16:09:57 PDT
I just confirmed my XP machine also can't delete the prefetch files when I try manually in explorer. I haven't tested with the service though, but per your previous comments I think this works.
Comment 13 Jason Smith [:jsmith] 2012-05-24 16:18:20 PDT
(In reply to Brian R. Bondy [:bbondy] from comment #11)
> OK glad to know the system account running this helps some situations. Could
> you confirm that upgrades do clear the pf files on that same machine?

That doesn't work for me. If I update from 5/23 to 5/24 on Win XP, I get the same error produced in this bug with the pref set. Note that I did uninstall the service before installing the 5/23 build.

Does updating from 5/23 --> 5/24 with an elm build having the pref set work for you? My maintenance-install log always is throwing the same error on each update.
Comment 14 Brian R. Bondy [:bbondy] 2012-05-24 16:21:54 PDT
I know why, because Windows XP doesn't use the service for installs by default so the operation wouldn't run as system account in that case.   The one time clear would use the system account though.
Comment 15 Jason Smith [:jsmith] 2012-05-24 16:32:18 PDT
(In reply to Brian R. Bondy [:bbondy] from comment #14)
> I know why, because Windows XP doesn't use the service for installs by
> default so the operation wouldn't run as system account in that case.   The
> one time clear would use the system account though.

A little confused. So this explains why updating isn't working on Win XP? Or am I missing something to understanding this?
Comment 16 Brian R. Bondy [:bbondy] 2012-05-24 16:33:49 PDT
So on Windows XP you can't clear prefetch using the admin account at all. Something I just realized from your findings.

The service command that runs after 3 minutes runs as the system account. Because it issues a command directly to the service.

The code to clear the prefetch that runs on update though on XP doesn't use the service, and so it doesn't use the system account.
Comment 17 Brian R. Bondy [:bbondy] 2012-05-24 16:50:23 PDT
I'll post to fix upgrades on XP in a new bug, but it doesn't need to be fixed until after v15.  In particular it would have to be fixed before v16->v17 since that's the first time this code would be hit.
Comment 18 Jason Smith [:jsmith] 2012-05-24 16:55:46 PDT
(In reply to Brian R. Bondy [:bbondy] from comment #17)
> I'll post to fix upgrades on XP in a new bug, but it doesn't need to be
> fixed until after v15.  In particular it would have to be fixed before
> v16->v17 since that's the first time this code would be hit.

Could you clarify why? Did a pre-req feature for this get moved to a different firefox release?
Comment 19 Brian R. Bondy [:bbondy] 2012-05-24 17:17:36 PDT
The code for the one time run after 3 minutes runs right away, but the code for the update should only run on the next update after this is installed.  For m-c that would be 16-17 and for Aurora that would be 15-16.  So as long as this lands on m-c in 16 then it's fine.
Comment 20 Brian R. Bondy [:bbondy] 2012-05-24 17:39:07 PDT
Re comment 19 and some comments before that, bug 758463 was posted for that.

This bug is being used for the problem confirmed in Comment 3, that an initial install should not attempt to clear prefetch, only updates and the one time only clear after 3 minutes.
Comment 21 Brian R. Bondy [:bbondy] 2012-05-24 18:05:34 PDT
Created attachment 627058 [details] [diff] [review]
Patch v1.

A quick one, we should not try to clear prefetch from installs since we do it already from the one time pref.
Comment 22 Brian R. Bondy [:bbondy] 2012-05-27 19:50:49 PDT
http://hg.mozilla.org/mozilla-central/rev/fb61360eab85

Note You need to log in before you can comment on or make changes to this bug.