Fixed: System Error: The handle is invalid

Bug reports concerning HxD.
Maël
Site Admin
Posts: 1127
Joined: 12 Mar 2005 14:15

Re: System Error: The handle is invalid

Post by Maël » 01 Oct 2018 21:10

It's actually recent, it just assumes you have an email client configured. There should also be a log file generated in the folder containing the executable.
But thanks.

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 01 Oct 2018 21:16

Yes I did install the stock Windows 10 Mail app which works with :mailto but alas it wasn't detecting it. Ah I didn't know it creates a log file as well. It turns out it can be found at %temp%/HxD64.madExcept/bugreport.txt so I have attached it.
Attachments
bugreport.rar
(5.84 KiB) Downloaded 54 times

Maël
Site Admin
Posts: 1127
Joined: 12 Mar 2005 14:15

Re: System Error: The handle is invalid

Post by Maël » 01 Oct 2018 23:26

It's now clear why it happens, and also explains why you see it and I don't.
It's a race condition. It is related to how quickly you start it after one another and other things as the amount of processors or how busy the system is etc., all of which affect delays and thread switching frequency.
I have seen it now as well, but very seldom. I wish there was an easy way to make it appear consistently or frequently at least.

I changed the logic of releasing threading primitives. Can you test if it works on your system (both 32 and 64 bit)? Same link as above. If not a bug report would help.

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 01 Oct 2018 23:58

It's good that at least you now know what causes it. I tested the new version (thank you for adding a save report) and managed to reproduce it within seconds at both x86 and x64. Both reports attached. I just open two files and switch rapidly between them 10 times or so followed by a window X close. This is just to reproduce it of course. I don't normally use HxD like that but it does happen often randomly with normal use too. If you want to see it, I suggest you try to debug v2.0 which would show it much much more often than 2.1, at least that was the case for me.
Attachments
Desktop.zip
(11.94 KiB) Downloaded 53 times

Maël
Site Admin
Posts: 1127
Joined: 12 Mar 2005 14:15

Re: System Error: The handle is invalid

Post by Maël » 02 Oct 2018 00:03

Yeah, I know the instructions. But race conditions are notoriously hard to reproduce, it's in their nature that they behave quite differently depending on the environment. Also there is nothing in 2.0 vs 2.1 that was changed that is related to this.

The amount/frequency of switching tabs is not related, it's just about how you open HxD (delays between opening it) and close it (given the error log).

Is "C:\Users\Plato\Desktop\11.8.50.3399_CON_H_D0_PRD_RGN.bin" the first or second file in the list you open?

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 02 Oct 2018 00:11

Yes you are right, just reproduced it by simply opening the two files and closing the program multiple consecutive times. The file you mentioned is the first.

Maël
Site Admin
Posts: 1127
Joined: 12 Mar 2005 14:15

Re: System Error: The handle is invalid

Post by Maël » 02 Oct 2018 23:06

I changed the logic internally so it is more robust against possible race conditions. It should also affect this bug.
Same download link as above.

Does it fix the bug for you?

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 03 Oct 2018 00:34

I was unable to reproduce with the latest test build so yes, it (probably) fixes the issue for me. I would have to test it on my daily schedule for some time to be certain but for now it seems to work.

Maël
Site Admin
Posts: 1127
Joined: 12 Mar 2005 14:15

Re: System Error: The handle is invalid

Post by Maël » 03 Oct 2018 01:02

Great. I made a prerelease package with all the currently available translations. Thanks for your help and let me know how things go so I can close this topic once we are confident it is fixed.

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

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 03 Oct 2018 01:59

Yes sure. I installed the pre-release version normally and will work with that for the next few days to verify. I noticed that the minimize issue is still there but maybe that hasn't been addressed yet.

Maël
Site Admin
Posts: 1127
Joined: 12 Mar 2005 14:15

Re: System Error: The handle is invalid

Post by Maël » 03 Oct 2018 16:43

Yeah, it's easier to handle when different bugs have each their own thread.
Fixed the minimize issue now as well, and updated the linked file.

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 03 Oct 2018 17:06

Indeed, initially I thought these two could be linked. I installed the latest build, minimize issue fixed and will continue to verify the lack of race conditions.

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 04 Oct 2018 15:44

No race condition but I was able to find two other issues:

1) HxD 2.1 Test Version: HxD does not remember the window size when opening more than 1 file at a time. Also, the sidebars have wrong proportions and appear even at small (i.e. 1 byte) files.

2) HxD 2.x or later: If you leave enabled the option to launch HxD at the last step of the setup/installation, any option changes will result in an error that no access is allowed. The 2nd time HxD is launched (manually), the options can be configured normally.

Maël
Site Admin
Posts: 1127
Joined: 12 Mar 2005 14:15

Re: System Error: The handle is invalid

Post by Maël » 04 Oct 2018 21:00

Can you post separate topics for each please? All mixed in this thread is becoming messy.

plutomaniac
Posts: 26
Joined: 30 Aug 2018 21:24

Re: System Error: The handle is invalid

Post by plutomaniac » 04 Oct 2018 21:31

No problem, opened a new thread for the second issue. The first issue happens only at the pre-release version currently testing. If you want another topic for that, I will create one.

Post Reply