Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Viewer crash when network error & dialogs

Developers may discuss here
Post Reply
jhansen
8
8
Posts: 9
Joined: 2012-12-21 14:02

Viewer crash when network error & dialogs

Post by jhansen »

Hi,
I'm a developer, working on fixing this problem:
If the server is killed or the network disconnects, etc. vncviewer cleans up properly unless a dialog is open. If the file transfer or options dialog is open, the shutdown logic crashes. The WM_CLOSE seems to delete some objects when they still have message loop running.
Any ideas how to make this clean up nicely?
When the viewer crashes like this, on win 7 or 8 it seems to hang but not go away, and even task manager "end task" doesn't kill it, but sends a message to the viewer process. So its ugly in this state.

Thanks,
Jim
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Viewer crash when network error & dialogs

Post by Rudi De Vos »

Gonna try to repeat it
jhansen
8
8
Posts: 9
Joined: 2012-12-21 14:02

Re: Viewer crash when network error & dialogs

Post by jhansen »

More info, building on vs 2012, testing on win 7 & 8
when options dialog is open, or a file transfer is active, the network disruption causes crash or hang.
When just the file transfer dialog is open it does shut down clean if you know the error dialog is behind the ft dialog.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Viewer crash when network error & dialogs

Post by Rudi De Vos »

Updated source (svn) for the option window.
We just need to set the viewerwindow as parent for the option box.

The messageboxes also require the ontop value, else it look like the window is locked...checking
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Viewer crash when network error & dialogs

Post by Rudi De Vos »

added MB_SYSTEMMODAL, this should put the box ontop
jhansen
8
8
Posts: 9
Joined: 2012-12-21 14:02

Re: Viewer crash when network error & dialogs

Post by jhansen »

I added some more code to clean up when a file transfer is going on.
When I build a release, the network interruption still causes a crash. After lots of angst, I found that turning optimizations off in release build makes this problem go away.
How would you like to have code changes submitted?

Jim
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Viewer crash when network error & dialogs

Post by Rudi De Vos »

I didn't do any tests while the tranfer is running only tested with the window open.

Playing with the optimizations is a bad thing, because the same bug can popup in another compiler or even after changing some code some other memory part can be infected by the bug.

I will see if i can find something, debugging multi thread apps is a hell.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Viewer crash when network error & dialogs

Post by Rudi De Vos »

made changes to fix it ( i hope)
1) timer need to be killed on delete FT
2) critical section is needed to prevent delete while timer is still executing
3) sendmessage need to be replace by sendmessagetimeout to prevent hunf timer function

2 files modified
svn updated
filetransfer.cpp
filetransfer.h

Please check if this also fix it on your site with opimization on.
jhansen
8
8
Posts: 9
Joined: 2012-12-21 14:02

Re: Viewer crash when network error & dialogs

Post by jhansen »

The good news is that these code changes work, the cleanup when a file was transferred is good.
The bad news is it works in debug build but release with optimizations on still crashes on memory reference.

Thanks for the quick help
How can I submit changes I've made?
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Viewer crash when network error & dialogs

Post by Rudi De Vos »

You can only submit changes by pm ( small changes) or mail me the files.
( please put some //////////// lines to indicate changes


I tested the changes in release mode and no memory corruption.
Compiler ?
32/64 ?
Do you use for testing.
If you run it in Visual studio, on what line crash the release version.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Viewer crash when network error & dialogs

Post by Rudi De Vos »

VS 11 X64 with security options on.
The throw function after network break crash, can be removed, not needed.
Without this version also work.

Security options need to be on to pass win8 logo tests.
Post Reply