chkdsk unmounting volume >> C0000006 exception

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
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

chkdsk unmounting volume >> C0000006 exception

Post by *MarcinW »

Hello, I found some ways to raise the C0000006 exception (EXCEPTION_IN_PAGE_ERROR / STATUS_IN_PAGE_ERROR). Steps to reproduce (tested on Windows XP with TC 9.0 beta3 32-bit):

1) Launch TC and ensure, that immediately after TC start, drive c: has been displayed at least in one panel.
2) Launch "chkdsk c: /f" command from the command line.
3) Chkdsk says that it needs to force the volume unmounting, because the volume is in use. Choose Yes to unmount.
4) Chkdsk says that all opened handles to the volume are invalid now.


Case A) Close TC. The following exception occurs randomly, but with high probability:

---------------------------
Application Error
---------------------------
Exception EExternalException in module TOTALCMD.EXE at 0026C6B8.
External exception C0000006.
---------------------------
OK
---------------------------


Case B) Select "Configuration -> Options..." or "Start -> Change Main Menu..." or "Help -> About Total Commander" or "Commands -> CD Tree". The following problem occurs:

---------------------------
Total Commander 9.0ß3
---------------------------
External exception C0000006.
(In-page I/O error or EResNotFound)

This error usually means that Total Commander or a DLL used by it
could not access its program file due to temporary network problems.

Continue execution?
---------------------------
Yes No
---------------------------


Maybe, in case B), the resource DLL could be reopened in case of the C0000006 exception.
Regards
umbra
Power Member
Power Member
Posts: 876
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

Making TC resilient to such drastic operation...
Out of curiosity, under what circumstances can such thing happen on its own, without user's explicit consent and he would still expect TC to run normally?
Windows 10 Pro x64, Windows 11 Pro x64
User avatar
hlloyge
Member
Member
Posts: 131
Joined: 2006-11-02, 23:14 UTC

Post by *hlloyge »

XP isn't supported by Microsoft anymore. Does the same happens on newer OS?
User avatar
Dalai
Power Member
Power Member
Posts: 10021
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: chkdsk unmounting volume >> C0000006 exception

Post by *Dalai »

MarcinW wrote:2) Launch "chkdsk c: /f" command from the command line.
3) Chkdsk says that it needs to force the volume unmounting, because the volume is in use. Choose Yes to unmount.
That won't even work when C: is your Windows/system partition, which is the case on the majority of systems (excluding all of mine). Chkdsk will require you to restart the system to check the system partition because it can't be unounted while the system is using it. So, in what ways is the reported issue relevant? In cases where TC is installed on a partition that is not the system partition - which are mostly portable TCs, I guess...

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Re: chkdsk unmounting volume >> C0000006 exception

Post by *MarcinW »

Dalai wrote:So, in what ways is the reported issue relevant?
Let's the Author decide.

It's also theoretically possible, that these errors are symptoms of some more serious problem, so it's sometimes worth to take a look even at such unusual cases.

Regards
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7011
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: chkdsk unmounting volume >> C0000006 exception

Post by *Horst.Epp »

MarcinW wrote:
Dalai wrote:So, in what ways is the reported issue relevant?
Let's the Author decide.

It's also theoretically possible, that these errors are symptoms of some more serious problem, so it's sometimes worth to take a look even at such unusual cases.

Regards
Its also theoretically possible that the World explodes while TC is running.
Hopefully Christian handles this case to :lol:
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

When some function calculates - let's say - a PI number and returns 4.1415 instead of 3.1415, it may be a math error - but also a symptom of some other problem, like other thread overwriting the memory.

Since I don't see any, even theoretical, connection between TC and the World, I don't worry about TC ;)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50856
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately there is nothing I can do - the crash happens outside of Total Commander, when Windows tries to load parts of its EXE into memory.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Maybe in Case A) you could add an additional exception handler around the 0026C6B8 (beta3) call, just to suppress the C0000006 exception?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50856
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately it would leave TC in an unstable state when part of its functions cannot be loaded from the EXE image.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

I think there is a safe and good solution for Case A):

Code: Select all

  try
    // make a call to 0026C6B8 here
  except
    on E:Exception do
    begin
      if Application.Terminated then
      if E is EExternalException then
      if Assigned(EExternalException(E).ExceptionRecord) then
      if EExternalException(E).ExceptionRecord^.ExceptionCode = STATUS_IN_PAGE_ERROR then
        Abort;
      raise;
    end;
  end;
By calling Abort instead of re-raising the original exception, we can avoid showing the error dialog if TC is just terminating (the error dialog is useless in this case) - while the execution path does not change.

If the Case A) code can be executed only when TC is terminating, the "if Application.Terminated then" line is not necessary.
Post Reply