Page 1 of 3

Fixed: System Error: The handle is invalid

Posted: 30 Aug 2018 21:34
by plutomaniac
Hello,

At HxD 2.0 I keep getting the System Error "The handle is invalid".

Capture.PNG
Capture.PNG (2.44 KiB) Viewed 2763 times

You can reproduce like so:

1) Open two files via the context menu (Open with HxD)
2) Switch from the 2nd file tab to the 1st
3) Switch from the 1st file tab to the 2nd
4) Try to close HxD from the X

You may need to switch between the tabs 2-3 more times in case it doesn't happen the first time.

I've also noticed that, when you "Open with HxD", the HxD window does not appear at the top like it should but stays minimized.

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 08:50
by Maël
Does it still happen with the newest release?

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 13:18
by plutomaniac
Hi,

Just tested v2.1 and yes both issues are still happening (error when switching tabs and exiting + minimize not maximizing when opening new file).

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 16:08
by Maël
Apparently, there is a detail that I do differently, since I can't reproduce it. Could you make a short video?

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 17:05
by plutomaniac
It seems to be more difficult to reproduce the invalid handle error at 2.1 but it is still there. The minimize issue remains the same. Here are two small videos which showcase the problems:

issues.rar:
https://mega.nz/#!bQNHySCL!lZm2XML6Sqac ... rbe4ZLQYfk

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 19:29
by Maël
Thanks, the minimize bug can be reproduced.

However I still don't manage to reproduce the invalid handle bug. I tried it on Win10 as well, 64 bit HxD.

If you have a virgin virtual machine, with no additional programs installed, does it happen as well?

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 21:30
by plutomaniac
Just tested on a 100% new & clean Windows 10 TH3 x64 installation which I had lying around. Same problem. I think it has to do with the window being maximized. Did you try to reproduce like that?

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 21:46
by Maël
I did. Maybe I'll just make a debug build with logging, to know what triggers it.

Re: System Error: The handle is invalid

Posted: 27 Sep 2018 23:38
by plutomaniac
Yes that might help and I can try it if you like. I use HxD all the time so that error is enough to make me go back to v1.7.7 if I must to.

Re: System Error: The handle is invalid

Posted: 01 Oct 2018 13:19
by Maël
Does it also happen if you close HxD using Alt+F4?

I wonder if this is maybe due to the menus or tooltip being highlighted/shown just before you click the X button to close the window, so precise timing/sequence of events matter.

I'll post a version with embedding logging later today.

Re: System Error: The handle is invalid

Posted: 01 Oct 2018 14:40
by plutomaniac
Yes I tested with Alt+F4 and it happens in that case as well, even if it is harder to reproduce at 2.1. At 2.0 it happened consistently. Honestly, I don't time anything precisely, it happens when working randomly too. Meaning, you would have certainly already stumbled across this issue if it was happening on your end as well. Since you tested Windows 10 x64, the only common thing I can think of between my current OS installation and the clean VM one is the 2nd keyboard language, literally nothing else. I doubt that is relevant, the logging will tell though.

Re: System Error: The handle is invalid

Posted: 01 Oct 2018 16:36
by Maël
I made a version of HxD that creates a log when an error occurs. Once I know the location where it happens, I'll add additional logging there, if needed.

https://mh-nexus.de/downloads/logginghxd.zip

The executables are the portable edition and can be run as is (settings will be created in the folder you extract it to). The language is German, since that is what I develop the original version with, but it shouldn't make a difference for this test.
Just make sure to remove the current HxD on your system from the Explorer context menu, and add the one from the ZIP file.

The created log(s) will be saved on your Desktop in a folder called HxDLog. Please send them to me. Thanks.

Re: System Error: The handle is invalid

Posted: 01 Oct 2018 18:21
by plutomaniac
It seems that the log does not help as it only shows that the program started. From what I can tell, that error is on the Windows side (maybe some bad call or some compile setting or compiler version etc). I run a simple debugger while HxD was running, caused the crash and got the attached report. The last line shows the exception (hopefully). Maybe that can help.

Re: System Error: The handle is invalid

Posted: 01 Oct 2018 20:02
by Maël
It seems the exception happens in another thread. This new logger should catch them all now.

The new "Button1" is to test if errors are caught and a bug report is created (a window will pop up) at all. To create the real report, you still have to trigger the bug as normal and send the report that comes up then.

Updated file, same link as above.

Re: System Error: The handle is invalid

Posted: 01 Oct 2018 21:04
by plutomaniac
Ok the new logger is much better. I reproduced it right away and generated a report. That logger is very old and wants to send it by email only for some reason and that functionality doesn't even work anymore so I had to take some pictures.

https://mega.nz/#!uQcCga7D!vZNKi8pdEcTM ... S8byZufLnc