Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #25 #487

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

katterfelto
Copy link

This fixes the closed issue #25 which is causing me problems on a customers system and I have managed to reproduce on a test system.

I have tested it and the exception is still being thrown but is now handled silently.

@lextm
Copy link
Member

lextm commented Jun 6, 2017

Since you have an environment to reproduce this issue, can you print out the exact ClientRectangle information when the exception occurs? What is the width and height that triggers the exception? That might give us a better fix (test against such parameters) instead of blindly catching all exceptions.

@lextm
Copy link
Member

lextm commented Jun 6, 2017

If possible, can you also share information on the details of your testing environment? What kind of setup is required?

@katterfelto
Copy link
Author

katterfelto commented Jun 6, 2017

I am happy to provide more information. I added the catch because to my eyes there didn't seem to be any problem with the data.

For us the problem only seems to occur on PC's running 64bit Windows 2008 R2 Standard. As far as I know we are only ever using Remote Desktop to access them. I should be able to get a screen, keyboard and mouse connected to my local test environment if required. Our application is a 32bit process. The problem occurs when we are closing all the windows in the workspace prior to unloading the configuration from our application. Of the 2 servers on our customers site one works OK whilst the other regularly throws this exception, the only difference between the 2 is the configuration loaded into the application.

I am testing by running a release version of the application on the server and using Visual Studio 2017 Remote Debugging Tools to attach to the process from another PC. In my local test environment the problem occurs even when I do not have the remote debugger attached.

I am attaching 2 screen shots showing the ClientRectangle and e.Graphics data. At the moment nobody is asking to use the server for other tests so I should be able to run further the tests. Let me know what more you need.
clientrectangle
e graphics

@roken
Copy link
Member

roken commented Jun 7, 2017

Swallowing exceptions has a very strong smell.

@lextm
Copy link
Member

lextm commented Jun 7, 2017

@DaisyDave Thanks. Sounds like it is more related to resource usage, instead of rectangle size. Can you follow Hans Passant's suggestion in https://stackoverflow.com/questions/9362184/how-to-resolve-the-winforms-error-a-generic-error-occurred-in-gdi to check if there is an obvious leak?

@dirk-runge
Copy link

dirk-runge commented Nov 20, 2017

I also ran into this problem serveral times when using Remote Desktop to connect to a Window 7 PC from a Windows 10 PC. I cannot reproduce it though, it seems to be completely random. It also happens with version 3.0.2.

I observed the number of handles of the application, as suggested by Hans Passant on stackoverflow. I could not find anything suspicious though. It uses about 600 handles and that number remains more or less constant. When I ignore the exception by clicking continue, a red frame is drawn around the docking area. That frame stays there until I close the application.

@CLAassistant
Copy link

CLAassistant commented Nov 13, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 5 committers have signed the CLA.

✅ joelbyren
❌ lextm
❌ bvogelcvs
❌ katterfelto
❌ jotatsu
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants