Viewer crash when network error & dialogs

Developers may discuss here.

Viewer crash when network error & dialogs

Postby jhansen » 2013-03-16 14:28

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
jhansen
8
8
 
Posts: 9
Joined: 2012-12-21 14:02

Re: Viewer crash when network error & dialogs

Postby Rudi De Vos » 2013-03-16 21:37

Gonna try to repeat it
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21

Re: Viewer crash when network error & dialogs

Postby jhansen » 2013-03-17 01:04

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.
jhansen
8
8
 
Posts: 9
Joined: 2012-12-21 14:02

Re: Viewer crash when network error & dialogs

Postby Rudi De Vos » 2013-03-17 12:19

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
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21

Re: Viewer crash when network error & dialogs

Postby Rudi De Vos » 2013-03-17 13:26

added MB_SYSTEMMODAL, this should put the box ontop
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21

Re: Viewer crash when network error & dialogs

Postby jhansen » 2013-03-20 14:42

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
jhansen
8
8
 
Posts: 9
Joined: 2012-12-21 14:02

Re: Viewer crash when network error & dialogs

Postby Rudi De Vos » 2013-03-20 19:33

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.
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21

Re: Viewer crash when network error & dialogs

Postby Rudi De Vos » 2013-03-20 21:36

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.
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21

Re: Viewer crash when network error & dialogs

Postby jhansen » 2013-03-22 15:37

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?
jhansen
8
8
 
Posts: 9
Joined: 2012-12-21 14:02

Re: Viewer crash when network error & dialogs

Postby Rudi De Vos » 2013-03-22 19:23

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.
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21

Re: Viewer crash when network error & dialogs

Postby Rudi De Vos » 2013-03-23 09:44

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.
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21


Return to Developer discussions (mainly user-mode)

Who is online

Users browsing this forum: No registered users and 2 guests

cron