Pelles C forum

Pelles C => Bug reports => Topic started by: DMac on August 18, 2025, 01:19:53 AM

Title: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: DMac on August 18, 2025, 01:19:53 AM
While debugging code in POIDE v13 a call to GetOpenFileName() caused the application I was debugging to freeze.  Attempting to close the debugger when this happens mostly does not work, Task manager fails to work properly, and the only way to close the application and POIDE is to shut down the computer and reboot.

After reboot the POIDE open file dialog may not work, necessitating a reinstall of the IDE.

I have attached a test project to recreate this scenario.  I recommend testing this on a PC that does not contain critical data because of the ornery nature of the failure.

GetOpenFileName() does not cause lockups when compiled to Release.

Tested on Windows 10 Professional.
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: John Z on August 18, 2025, 07:38:01 AM
Hi DMac,

I'll grab it look it over and possibly try.  I use GetOpenFileName() extensively in my programs, under all versions of Pelle and Windows.  Haven't see a problem, maybe some interaction.  Could be interesting but frustrating .... Perhaps I'll add your debug mode to one of my programs first....

John Z

My reply form is missing those smileys for some reason, the 'don't use option' is unchecked too.
Anyone else or just my Firefox?
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: John Z on August 18, 2025, 08:45:54 AM
Hi DMac,

Well so far I've tested the 64 bit version, it worked both with and without debug and I saw no issue.
I did a clean and rebuild and it was the same.

For 32 bit the first run did get a debug error but just cleared it and no system or IDE issue.
I did a clean and rebuild and it worked both in debug and release modes without any issue.

I'm on Windows 23H2 and Pelles C v13  - but I think it is not relevant.
Looks like (so far) you perhaps have some other issue affecting your system/build

I'll try a few more runs, but all looks good so far.  Definitely no IDE hang, reboot, or re-install of Pelles C.

Don't know if this is exactly good news for you - -

John Z

One thing to note, I did not use the workspace - ? Could that have an impact ?
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: TimoVJL on August 18, 2025, 09:14:20 AM
In Windows 7 it didn't hang, but trying to open file dialog again, strange behavior  :(
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: DMac on August 18, 2025, 07:03:27 PM
Hi John,

I'm on 22H2 also.  However this machine is a work laptop.  There are things IT has configured or are running on it that could perhaps contribute to the problem.  I'll try the test on my home pc and see if I get the same results or if, like Timo, see some strange behavior after several tries.



Title: Re: Debugging code that calls GetOpenFileName() Freuildingezes POIDE v13
Post by: John Z on August 18, 2025, 11:33:14 PM
Hi DMac,

I tried it using the workspace today, again no issue seen.  So I'm posting my compiled version of your program, no changes.  With this you might try to just run the .exe's within the IDE to see if everything run without errors, without a rebuild.  Might be enlightening, hopefully?

23H2 btw..

John Z

traveling in China right now so I don't have access to my windows 7 machine....to see Timo's findings

Get project zip from next post..
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: John Z on August 18, 2025, 11:43:53 PM
Got a weird error when the prior message attachment uploaded, so attaching again as well as the error message.

Maybe filename too long shortened it and posted again, no error msg.

John Z
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: DMac on August 19, 2025, 01:27:26 AM
Hi John,

I tried the project you attached.

I get the same strange behavior.  I have screen captured an internal debugger error which might provide some clues.  I also provide a screenshot of the file browser dialog when it hangs.

When this happens I have to reboot the machine to get the dialog working again.

I think I'll forego trying to debug this on the work laptop going forward.
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: John Z on August 19, 2025, 02:32:08 AM
Hi DMac,

Yes very strange - same .exe run on different systems . . . . drastically different results.
Could it be an antivirus tool doing something, I wonder.  At a loss for now since I can't reproduce :( and
I only have one laptop with me - of course ....

Maybe Timo can try the .exe's I posted too.

John Z

Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: TimoVJL on August 19, 2025, 05:21:22 AM
Example works normally in Window 10 x64 22H2
In same session, second time to open file dialog have to activate debug window and from Debug -> Break to get dialog visible.
Title: Re: Debugging code that calls GetOpenFileName() Freezes POIDE v13
Post by: John Z on August 20, 2025, 12:07:57 AM
Timo's finding is confirmed in Win 23H2 .

Running without debug one can click the Open File Dialog button as many times as wanted.  Running under debug issues start to show up on the second click of the Open File Dialog button.  I needed to do a break on the debug menu then hit Go/Debug button again to get access to the dialog.

John Z