renaming a file on read-only partition locks process as dead

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

renaming a file on read-only partition locks process as dead

Post by *leopoldus »

Simple accident try to rename a file on a read-only logical partition (say virtual volume with read-only status) or to move/copy a file on such partition under Windows 7 makes TC totally inaccessible: it tries to fulfill the command, but can not - and it hangs forever. Furthermore, it is not possible to interrupt the hanging TC process by any mean: closing by Windows proper commands or close button, killing a process from Task Manager or Process Explorer etc does not give any effect. The only way to remove the process is to reload Windows session.

The same bug was in earlier versions of TC, at least since 7.50.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunateky I cannot reproduce it, sorry. I tried with an SD-Card (write protect on) and an old floppy disk, and got an error almost immediately with both. How do you create a read only volume?
Author of Total Commander
https://www.ghisler.com
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

I had this type of problem several times with TrueCrypt virtual volumes, when the container file has the attribute "Read-only" in order to protect virtual volume from being modified.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hmm, sounds more like the driver of TrueCrypt is then hanging because it cannot write. Did you try the same in Explorer?
Author of Total Commander
https://www.ghisler.com
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

ghisler(Author) wrote:Hmm, sounds more like the driver of TrueCrypt is then hanging because it cannot write.
I'm not sure, whether your hypothesis can explain this fact, that it is not possible to kill TC process after a file renaming attempt fails.

ghisler(Author) wrote:Did you try the same in Explorer?
Windows 7 Explorer is so foolproof, that it does not even allow a user an attempt to start a wrong file operation. Explorer detects, that the volume is write protected and does not display such file operations as "Delete", "Rename" and "Cut" in the main menu and the context menu for files and folders on that partition and disables hotkeys relative to their command

In order to check your suggestion I've tried several other file managers at the same machine and virtual volume. Free Commander (http://www.freecommander.com/) and Speed Commander (http://www.speedproject.de) and XYPlorer (http://xyplorer.com/) give immediately a specific error message when trying to rename a file: "The media is write protected".

I love your TC as the best file manager in the world. But in this aspect TC's behavior seems not to be smart enough.
umbra
Power Member
Power Member
Posts: 876
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

Leopoldus, I cannot confirm this issue either. I tried various TrueCrypt volumes, VBox and VmWare virtual disks and Total Commander always showed a proper error message. I know it sounds like a cliché, but please make sure you are using the latest version of TrueCrypt (7.1a) and if so, try to reproduce it on a different computer.

You say, that when you experience this problem, TC cannot even be killed - that sounds like a hardware or (in your case) a driver error. Once, I had a broken DVD drive and any program, that tried to access it, ended up in the exactly same state as you are describing.

But I don't know, why it would affect only TC and nothing else. Have you tried to start a command prompt from TC and rename some file through it?
Windows 10 Pro x64, Windows 11 Pro x64
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

umbra wrote:Leopoldus, I cannot confirm this issue either. I tried various TrueCrypt volumes, VBox and VmWare virtual disks...
That's confusing... But as I can see, your system is 64-bits. I have forgotten to specify, sorry, that my machine is 32-bits, so I use Windows 7 Home x32 and Total Commander x32.
umbra wrote:But I don't know, why it would affect only TC and nothing else. Have you tried to start a command prompt from TC and rename some file through it?
As much as I understand all further operation after starting a command prompt from TC does not concern Total Commander itself anymore, but Windows command-line interpreter. Providing, that I'm right, what information could we get from this test?
umbra
Power Member
Power Member
Posts: 876
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

A command prompt started that way should be accessing the same set of system libraries and, if I'm not mistaken, have the same security privileges as the running TC. Meaning, it should be using the same functions as TC.
Windows 10 Pro x64, Windows 11 Pro x64
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

umbra wrote:Have you tried to start a command prompt from TC and rename some file through it?
Well, I've tested it. As I'd supposed, command prompt works 100% correctly. When trying to rename some file at the protected volume it gives the expected error message: "cmd.exe - Write Protect Error. The disk cannot be written to because it is write protected." and so on.

Once again, according to my understanding it does not regard Total Commander, but only Windows own command interpreter. But I'm not a specialist, sorry...
Last edited by leopoldus on 2012-07-23, 14:09 UTC, edited 2 times in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have just tested it with Truecrypt now, and I cannot reproduce the problem - I'm getting an error immediately. There must be something wrong with your Truecrypt installation.
TC cannot even be killed
No normal user mode program can prevent itself from being killed. Only drivers can prevent it. Therefore there must be problem in the driver, either in Truecrypt, or some other driver (e.g. a virus scanner).
Author of Total Commander
https://www.ghisler.com
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

2ghisler(Author)

Well, I'd try again to detect a cause. Could you give me some hints, what and how to check, regarding the two following detail:

1. No any other file manager besides Total Commander is affected with this issue.

2. In Total Commander is not EVERY disk writing operation is affected, but only file or folder RENAME attempt. All other disk writing attempts as, say, file or folder deleting or copying/moving a file to this read-only media is handled correctly, that is TC gives an expected error message, that disk is write protected.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

All you can do is check with "process monitor" from www.sysinternals.com what is going on. TC is using the function MoveFileW to rename the file, nothing special. I don't see any reason why this should cause a hang.
Author of Total Commander
https://www.ghisler.com
Post Reply