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

Something broken down the program. Event: Arithmetic operation resulted in an overflow #418

Closed
yanlinsun opened this issue Apr 8, 2020 · 11 comments

Comments

@yanlinsun
Copy link
Contributor

I installed the latest version v2.9.236.0 (beta). I am able to click the following places on the first time I use the application.
image
After I do a replace, or something else, I coun't for sure, all places above will trigger this error.
image
Even if I want to close the program by click the 'X' at right top corner. The only option to close the program is to right click it on the taskbar and choose close.

The event log is
image

My OS is : Windows 10 Enterprise 1809 x64 Build 17763.973

@doug24
Copy link
Contributor

doug24 commented Apr 8, 2020

Unfortunately the error is all in system code, so unless there is a way to reproduce the error, I don't know what to fix. Can you check - does the dnGrep error log have any more details or a longer stack trace? It is in %appdata%:
C:\Users\username\AppData\Roaming\dnGREP\logs\Grep_Error_Log.xml

@yanlinsun
Copy link
Contributor Author

Here is the log
Grep_Error_Log.zip

@doug24
Copy link
Contributor

doug24 commented Apr 8, 2020

Well, I can see how annoying that must be. I wonder if it a number formatting or parsing problem. What language / region settings are you running in Windows?

@yanlinsun
Copy link
Contributor Author

My OS language is English. However, I set application language to Chinese.
image
image

@yanlinsun
Copy link
Contributor Author

I tried to compile a debug version of dnGREP. I can reproduce it if I maximize the window. If I restore it back to normal size, no error.
But with the installed version, no matter what window size, the error always there.

@yanlinsun
Copy link
Contributor Author

I think it is related to the window sizing calculation. With the debug version, once I resize manually to customized size, the error occurs, and no matter how the error persists. How can I delete the remembered window size and try the default size?

@doug24
Copy link
Contributor

doug24 commented Apr 8, 2020

The window size is stored in the 'user.config' file under appdata\local\dnGrep. There will be a generated folder name 'dnGREP.exe_Url_xxx' and then another folder named for the release version. You can you dnGrep to find the most recent one :)

You can edit it set a size, or move it and it will revert to the defaults

@yanlinsun
Copy link
Contributor Author

Once I delete the user.config, both release and debug version back to normal. It is easy to reproduce by changing the window size.
Do you have the same issue or just on my machine?

@yanlinsun
Copy link
Contributor Author

yanlinsun commented Apr 8, 2020

I googled the error message and found the root cause. It is an issue in WPF, not fixed yet.
https://github.com/dotnet/wpf/issues/1269#issuecomment-611208928

BTW, do you know how to link these two issues cross projects?

@doug24
Copy link
Contributor

doug24 commented Apr 9, 2020

I haven't had time to test this yet, so I don't know if I can reproduce it. I have tested an over/under monitor configuration, but not recently and I can try that again. The links on the WPF issue say it related to a Logitech mouse. Do you have a Logitech mouse?

There is a work around - you've built a debug version, so do you want to try adding this to your build? In dnGrep it would go in MainView.xaml.cs, and there is already an override to OnSourceInitialized, so you would add this line to the existing OnSourceInitialized override:
( (HwndSource)PresentationSource.FromVisual( this ) ).AddHook( HookProc );
and then copy in the HookProc.

If that works I can put it in, or you can do a pull request - either way works for me.

@doug24
Copy link
Contributor

doug24 commented May 31, 2020

Added the fix to all dnGrep windows in v2.9.248.0

@doug24 doug24 closed this as completed May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants