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

Cannot start: "bad locale name" #3587

Closed
2 of 6 tasks
Joker2k opened this issue Jun 9, 2021 · 11 comments
Closed
2 of 6 tasks

Cannot start: "bad locale name" #3587

Joker2k opened this issue Jun 9, 2021 · 11 comments
Assignees
Milestone

Comments

@Joker2k
Copy link

Joker2k commented Jun 9, 2021

MMEX version:
git master

Operating System:

  • Windows
  • Mac OSX
  • Linux

Description of the bug

Since a while I cannot start mmex on my win7 machine.

image

Reproduction

Is the bug reproducible?

  • Always
  • Randomly
  • Happened only once

Reproduction steps:

  1. From start's splash "Open last opened database"

Expected result:
Program starts

Actual result:
Program closes with error

Additional information

If you have a backtrace for a crash or a warning, paste it here.

@vomikan vomikan added bug good first issue good issue for first-time contributors - please fix me ASAP labels Jun 9, 2021
@vomikan vomikan added this to the v1.5.3 milestone Jun 9, 2021
@vomikan
Copy link
Member

vomikan commented Jun 9, 2021

I recommend to clear the following field in mmb file using any SQLite Developer.

image

@vomikan
Copy link
Member

vomikan commented Jun 9, 2021

Seems it should be added "try" before any locale usage into wxString Model_Currency::toString function.

    try {
        auto test = fmt::format(std::locale(locale.c_str()), "{:L}", 123);
    }
    catch (std::exception & ex) {
        locale = "";
    }

@Joker2k
Copy link
Author

Joker2k commented Jun 9, 2021

First thing i've checked, my:
image

Unfortunately I'm unable to debug on win7 PC. I don't have issue on my win10 dev machine.

Even starting new database from splash, I have that error. But program doesn't closes.

@vomikan
Copy link
Member

vomikan commented Jun 9, 2021

Just clear LOCAL field (do not delete the line but only the value).

@vomikan vomikan self-assigned this Jun 9, 2021
vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 9, 2021
vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 9, 2021
vomikan added a commit that referenced this issue Jun 9, 2021
fix(#3587): test locale before use
@vomikan vomikan added fixed and removed good first issue good issue for first-time contributors - please fix me ASAP labels Jun 9, 2021
@Joker2k
Copy link
Author

Joker2k commented Jun 10, 2021

try/catch doesn't help
LOCALE field have "not null" constraint. Setting to " " doesn't help either
git master as for now doesn't resolve

vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 10, 2021
vomikan added a commit that referenced this issue Jun 10, 2021
fix(#3587): test locale before use
@vomikan
Copy link
Member

vomikan commented Jun 10, 2021

try/catch doesn't help
LOCALE field have "not null" constraint. Setting to " " doesn't help either
git master as for now doesn't resolve

It should help
"not null" does not metter. The fmt::format(std::locale(locale.c_str()), "{:L}", 123) function would call exception on any invalid locale value then locale became empty (does not used).

@Joker2k
Copy link
Author

Joker2k commented Jun 10, 2021

Last commit broke even my win10 machine...
You should uninit in catch:
image

Still win7 got "bad locale"....

vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 10, 2021
vomikan added a commit that referenced this issue Jun 10, 2021
fix(#3587): test locale before use
@vomikan
Copy link
Member

vomikan commented Jun 12, 2021

@Joker2k is it working now?

@vomikan vomikan closed this as completed Jun 12, 2021
@Joker2k
Copy link
Author

Joker2k commented Jun 12, 2021

no, same "bad locale" on win7 preventing start from portable mode

Version: 1.5.3-Beta.1
• Build on Jun 12 2021 16:22:03
• Database version: 7 • (aes128cbc)
MMEX is using the following support products:
• wxWidgets 3.1.4 (wxMSW 6.1)
• wxSQLite3 4.6.0 (SQLite 3.31.1)
• RapidJSON 1.1.0
• Lua 5.3.5
• lunasvg v2.0.1
• libcurl/7.59.0 WinSSL zlib/1.2.8
• gettext 0.19.8.1
• apexcharts.js
Build using:
• CMake 3.20.21032501-MSVC_2
• MSBuild 16.10.1.27004
• Microsoft Visual Studio 16.0
• Microsoft Visual C++ 19.29.30037.0
• Windows SDK 10.0.18362.0
Running on:
• Windows 7 (build 7601, Service Pack 1), 64-bit edition
• Russian (windows-1251)
• 1920x1200 32bit 72x72ppi

@vomikan
Copy link
Member

vomikan commented Jun 12, 2021

image
2)
image
3)
image

There is only one issue:
image

vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 12, 2021
vomikan added a commit that referenced this issue Jun 12, 2021
fix(#3587): save invalid locale option
@vomikan vomikan reopened this Jun 12, 2021
vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 12, 2021
vomikan added a commit that referenced this issue Jun 12, 2021
vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 12, 2021
vomikan added a commit that referenced this issue Jun 12, 2021
@vomikan vomikan closed this as completed Jun 12, 2021
@Joker2k
Copy link
Author

Joker2k commented Jun 12, 2021

Yes, finally fixed...

vomikan added a commit to vomikan/moneymanagerex that referenced this issue Jun 12, 2021
vomikan added a commit that referenced this issue Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants