Crash during message handling

Please report only one bug per message!

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
nsp
Power Member
Power Member
Posts: 1856
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Crash during message handling

Post by *nsp »

I use a small script with nirsoft nircmd to highlight a file present in clipboard and scroll to it using :

Code: Select all

win sendmsg class TTOTAL_CMD 0x433 0x7F1 0
win sendmsg class TTOTAL_CMD 0x433 0x805 0
I i do not add wait time TC crash or is sometime frozen for half a second.

The OS is windows 7 64bit
Computer have 8Go of ram and cpu is CoreI5 2405S at 2.5Ghz

Code: Select all

---------------------------
Total Commander 8.01
---------------------------
Access violation at address 00559772. Read of address 00000000.
Access violation at address 00559772. Read of address 00000000
Windows 7 SP1 6.1 (Build 7601)

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

Windows exception: C0000005
Stack trace:
00559772
697803  559446  559843  647510  63743A  444AD1
446A22  >423F38  445FE3  423F38  429556  42969C
6D9F34  
Raw:
423F38  697803  559446  445F51  423F38  446D9B
444AD1  446CF1  4460A5  446A22  446A45  445FE3
4484A3  45A69C  4E99A9  559843  647510  6B001E
446D7E  444AD1  602366  636879  446D3F  4267A5
444AD1  402E4A  444AD1  446CF1  425C14  4460A5
446A22  446A45  423F38  445F51  423F38  63743A
444AD1  446CF1  447158  425C14  4460A5  446A22
423F38  445FE3  423F38  429556  42969C  429856
6D9F34  
Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Oui   Non   
---------------------------
Last edited by nsp on 2012-10-04, 13:43 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49100
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The error occurs in function LoadSelFromClipOrFile() which loads a selection from the clipboard or a file.

It occurs at:

Code: Select all

while p[0]<>#0 do begin
Where p is a pointer to the clipboard data (which is apparently a NULL pointer).

You seem to be using cm_loadselectionfromclip. Unfortunately I couldn't find any situation where this would crash, but you should double check the data you pass to the clipboard. Make sure that you end each name with <cr><lf> (characters #13 and #10).
Author of Total Commander
https://www.ghisler.com
User avatar
nsp
Power Member
Power Member
Posts: 1856
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

ghisler(Author) wrote:The error occurs in function LoadSelFromClipOrFile() which loads a selection from the clipboard or a file.

It occurs at:

Code: Select all

while p[0]<>#0 do begin
Where p is a pointer to the clipboard data (which is apparently a NULL pointer).

You seem to be using cm_loadselectionfromclip. Unfortunately I couldn't find any situation where this would crash, but you should double check the data you pass to the clipboard. Make sure that you end each name with <cr><lf> (characters #13 and #10).
AS the complete script also fill the clipboard, I already got such error in C because i was not respecting the following sequence :

Code: Select all

Loop xxx times to get clip handle with OpenClipboard(NULL)
if OK 
  GetClipboardData
  GlobalLock
   -->Read data in local buffer <--
   GlobalunLock
   CloseClipboard
   Use your local buffer
endif  
I do not have the error if i put a wait time before sending windows messages.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 49100
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC is not copying the data to a local buffer, it access the buffer directly which it gets with GlobalLock. The buffer shouldn't go away as long as the memory is locked with GlobalLock.

How can I reproduce the error? Can you post what exactly you write to the clipboard, please?
Author of Total Commander
https://www.ghisler.com
Post Reply