crash in wxmsw30u_gcc48.dll with code: 0xc0000005

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.
Rob'
Knows some wx things
Knows some wx things
Posts: 39
Joined: Mon Dec 08, 2008 10:10 pm

crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby Rob' » Thu Aug 10, 2017 12:10 pm

I have several applications, developed with wx 3.0.1. They all are working well alone or in different combinations. If I start the 5th application, this app crashes with this message:

Code: Select all

Name des fehlerhaften Moduls: wxmsw30u_gcc48.dll, Version: 3.0.1.0, Zeitstempel: 0x53c5f69f
Ausnahmecode: 0xc0000005
Fehleroffset: 0x005217d3

It does not depend on in which order I start the applications. Does anybody know the reason for this behavior?

Thanks in advance.
Rob'

User avatar
doublemax
Moderator
Moderator
Posts: 11299
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby doublemax » Thu Aug 10, 2017 1:00 pm

Impossible to say with that little information. Use a debug build and get a stacktrace.
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 1931
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby ONEEYEMAN » Thu Aug 10, 2017 1:12 pm

Hi,
Are you using static or dynamic build of the library?
Did the crash occur during start-up?

Thank you.

Nunki
Earned some good credits
Earned some good credits
Posts: 125
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby Nunki » Sat Aug 12, 2017 8:49 am

Rob,

Usually that error code tells me I have a null pointer, or at least some uninitialised pointer. You also have to be aware that you may ignore warnings of your compiler, but they may point you to the fact that this may happen. It will compile your program into executable code, but you may run into runtime errors - like these. Also, I did at one time have a program that ran fine on Win7 and had such problems on Win10. Examining the application on a Win10 environment lead me to some uninitialised classes.

Happy hunting (bugs)
Regards
Nunki

Rob'
Knows some wx things
Knows some wx things
Posts: 39
Joined: Mon Dec 08, 2008 10:10 pm

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby Rob' » Sat Aug 12, 2017 3:54 pm

Thanks for your replies.

What I did:
I started 4 programs (in release build). Then I started a 5th program in debug build out of my IDE and got a segmentation fault:

Code: Select all

#0 63D8677C   wxRefCounter::IncRef(this=0xc)                                  (../../include/wx/object.h:248)
#1 63D13579   wxGrid::GetCellAttr(this=0x85b21d8, row=-1, col=-1)             (../../src/generic/grid.cpp:7727)
#2 63D0E28E   wxGrid::IsCellEditControlShown(this=0x85b21d8)                  (../../src/generic/grid.cpp:6319)
#3 63D008A0   wxGrid::CalcDimensions(this=0x85b21d8)                          (../../src/generic/grid.cpp:2606)
#4 63CFFC14   wxGrid::SetTable(this=0x85b21d8, table=0x85b2f90, takeOwnership=true, selmode=wxGrid::wxGridSelectCells)    
                                                                 (../../src/generic/grid.cpp:2391)
#5 63CFF6B8   _fu873__wxTrapInAssert()                                        (../../src/generic/grid.cpp:2305)
#6 004A9A3B   _fu693__wxDefaultPosition()                                     (C:\dev\visuclasses\errors\errwindowbase.cpp:23)
#7 0046F786   _fu647__wxDefaultPosition()                                     (C:\dev\visuclasses\errors\errwindow.cpp:15)
#8 00446E93   _fu576__wxDefaultPosition()                                     (C:\...\main\mainframe.cpp:93)
#9 00448244   _fu1304__wxEmptyString()                                        (C:\...\main\visuapp.cpp:92)
#10 004FBEF6   wxAppConsoleBase::CallOnInit(this=0x79629b0)                   (C:/dev/wxWidgets3.0/include/wx/app.h:93)
#11 67B3208E   wxEntryReal(argc=@0x21c0564: 1, argv=0x7961bd8)                (../../src/common/init.cpp:479)
#12 67BEC94C   wxEntry(argc=@0x21c0564: 1, argv=0x7961bd8)                    (../../src/msw/main.cpp:197)
#13 01CA8B2B   wxEntry(hInstance=0x400000, nCmdShow=10)                       (../../src/msw/main.cpp:415)
#14 00447C6F   WinMain@16(hInstance=0x400000, hPrevInstance=0x0, nCmdShow=10) (C:\...\main\visuapp.cpp:36)
#15 0057005B   main ()                                                        (??:??)

And this is the code:

Code: Select all

   ErrList = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
   
   // Grid
   ErrList->CreateGrid( 0, 3 );

The last line causes the crash. The file was created by wxFormBuilder.

Rob'

User avatar
doublemax
Moderator
Moderator
Posts: 11299
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby doublemax » Sat Aug 12, 2017 6:29 pm

Can you try what happens when you link wxWidgets statically?

And the opposite test, can you build the "grid" sample that comes with wxWidgets with dynamic linking and then start 5 instances of the sample and see what happen?
Use the source, Luke!

Nunki
Earned some good credits
Earned some good credits
Posts: 125
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby Nunki » Sun Aug 13, 2017 9:21 pm

Hi Rob,

Code: Select all

 ErrList->CreateGrid( 0, 3 );

So you create a grid with no rows and three columns, right ?

Now, if you do any action before you add a row with

Code: Select all

ErrList->InsertRows(1,ErrList->Count(),false);


You will get such an access violation error.

Regards
Nunki

Rob'
Knows some wx things
Knows some wx things
Posts: 39
Joined: Mon Dec 08, 2008 10:10 pm

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby Rob' » Fri Aug 18, 2017 2:43 pm

doublemax wrote:Can you try what happens when you link wxWidgets statically?

Sorry, that's above me. I get a lot of strange linker errors when I build my program. I'm using my own library, that is using wxGrid. This library links wxWidgets dynamically. I guess it is not possible to use a mix, isn't it?

And the opposite test, can you build the "grid" sample that comes with wxWidgets with dynamic linking and then start 5 instances of the sample and see what happen?

The compiler runs w/o errors or warnings. But if I start the programm, I get a wxWidgets debug alert:

Code: Select all

../..src/msw/window.cpp(3750): assert "wclass" failed in MSWCreate():
failed to register window class?

What is going wrong here?

@Nunki:
I do not operate with nonexistent rows. As a next step after creation I append the required number of rows. This is similar to the wxWidgets grid sample.

Nunki
Earned some good credits
Earned some good credits
Posts: 125
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby Nunki » Mon Aug 21, 2017 10:26 pm

Hi Rob,
Am I correct that you have an application which uses your library (which is a dll) which uses the wx-dll. Now I don't know your program but what I would do for starters is to put everything into one big application, no dll's or static libraries. And see how that works out, just to rule out problems on the level of communication between these parts. e.g. you could have built your library in 32-bit an now created a new fifth application in 64bit by mistake, thus having strange behaviour between application an dll because of the differences between 32 and 64bit code. Just an example.

Now the fact that 4 of your applications are built in release build and this one in debug build, does not necessarily mean the 4 applications are bugfree. They may have a similar problem but pass unnoticed because release builds are stripped of all debugging code. I would also try and build those 4 in debug mode to see if they display the same or similar behaviour.

Regards,
Nunki

coderrc
Earned some good credits
Earned some good credits
Posts: 105
Joined: Tue Nov 01, 2016 2:46 pm

Re: crash in wxmsw30u_gcc48.dll with code: 0xc0000005

Postby coderrc » Tue Aug 22, 2017 12:16 pm

does this occur on every computer or just 1?


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 5 guests