[8.0ß3-x32] Crash when using plugin which was not loaded

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

[8.0ß3-x32] Crash when using plugin which was not loaded

Post by *Flint »

I have a WDX plugin that implements Unicode functions only. When I try to use it in TC I get a crash:

Code: Select all

---------------------------
Total Commander 8.0Я3
---------------------------
Access violation at address 023D2C43. Read of address 023D2C43.
Access violation at address 023D2C43. Read of address 023D2C43
Windows XP SP3 5.1 (Build 2600)

Please report this error to the Author, with a description
of what you were doing when this error occurred!

Windows exception: C0000005
Stack trace:
023D2C43
4451E9  445B66  4235A4  445127  4235A4  416345
416718  685880  6837B7  6CCE95  5E1C9A  4451E9
445B66  4235A4  445127  4235A4  44776E  6CA7A7
6C3E98  68EFE2  62CDA1  62D0D0  443C15  445B66
>4235A4  445127  4235A4  428C70  428D08  6CDA1B

Raw:
682E81  402235  4033BC  4021B4  6CA6A5  6CA500
4193C9  47001E  41D276  41D2B1  6CB6C3  6CA6ED
47001E  445095  4235A4  445EDF  443C15  445E35
445E35  435465  4451E9  445B66  445B89  4235A4
445127  4235A4  402235  4033BC  4021B4  4166B8
416345  416718  685880  5D9A49  67DC66  67D319
67FE92  67DC66  67D4AB  6CA33B  683111  6CA33B
67EA00  67FE92  40208E  402212  402235  6823D7
682B90  67D4AB  6CA33B  683111  6CA33B  67EA00
40208E  402212  402235  6823D7  682B90  6CA291

Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Да   Нет   
---------------------------
PS: Yes, I know that I need to implement some non-Unicode functions in order to make TC load the plugin. But if they are not exported TC must not crash, it must just not load the plugin.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for your report. Do you get this crash also in Total Commander 7.56a?
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author) wrote:Do you get this crash also in Total Commander 7.56a?
No. In 7.56a I just get empty fields in the plugin-specific columns, just as it should be.

Version 8.0 instead starts displaying the files very slowly, one-by-one (~2 files per second), as if they were on a slow network drive, and after several files appear like that, TC crashes.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I will check it, thanks!
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I checked it now - the crash occurs when TC calls function:
contentplugin.ContentSendStateInformationW()

TC tests in advance whether the function exists or not. Could you check whether there is a problem within that function? I don't currently see why there should be any difference between TC 7.56a and TC 8.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author) wrote:TC tests in advance whether the function exists or not. Could you check whether there is a problem within that function? I don't currently see why there should be any difference between TC 7.56a and TC 8.
I ran the TC+plugin in a debugger. Breakpoint inside ContentSendStateInformationW did not trigger at all.

When I ran through debugger I saw that TC numerous times loaded and unloaded the plugin. My reconstruction of events: TC needs to display a column which requires the plugin. TC loads the plugin into its address space (initialization routines of the plugin are indeed called), then it checks for necessary exported functions. It does not find ContentGetValue, so TC desides it's a bad plugin and unloads it; the field is displayed empty. Then next field is going to be displayed. Again, the same plugin is required for it, so TC again tries to load it, fails, unloads and displays empty contents. And so on.

Probably, during this process some internal corruption happens inside TC, because when I tried to reproduce the crash now, first I could not (all fields showed correctly, though very slowly), but after that when I clicked on one of the files in TC, I got another crash:

Code: Select all

---------------------------
Total Commander 8.0Я4
---------------------------
Access violation at address 042F2C3E. Read of address 042F2C3E.
Access violation at address 042F2C3E. Read of address 042F2C3E
Windows XP Pro x64 SP2 5.2 (Build 3790)

Please report this error to the Author, with a description
of what you were doing when this error occurred!

Windows exception: C0000005
Stack trace:
042F2C3E
402235  6CA764  4193D9  41D286  4450A5  4235B4
4451F9  445B76  4235B4  445137  4235B4  402235
416355  416728  685A44  445B76  4235B4  443C25
445B76  4235B4  5E1DA6  62F28B  443C25  445B76
4235B4  4450A5  4235B4  4451F9  445B76  4235B4
6CAA0B  6C40FC  68F23E  62CF39  62D268  443C25
445B76  >4235B4  445137  4235B4  428C80  428D18
6CDC7F  
Raw:
683045  402235  4033BC  4021B4  6CA909  6CA764
4193D9  640063  61004A  41D286  41D2C1  6CB927
6A2A57  6CA951  640063  61004A  4450A5  4235B4
445EEF  443C25  445E45  445E45  435475  4451F9
445B76  445B99  4235B4  445137  4235B4  402235
4033BC  402209  4033BC  4166C8  416355  416728
685A44  5D9B55  67D66F  6CA59F  4C0063  6CAB67
6C3B1C  6CA4F5  6C6A23  6CA4F5  6C6A23  6CA951
6CAA4B  6C6C8F  6C6B01  6CA951  6CAA4B  6C6C8F
6C6CBD  6C6CCC  6C6A94  6C7234  6C7243  6C72B6

Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Yes   No   
---------------------------
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

When I ran through debugger I saw that TC numerous times loaded and unloaded the plugin.
Interesting, do you get this behaviour also in TC 7.56a?
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author) wrote:Interesting, do you get this behaviour also in TC 7.56a?
Yes, if I set breakpoint in DllMain function it is called numerous times. However, I did not investigate how often TC loads the library: for each file or for each field it tries to display.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, maybe I should set a flag "loadTried", and not try to load the dll again until TC is restarted (or after using cm_unloadplugins).
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author) wrote:OK, maybe I should set a flag "loadTried", and not try to load the dll again until TC is restarted (or after using cm_unloadplugins).
Or until the plugin is reinstalled. Yes, I think this is a good idea.

However, it doesn't look to me like the source of the crash…
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author)
Thank you. Seems to work fine in 8.0β5.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks! The problem was that the other function variables were still assigned (from GetProcAddress), but the dll was unloaded. I'm setting them to NULL now when unloading the dll.
Author of Total Commander
https://www.ghisler.com
Post Reply