Change attribute - slow?

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
lallous
Posts: 12
Joined: 30 Jan 2006, 19:39
Contact:

Change attribute - slow?

Post by lallous »

Hello

Has anyone noticed that AS25 (2.51, 2.52b1) perhaps older versions just hang a second or two each time you try to change file attributes of a file with the ctrl+f2 switch?

please note that these files are not in use. trying to change attributes with "attrib -r filename" is way faster than AS25

Please advise,
Elias
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

Elias, could you reproduce this problem on simple file with only "Archive" attribute? Just uncheck the only checked option and press OK.

Does it matter if file is on local hard disk, flash disk or network drive?
lallous
Posts: 12
Joined: 30 Jan 2006, 19:39
Contact:

Post by lallous »

1.
"Just uncheck the only checked option and press OK."

what do you mean?

2.
I just tried ctrl+f2 to remove archive bit and it works fast.
apparently, it is slow when I remove read-only bit.

can you please verify with a read-only file?
User avatar
SelfMan
Posts: 1142
Joined: 05 Apr 2006, 20:51
Contact:

Post by SelfMan »

Try to temporary turn off your antivirus. How it behaves then?
lallous
Posts: 12
Joined: 30 Jan 2006, 19:39
Contact:

Post by lallous »

i don't have A/V.

and besides, using dos prompt / "attrib -r" is just so fast.
only with AS25 and removing read-only attr causes the issue
User avatar
SelfMan
Posts: 1142
Joined: 05 Apr 2006, 20:51
Contact:

Post by SelfMan »

I've set and removed the read only atribute and there was no delay.
The only "problem" was that I had to click the read only checkbox twice to remove the mark. On first click it just greyed out as of "optional setting", on the second click it got removed. OK closed dialog immediately.
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

lallous wrote:I just tried ctrl+f2 to remove archive bit and it works fast.
apparently, it is slow when I remove read-only bit.
Could you reproduce this problem also on directory?

Could you please also check Hidden and System attributes?

The operating system is Windows XP?
Last edited by Jan Rysavy on 10 Feb 2009, 10:01, edited 1 time in total.
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

Another idea: select multiple files, for example 20 and try to set / remove the Read-only attribute in one operation. Is the delay same as with only one file selected?

(I'm looking into the code and trying to guess what could cause the delay.)
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

And another question: during the mentioned delay, is progress dialog box still visible? Is progress displayed as 100%?
User avatar
SelfMan
Posts: 1142
Joined: 05 Apr 2006, 20:51
Contact:

Post by SelfMan »

One more question. Are you using the attribute change in some CVS, SVN or other versioning tool? Are you using some nonstandard shell extensions?
lallous
Posts: 12
Joined: 30 Jan 2006, 19:39
Contact:

Post by lallous »

Hello,

1.

I attached a debugger and when I try to rename several RaiseException() calls were observed, here's the callstack:

WINDBG>k
ChildEBP RetAddr
08bee200 004dac19 kernel32!RaiseException+0x53
WARNING: Stack unwind information not available. Following frames may be wrong.
08bee24c 004dac3e salamand+0xdac19
08beeb8c 0040d9d9 salamand+0xdac3e
08beebbc 0040da46 salamand+0xd9d9
08beff80 23907af9 salamand+0xda46
08beffb4 7c80b713 SALRTL!beginthreadex+0xca
08beffec 00000000 kernel32!BaseThreadStart+0x37

another RaiseException() callstack:
06cceb10 004dac3e salamand+0xdac19
06cceb44 004b7b2d salamand+0xdac3e
06cceb60 004b7b85 salamand+0xb7b2d
06cceba0 004b7bfc salamand+0xb7b85
06ccff68 2241548f salamand+0xb7bfc
06ccffb4 7c80b713 regedt!SalamanderPluginEntry+0x2d72
06ccffec 00000000 kernel32!BaseThreadStart+0x37

Then I wanted to see if there is any explicit calls to Sleep() and indeed:

salamand.exe:00443A64 mov byte ptr [ebp+var_4], 2
salamand.exe:00443A68 cmp eax, ebx
salamand.exe:00443A6A mov [esi+540h], ebx
salamand.exe:00443A70 jbe short loc_443A79
salamand.exe:00443A72 push eax
salamand.exe:00443A73 call Sleep


Here's log to Sleep() calls:

Sleep(30)
7C8106E9: thread has started (tid=3940)
7C8106E9: thread has started (tid=3944)
Debugger: thread 3944 has exited (code 0)
Debugger: thread 3940 has exited (code 0)
Debugger: loaded C:\WINDOWS\system32\psapi.dll
Debugger: unloaded C:\WINDOWS\system32\psapi.dll
Sleep(30)
7C8106E9: thread has started (tid=2748)
7C8106E9: thread has started (tid=2752)
Debugger: thread 2752 has exited (code 0)
Debugger: thread 2748 has exited (code 0)
Debugger: loaded C:\WINDOWS\system32\psapi.dll
Debugger: unloaded C:\WINDOWS\system32\psapi.dll
Sleep(30)
Sleep(60000)
7C8106E9: thread has started (tid=3424)
7C8106E9: thread has started (tid=3432)


Notice, that sometimes Sleep is called with 60000 MS -> 1 second

Under the debugger, the delay behavior changed, but still occasionally an exception occurs and Sleep() with higher intervals is used.

2.
Jan: tried with many files, no delay, it was fast, and the Sleep() calls were with interval = 30ms

3.
nonstandard shell extension? yes, WinRar, winZip, perforce (but on my home pc i don' thave perforce and still same rename issue)
Selfman: RCS = Perforce

Please advise about the exceptions / delays in the code.

Regards,
Elias
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

Thank you for the feedback.
lallous wrote:Notice, that sometimes Sleep is called with 60000 MS -> 1 second
You probably mean 1 minute. Did you notice some 60s delays?
lallous wrote:salamand.exe:00443A64 mov byte ptr [ebp+var_4], 2
salamand.exe:00443A68 cmp eax, ebx
salamand.exe:00443A6A mov [esi+540h], ebx
salamand.exe:00443A70 jbe short loc_443A79
salamand.exe:00443A72 push eax
salamand.exe:00443A73 call Sleep
Are we talking about AS 2.52 beta 1?
lallous wrote:Jan: tried with many files, no delay, it was fast, and the Sleep() calls were with interval = 30ms
So when you select just one file (no other file is selected) and press Ctrl+F2 and remove the Read-only attribute, you notice the 2s delay.

When you select two (or more) files and do the same, there is no delay?

Could you please confirm it?
lallous
Posts: 12
Joined: 30 Jan 2006, 19:39
Contact:

Post by lallous »

You are right, 1 minute, however it is weird that a 60000 delay (1 minute) was logged but it did not take place, it was a second or two freeze. Probably it was the time spent in exception handling.

Yes, AS2.52b1


"So when you select just one file (no other file is selected) and press Ctrl+F2 and remove the Read-only attribute, you notice the 2s delay. "

It is happening randomly, after I restarted my PC and attached a debugger to AS252b1 exceptions occured on rename and the delay was experienced.
After I repeat couple of times no more exceptions and no more delays.

On another PC I have same delay issue.

So the delay is not related to the number of files, it could happen with one file or more, you don't see progress bar, but AS252 just freezes for at most 2secs.
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

OK, could you please also answer my other questions? Please walk carefully through whole thread. Thank you.
lallous
Posts: 12
Joined: 30 Jan 2006, 19:39
Contact:

Post by lallous »

I thought I did,

* You probably mean 1 minute. Did you notice some 60s delays?
as said, no, just one or two secs

* Are we talking about AS 2.52 beta 1?

yes,

* So when you select just one file (no other file is selected) and press Ctrl+F2 and remove the Read-only attribute, you notice the 2s delay.

one file or many files, it happens when removing readonly attribute.
if debugger is attached, this behavior manifests only one time, then works normally.


finally, if i need to reproduce this, I would have to restart my PC. If I don't attach a debugger, it will keep on wasting 2 secs on each rename. if i attach dbg once, then the wait happens once.

if you need more feedback plz tell me.
Post Reply