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

Crash when creating new database & account #5852

Closed
3 of 7 tasks
tactilis opened this issue Apr 20, 2023 · 43 comments
Closed
3 of 7 tasks

Crash when creating new database & account #5852

tactilis opened this issue Apr 20, 2023 · 43 comments
Labels
bug fixed win related to Windows pltform
Milestone

Comments

@tactilis
Copy link

MMEX version:

  • 1.6.3 (and all earlier versions back to 1.5.14)

Operating System:

  • Windows 10 and 11 (Norwegian)
  • Mac OSX
  • Linux

Description of the bug

In forum post https://forum.moneymanagerex.org/viewtopic.php?p=23925 the user reports that MMEX closes (it's due to an ACCESS_VIOLATION exception) when creating a new database & account via the wizard.

In a video that the user recorded, the following actions are performed:

  1. MMEX is started with no database open.
  2. File | New Database...
  3. Via the New Database wizard, create the database with base currency set to NOK.
  4. Via the Add Account wizard, create a Checking account. Enter the account name and press Finish.
  5. At this point MMEX crashes (before the Edit Account dialog has been displayed)

The MMEX window closes without displaying the crash handler dialog.

Reproduction

Is the bug reproducible?

  • Always
  • Randomly
  • Happened only once

Reproduction steps:

As reported, install any version of MMEX from 1.5.14 through to 1.6.3 and the crash occurs.

Install 1.5.13 and the crash does not occur.

Here's the crash dump that the user provided:

MoneyManagerEx.xml.zip

@vomikan vomikan added the bug label Apr 20, 2023
@vomikan vomikan added this to the v1.6.4 milestone Apr 20, 2023
@phildivalerio2
Copy link

Exact same issue for me. I tried using 1.5.13 and it works OK.

@tactilis
Copy link
Author

@phildivalerio2

Exact same issue for me. I tried using 1.5.13 and it works OK.

What version of Windows are you using?

What language is Windows set to?

What currency are you setting when you create the database?

@phildivalerio2
Copy link

phildivalerio2 commented Apr 23, 2023 via email

@phildivalerio2
Copy link

I'd be interested in knowing if anyone using Windows 11, Norwegian, is able to use MMEX. Then I would know that it's something to do with my PC.

@tactilis
Copy link
Author

So, a common factor between the original report (see link to the forum post above) and @phildivalerio2's report is having the language in Windows set to Norwegian.

It may just be coincidental and not the cause but needs investigation.

@birdnes
Copy link

birdnes commented Apr 23, 2023

Hello... I post the orginal report.

My pc run Windows 11 Home 64 bit
English language

mmex crash , only mmex 1.5.13 works

Have a surface with Windows 11 Pro 64bit
Norwegian language

same problem

Have tried win 10 64bit
Norwegian language

same problem

@vomikan
Copy link
Member

vomikan commented Apr 23, 2023

mmex crash

Even if you create a new empty database?

@tactilis
Copy link
Author

Even if you create a new empty database?

The crash happens as I described in the initial post of this issue, i.e. when Finish is clicked on the New Account wizard. The actions listed in my post are transcribed from a video that @birdnes provided.

@phildivalerio2
Copy link

phildivalerio2 commented Apr 24, 2023 via email

@birdnes
Copy link

birdnes commented Apr 24, 2023

Can confirm what @phildivalerio2 writing. Have tried several ways with database.
mmex crash everytime.

@vomikan
Copy link
Member

vomikan commented Apr 24, 2023

I see two ways to investigate the problem:

  1. Try portable version https://ci.appveyor.com/api/buildjobs/9rrwq399can7klra/artifacts/mmex-1.6.4-Beta.4-win64-portable.zip
  2. Could you find and delete all mmexini.db3 files?

@phildivalerio2
Copy link

phildivalerio2 commented Apr 24, 2023 via email

@tactilis
Copy link
Author

Could you find and delete all mmexini.db3 files?

@phildivalerio2, @birdnes If you used the installed version previously, then your mmexini.db3 file should be in:

C:\Users\<your username>\AppData\Roaming\MoneyManagerEx

@birdnes
Copy link

birdnes commented Apr 24, 2023

I have tried portable version now and deleted all all mmexini.db3 files

It didnt help, same crash with mmex

@phildivalerio2
Copy link

phildivalerio2 commented Apr 24, 2023 via email

@n-stein
Copy link
Contributor

n-stein commented Apr 24, 2023

If that doesn't work we could use GitHub's history to recompile the 1.5.14 Beta at some points between 1.5.13 and 1.5.14. This would allow us to isolate the commit that first caused this issue.

@birdnes
Copy link

birdnes commented Apr 24, 2023

Just tell me what to download and try

@n-stein
Copy link
Contributor

n-stein commented Apr 24, 2023

1.5.13 released 2022-02-06
1.5.14 released 2022-04-14

I've rebuilt two portable betas from points between those dates. The date and commit are noted in the filenames. Can you please check if either works for you? Note both are x64 builds.

mmex-20220221-3bedaf0.zip

mmex-20220312-0d1cc04.zip

@n-stein
Copy link
Contributor

n-stein commented Apr 25, 2023

#5689 is similar

@birdnes
Copy link

birdnes commented Apr 25, 2023

I have tried now and they are both crashing the same way .

@n-stein
Copy link
Contributor

n-stein commented Apr 25, 2023

Here are two more to test, see if either of these work. These are before & after the fmt submodule update:

mmex-20220206-af66541.zip
mmex-20220208-d0a3f5c.zip

@birdnes
Copy link

birdnes commented Apr 25, 2023

I have tried now and they are both working .. No close/crash.

Very Nice

@phildivalerio2
Copy link

Both crashed for me.

@n-stein
Copy link
Contributor

n-stein commented Apr 25, 2023

@birdnes can you please test another? mmex-20220211-a2242cc.zip

Both crashed for me.

The first set or second?

@phildivalerio2
Copy link

I tried both, and they both crashed.
Windows 11 issue? Have any others using Windows 11 managed a successful install?

@tactilis
Copy link
Author

@phildivalerio2

Have any others using Windows 11 managed a successful install?

Yes. Of course. Otherwise we'd have 100s of bug reports about it.

Your and @birdnes's crashes from 1.5.14 onwards do not occur for (most/all) other users of MMEX.

@birdnes reports that the crash using 1.5.14 onwards also happens for them on Windows 10.

@n-stein
Copy link
Contributor

n-stein commented Apr 25, 2023

@phildivalerio2

I tried both, and they both crashed.

Interesting. I'm surprised the one from 2022-02-06 crashed, that is only a 2 PRs after the 1.5.13 release. Just to test, here is a build of the 1.5.13 release. If this fails for you then perhaps the issue is not MMEX source code but one of the libraries we are linking against.
mmex-1.5.13-release.zip

@birdnes
Copy link

birdnes commented Apr 25, 2023

I have tried "mmex-20220211-a2242cc.zip" and its crashing the same way

"mmex-1.5.13-release.zip" is working normally with no crash

@n-stein
Copy link
Contributor

n-stein commented Apr 26, 2023

Thanks for testing, sorry to make you download and run so many versions.

So a2242cc doesn't work but d0a3f5c does.

That narrows down the list:
image

Here's the build after 2af8562. If this works then the issue is contained in PR #4199.

mmex-20220210-2af8562.zip

@birdnes
Copy link

birdnes commented Apr 26, 2023

"mmex-20220210-2af8562.zip" is working normally with no crash

@n-stein
Copy link
Contributor

n-stein commented Apr 26, 2023

That narrows it down to PR #4199 which changed the way string formatting works in Model_Currency.cpp

Just curious, can you test this version of 1.6.4 where I've updated the fmt submodule from 8.1.1 to 9.1.0? Perhaps some updates to the fmt library have fixed this issue.

mmex-1.6.4-fmt_9.1.0.zip

@birdnes
Copy link

birdnes commented Apr 26, 2023

"mmex-1.6.4-fmt_9.1.0.zip" is crashing the same way as before

@vomikan
Copy link
Member

vomikan commented Apr 26, 2023

Can this information help?
fmtlib/fmt#2748 (comment)

@n-stein
Copy link
Contributor

n-stein commented Apr 26, 2023

Can this information help?

It might be related. I looked through that thread earlier today when I was checking out #4191 (the issue that #4199 was addressing).

@birdnes what is your system locale? You can see this in "System Information"

@birdnes
Copy link

birdnes commented Apr 26, 2023

Norsk ( Norwegian ), but my main pc is English ( Windows 11 )

I mean that i have 1 pc with english system locale and 2 with Norwegian.

Several of my friends have tried to install mmex 1.6.3 with same result . Win 10 and 11 64 bit

@n-stein
Copy link
Contributor

n-stein commented Apr 27, 2023

Does it crash if you pick a base currency other than NOK when setting up the new DB, such as USD or GBP?

@birdnes
Copy link

birdnes commented Apr 27, 2023

Does it crash if you pick a base currency other than NOK when setting up the new DB, such as USD or GBP?

Yes... Have tried different currency with same result

@phildivalerio2
Copy link

phildivalerio2 commented Apr 27, 2023 via email

@vomikan vomikan added the win related to Windows pltform label Apr 28, 2023
@birdnes
Copy link

birdnes commented May 6, 2023

I have now tried to change regional settings on windows 11 to english us and mmex 1.6.3 works perfect.

I should have tried this before. So is in regional settings the problem is. If i change back to Norwegian again mmex close

Running win 11 64 english language

@birdnes
Copy link

birdnes commented May 6, 2023

I have tried to change regional settings with pc running win 11 64 bit with norwegian language.

mmex close.

Conclusion :

Windows 11 64 bit Norwegian language it will not help to change regional settings to english us
the same will happend, mmex close after database make

n-stein added a commit to n-stein/moneymanagerex that referenced this issue May 22, 2023
@n-stein
Copy link
Contributor

n-stein commented May 22, 2023

I was able to reproduce the crash by spinning up a Windows 10 VM in Norwegian language, building MMEX on it, and debugging. Crash was an assertion fail due to a null pointer exception thrown here:

fmt::format(std::locale("en_US.UTF-8"), "{:L}", 123);
and again on
auto l = (s_use_locale == "Y" ? std::locale(s_locale.c_str()) : (d == "Y" ? std::locale("en_US.UTF-8") : std::locale()));

Removing the .UTF-8 from the default en_US locale resolves the issue.

vomikan added a commit that referenced this issue May 22, 2023
@vomikan vomikan added fixed and removed help wanted labels May 22, 2023
@vomikan vomikan closed this as completed May 22, 2023
@phildivalerio2
Copy link

phildivalerio2 commented May 22, 2023 via email

@n-stein
Copy link
Contributor

n-stein commented May 22, 2023

Will this fox be implemented in the next update?

Yes, also available now in the beta here: https://ci.appveyor.com/project/whalley/moneymanagerex/build/job/92ef1c3klr94ajdc/artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed win related to Windows pltform
Projects
None yet
Development

No branches or pull requests

5 participants