Page 1 of 2

TrackerV3 and AVG Free Edition

Posted: 30 Jun 2005 22:48
by peterbonge
I'm just testing the anti-virus program AVG Free Edition. Before installing this program closing TrackerV3 takes 1 second. But now (with AVG) it takes 5 seconds. That bugs me a little bit and TrackerV3 is the only program so far where I've noticed this delay.

Posted: 01 Jul 2005 02:05
by JustinF
I've also noticed this same behavior with McAfee anti-virus. I don't notice any apps other than TrackerV3 that have this delay.

Posted: 01 Jul 2005 10:54
by admin
Hmm, very interesting!! At the moment I have no idea what this could be but I sure look into it.

Do you have the same effect when you "Exit without saving"?

Posted: 01 Jul 2005 11:47
by admin
I made some tests with another virus scanner working in the background and could reproduce your results.

The slow-down happens when the INI-file is updated on exiting TrackerV3. TrackerV3's strategy (and maybe that's not a very common one, INI-files themselves being out of fashion) is to keep all settings in memory and only write them to disk on exit. This leads to several hundred file write operations, one after the other, and a virus-scanner which is configured to watch file write operations will slow this down considerably, of course.

The workaround is easy: exclude INI-files from your scanner's watch list. (Whether that's wise is a decision I cannot make for you.)

Posted: 06 Jul 2005 07:44
by spinner
admin wrote:I made some tests with another virus scanner working in the background and could reproduce your results.

The slow-down happens when the INI-file is updated on exiting TrackerV3. TrackerV3's strategy (and maybe that's not a very common one, INI-files themselves being out of fashion) is to keep all settings in memory and only write them to disk on exit. This leads to several hundred file write operations, one after the other, and a virus-scanner which is configured to watch file write operations will slow this down considerably, of course.

The workaround is easy: exclude INI-files from your scanner's watch list. (Whether that's wise is a decision I cannot make for you.)
I wonder why this behavior (with AVG Free) did not show up before. I know AVG went to version 7 sometime in the later part of last year. Is that the thing which changed? Or has TV3 changed something.

I don't think I can set AVG Free to ignore INI files specifically. I have already unchecked SCAN ALL FILES in Control center > Shield > Properties but TV3 is still slow to close.

In fact, as I think about it, the delay I am getting is far longer than it takes AVG Free to do an on-demand scan of a file so I suspect there may be something else going on somewhere else which is causing this problem.

If I use System Internal's FileMon I can see that TV3 is looping one or two hundred times performing these instructions:

07:37:49.217 TrackerV3.exe:4052 CLOSE C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS
07:37:49.217 TrackerV3.exe:4052 WRITE C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS Offset: 4096 Length: 4096
07:37:49.357 TrackerV3.exe:4052 OPEN C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS Options: OpenIf Access: All
07:37:49.357 TrackerV3.exe:4052 LOCK C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS Excl: Yes Offset: 0 Length: -1
07:37:49.357 TrackerV3.exe:4052 QUERY INFORMATION C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS Length: 6958
07:37:49.357 TrackerV3.exe:4052 READ C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS Offset: 0 Length: 6958
07:37:49.357 TrackerV3.exe:4052 WRITE C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS Offset: 6958 Length: 8
07:37:49.357 TrackerV3.exe:4052 SET INFORMATION C:\Program Files\TrackerV3\TrackerV3.ini SUCCESS Length: 6966
07:37:49.357 TrackerV3.exe:4052 UNLOCK C:\Program Files\TrackerV3\TrackerV3.ini RANGE NOT LOCKED Offset: 0 Length: -1

and then TV3 makes a very quick journey into the temp internet files of my profile and then the TEMP folder and then at last TV3 closes.

Now I have to say that my registry is hacked and hacked so there may be some problem of my causing. However ISTR that TV3 doesn't even access the registry although maybe some system modules it calls does need the registry.

One new weirdness is that when I launch TV3 it can start searching without me lift a finger. This may be unrelated but other slow closers can say if they have seen the same on their TV3 or not.

Posted: 06 Jul 2005 07:49
by spinner
admin wrote:Hmm, very interesting!! At the moment I have no idea what this could be but I sure look into it.

Do you have the same effect when you "Exit without saving"?
No. Not at all. If I select 'Exit Without Saving' then TV3 closes in a flash.

Posted: 06 Jul 2005 09:16
by Gandolf
I can confirm that if I "exit without saving" then it is instant. Writing to the ini file certainly takes longer than I would have expected, but it is almost certainly due to my AV software. I know the AV software certainly checks ini files for changes.

Posted: 06 Jul 2005 09:41
by peterbonge
spinner wrote:I don't think I can set AVG Free to ignore INI files specifically. I have already unchecked SCAN ALL FILES in Control center > Shield > Properties but TV3 is still slow to close.
"Scan all files" is off by default (I think). But if you uncheck "Scan documents" TV3 closes fast. But this isn't really an acceptable workaround.

Posted: 06 Jul 2005 10:13
by admin
spinner wrote:I wonder why this behavior (with AVG Free) did not show up before. I know AVG went to version 7 sometime in the later part of last year. Is that the thing which changed? Or has TV3 changed something.
No, this INI-writing part is as old as TV3 itself.
spinner wrote:If I use System Internal's FileMon I can see that TV3 is looping one or two hundred times performing these instructions...
...

and then TV3 makes a very quick journey into the temp internet files of my profile and then the TEMP folder and then at last TV3 closes.

Now I have to say that my registry is hacked and hacked so there may be some problem of my causing. However ISTR that TV3 doesn't even access the registry although maybe some system modules it calls does need the registry.

One new weirdness is that when I launch TV3 it can start searching without me lift a finger. This may be unrelated but other slow closers can say if they have seen the same on their TV3 or not.
- It's not a loop but one INI-value is written after the other.
- temp internet files? That might be the HTML-preview closing.
- yes, TV3 doesn't access the registry
- when you close in search mode, you will start again in search mode.

Posted: 06 Jul 2005 10:14
by admin
peterbonge wrote:... But if you uncheck "Scan documents" TV3 closes fast. But this isn't really an acceptable workaround.
Maybe you can exclude TV3's app dir from scan?

Posted: 06 Jul 2005 11:48
by peterbonge
admin wrote:
peterbonge wrote:... But if you uncheck "Scan documents" TV3 closes fast. But this isn't really an acceptable workaround.
Maybe you can exclude TV3's app dir from scan?
And then hackers could use this dir to savely start their viruses... Nevertheless it is not possible as far as I can see it.

Is it really true that TV3 does open, write and close the ini file for every single value? This would explain the delay. This would also be very bad if using TV3 from an USB stick. Isn't it possible to write all values at once?

Or why just save settings when they are changed? This would also solve the problem with lost settings when TV3 or Windows itself crashes.

Posted: 06 Jul 2005 13:03
by admin
peterbonge wrote:Is it really true that TV3 does open, write and close the ini file for every single value? This would explain the delay. This would also be very bad if using TV3 from an USB stick. Isn't it possible to write all values at once?
INI-file reading and writing is done by a set of standard core API calls that are as old as Windows itself, and the way I do it is just the way it is done since the beginning of time. There is no other way built in. But, see below...
peterbonge wrote:Or why just save settings when they are changed? This would also solve the problem with lost settings when TV3 or Windows itself crashes.
There are also advantages, for example the option to "Exit without Saving". BTW, TV3 does not crash :wink:

I could try a trick which should work if those scanners are after *.INI files looking like INI-files: temporarily write to some xyz.tmp file (hopefully ignored by the scanner) and then rename it to TrackerV3.ini. This way it should be scanned only once, right?
Or does AVG scan every file that is written?

Posted: 06 Jul 2005 13:43
by peterbonge
admin wrote:I could try a trick which should work if those scanners are after *.INI files looking like INI-files: temporarily write to some xyz.tmp file (hopefully ignored by the scanner) and then rename it to TrackerV3.ini. This way it should be scanned only once, right?
Or does AVG scan every file that is written?
I'm not sure. Here is a part of the help file:
Scan floppy drives – select this if you want Resident Shield to check the boot sectors of floppy disks.
Scan program files – select this if you want Resident Shield to check executable files (for example, files with extensions EXE, COM, DLL, OVL, etc.)
Scan documents - select this if you want Resident Shield to check OLE2 documents (for example, MS OFFICE documents, MS Excel templates – i.e. files with extensions DOC, XLS, XLA, etc.)
Scan email files – select this if you want Resident Shield to check saved E-mail messages (for example, files with extensions MSG, EML, etc.)

Posted: 06 Jul 2005 17:25
by admin
Enough speculation, let's get empirical! Please try the latest BETA.

Posted: 06 Jul 2005 17:36
by JustinF
I wish I had good news, unfortunately I still have the delay. :( Using McAfee virus scan v9.1.