aviaryan / Clipjump

:clipboard: Clipboard Manager for Windows, built in AutoHotkey
http://clipjump.sourceforge.net/
384 stars 62 forks source link

Latest version (12.3) keeps crashing #90

Closed dexusnl closed 8 years ago

dexusnl commented 8 years ago

Hi Avi,

The latest version keeps crashing. I'm not sure when it happens because the icon only disappears after I noticed it. Is there a debug mode or log file somewhere so I can give you some more info?

Best regards, Rob

aviaryan commented 8 years ago

Sorry but there is no debug mode ( #91 ) and I can't think of a way to debug this problem right now. So I will post here later when I have some news.

Gabr-F commented 8 years ago

Sorry, I've been meaning to report this but I wanted to do a couple more tests and have not managed to yet.

I studied quite a lot the issue.

It can apparently be solved by simply reverting (git revert) the huge commit a2ff21ab79bdfb4ba6927f311738a223361bb3e0.

I've been using the most recent version of master (de193ef8f3a88fa6350535410ad29c2fb3e53e09) with just that commit reverted for several weeks now, and I haven't noticed any problems. And I had no Clipjump crash at all with it.


On the other hand the official version, with that commit included, crashes extremely easily and in hard to reproduce situations.

I managed to find one way the crash happens every or almost every time (I remember a couple of occasions when it didn't, but they are so few that I might just have dreamed about them): Opening from the shell (not from inside the programs) Office files, or at least Word, Excel and Access files, and at least with Office 2003 on Windows XP - I haven't managed to test with other versions of either yet.

The problems seems likely to be related to the use of DDE, which the Office 2003 programs (I don't know why) use massively when a file gets opened from the shell. With other DDE programs though it occurs only occasionally - I even tried a DDE test software (from http://www.angelfire.com/biz/rhaminisys/), and Clipjump crashed pretty much randomly, and not even that often. I think thus that it is a race bug, which with Office happens everytime simply because there are so many DDE messages being exchanged (you can see them e.g. with Spy++) that some of them always end up having the right timing to provoke the problem.


To debug the problem you should enable DEP for all programs (or at least for Clipjump) if you haven't already: the crashes will happen even with DEP disabled, but the crash dumps will have a lot less information (I guess because the crash happens later, with the process in a much more damaged state).


The direct cause of the crash appears definitely to be the unload of the gdiplus.dll module and a subsequent reference to it without first reloading it.

I have the feeling that those gdiplus calls are used for loading the icon that appears when something strange ends up in the clipboard, so it's probably everything related to that.


The culprit might be the TT library in the commit I mentioned above, but it might also be a pre-existing mistake that just didn't provoke a crash without TT. It might even be an Autohotkey bug, who knows.


Keep in mind that I don't really know the Clipjump source, I had a look at it but I don't really know Autohotkey.


I can give you some more information on how I carried off the debugging, but hopefully this will be enough to put you on the right track. I actually hoped that you knew a better tool to debug Autohotkey programs, especially one that allowed tracing the code. I tried SciTE4AutoHotKey but that didn't even manage to tell me the last executed line. I think I found out where to look for the last executed line with WinDbg, but not for the call stack, and I think you'd need that or better a trace to find the real cause.

aviaryan commented 8 years ago

v12.3 works fine for me without any crashes. I will turn on DEP and report my findings later.

@Gabr-F It is interesting to note that the commit you refer to contains no new auto-executing code. It only has changes in functions which affect how Action Mode (or some of the other tooltips) will show up. That being said can you try crashing Clipjump after it has been just started ? In that way, I think that commit will be virtually ineffective.. Just for the record, the 'initializing Clipjump' tip doesn't use TT library.

This issue seems similar to #83 where Action Mode stopped showing up on certain systems. I believe some 'system update' might have done it because clipjump v11.6.1 which used to work perfectly before will not show action mode now. @dexusnl @Gabr-F Can you try v11.6.1 and report if the action mode shows up in it.

aviaryan commented 8 years ago

I just replaced TT with TooltipEx in remove-TT branch. Please try that source and see if that fixes this issue. https://github.com/aviaryan/Clipjump/tree/remove-TT

dexusnl commented 8 years ago

I have been trying the remove-TT branch since yesterday, no crashes as of yet.

aviaryan commented 8 years ago

Good to know, let's see for 2 more days before finalizing it.

aviaryan commented 8 years ago

@dexusnl Can you confirm once more before I merge remove-TT to the master branch

Gabr-F commented 8 years ago

Apologies for the late reply.

Yes, it works! I've been using the remove-TT branch for a couple of days, and had no crashes, the things that made it crash every time work flawlessly! I think you can release it.


It doesn't matter much anymore, but as to the other post:

aviaryan commented 8 years ago

I guess for displaying the 'Transferred to Clipjump' tooltip...?

TT was not used for this tooltip.

Some of those functions were called at some point when things are copied to the clipboard, right?

The only place TT was used was the Action Mode or the tip you see when you delete all clips from the paste mode.

By the way, did you understand the exact cause of #83?

No. The only thing I understood was that it was caused due to some change in the Operating System. The WM_SETFONT message sent to the tooltip to change its font to monospace (like in Action Mode) was somehow destroying the tooltip. I will experiment more on this sometime later.

aviaryan commented 8 years ago

remove-TT merged with master

dexusnl commented 8 years ago

Apologies for the late reply as well. I have been trying for at least 3 days with no crashes whatsoever. But you seem to have figured that out already.