Error 0xc0000139 during startup

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
ultrajunkie
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sun May 30, 2021 10:11 am

Error 0xc0000139 during startup

Post by ultrajunkie »

I am getting the error 0xc0000139 during startup. The error message is not really helping (see attachment). Debugging is not possible because the error occurs before wxApp:Init() is called.

All I was doing was adding a field and some text to a dialog window (including the definitions in the .h files). The error text says something about wxTextCtrl, but the code looks indentical to the fields directly above.

I'm sure it is something completely stupid, but I have currently no idea what it might be.

Any help is appreciated!
Attachments
Error 0xc0000139.PNG
Error 0xc0000139.PNG (10.74 KiB) Viewed 2835 times
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Error 0xc0000139 during startup

Post by ONEEYEMAN »

Hi,
What version of wxWidgets do you have?
Did you build it or just grabbed the installer and ran it?

Thank you.
ultrajunkie
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sun May 30, 2021 10:11 am

Re: Error 0xc0000139 during startup

Post by ultrajunkie »

Hi Oneeyeman

I am running 3.2.2.1, and I built it on my own using mingw64.

Interesting observation: I have 2 machines at home (1 desktop with i9 and 64GB RAM, 1 notebook with i7 and 16GB RAM), both with the latest version of W10 Professional 64bit. The problem occured on the desktop. After rebuilding the application on the notebook, it worked there. However the identical .exe still produces the error on the desktop.

I will now try to roll back the changes from yesterday and see if it is then working again, but given the fact that I have no idea what went wrong I'm not sure that this is the solution.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Error 0xc0000139 during startup

Post by PB »

Are all wxWidgets (e.g., wxbase32u_gcc_custom.dll and wxmsw32u_core_gcc_custom.dll) and compiler (e.g., libgcc_s_seh-1.dll, libstdc++-6.dll, and libwinpthread-1.dll) DLLs identical on both computers? Are they in the folder with the executable (so the Windows cannot just pick the first one it finds in the PATH)?
ultrajunkie
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sun May 30, 2021 10:11 am

Re: Error 0xc0000139 during startup

Post by ultrajunkie »

Given the fact that I'm using the same tools and files for building, I would expect that the libs are identical. However I have not checked that.

In the meantime I downloaded a tool "dependency walker" which tells me that some basic Windows API DLLs are not found. :shock: Since the tool is at least 10 years old I don't know what value this information really has. :roll: However it also told me that it found the wx libs.

Now the funny part comes: I just copied the wx dlls into the same directory where the executable is. And... voila: it works.

But: Another (similar) application, freshly rebuilt, doesn't require the files to be in the same directory as the exe, meaning that the path setting should be correct. Should....

And here finally comes the stupid part: in my PATH variable, the entries to the libs were still pointing to 3.2.1. After changing to 3.2.2.1, the application starts without problems and without the dlls in the working directory. #-o ](*,).

Anyway: thanks for all your help. Much appreciated.... I hope that others might find this helpful when getting the same error message.

If anyone is part of the development team I have 2 suggestions:

1. Make sure that ALL directories are created if not existing. There is one (mswu or mswud) and following that wx which is not properly created under gcc_lib. This needs a change in the makefile.gcc

2. Enable the USE_QA flag in config.gcc by default. It helps avoiding linking errors in Codelite as the revised wx-config.exe obviously hasn't yet found its way into the package.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Error 0xc0000139 during startup

Post by PB »

ultrajunkie wrote: Mon May 29, 2023 1:48 pm And here finally comes the stupid part: in my PATH variable, the entries to the libs were still pointing to 3.2.1. After changing to 3.2.2.1, the application starts without problems and without the dlls in the working directory. #-o ](*,).
You should never rely on DLLs found in PATH, that is a very bad idea. All necessary DLLs (except Windows and perhaps old MSVC CRT) ones should, for several reasons, be in the same folder as the executable.
ultrajunkie wrote: Mon May 29, 2023 1:48 pm If anyone is part of the development team I have 2 suggestions:

1. Make sure that ALL directories are created if not existing. There is one (mswu or mswud) and following that wx which is not properly created under gcc_lib. This needs a change in the makefile.gcc

2. Enable the USE_QA flag in config.gcc by default. It helps avoiding linking errors in Codelite as the revised wx-config.exe obviously hasn't yet found its way into the package.
You cannot reach the developers here, you need to use another channel (e.g., the wx-users mailing list).

Re 1. I don't think this is true, the required folder is always created and it contains the build-specific setup.h, without which one cannot build an wxWidgets application. I have built wxWidgets in all possible configurations with many GCC versions and MinGW distributions countless times, never had that happen. Of course, the folder is created in gcc_lib only when building wxWidgets statically, otherwise it is, just as the libraries themselves, in gcc_dll as expected.

Re 2. AFAIK, this is not possible, wxQA contains the only class: wxDebugReport. Using it on Windows is supported only with MSVC (which is the only Windows compiler supporting SEH), so building it there makes no sense and it has never been built there.
Post Reply