Capturing call-stack wx

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Ruro
Experienced Solver
Experienced Solver
Posts: 83
Joined: Wed May 23, 2007 2:20 pm
Location: Verona, Italy

Capturing call-stack wx

Post by Ruro »

Hi,

I wonder if there is a way to capture a call-stack with the wxwidgets.

At the moment, we made a software with 3rd part library, and it is normally works fine, but sometimes, we get an assertion and the program crash.

To debug it, we were asked by the support, to capture a stack call when the software crash.

We have an idea where the possible crash could happen, and I would like to know if there is a way in the wxwidgets to catch this call-stack or i need to use c++ instead.

Thanks for your support, and sorry in case the question is not on topic.

Best Regards,

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

Re: Capturing call-stack wx

Post by ONEEYEMAN »

Hi,
1. Can you reproduce a crash in you environment?
2. What OS the program is running on?
3. What language it is written on?

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Capturing call-stack wx

Post by PB »

Adding to oneeyeman....

Sorry for asking the obvious, but did you look into these classes: http://docs.wxwidgets.org/3.1/group__gr ... gging.html. The use of the classes is demonstrated in the debugrpt sample.
Ruro
Experienced Solver
Experienced Solver
Posts: 83
Joined: Wed May 23, 2007 2:20 pm
Location: Verona, Italy

Re: Capturing call-stack wx

Post by Ruro »

Hi,

1) We can try to reproduce and error, but it is depends on the data input, we are trying to identify the source of the problem, but the error is showing at a random time of running (until we found out the source of the problem).

2)We are currently running the application on CentOs 7

3)We are using wxWidgets 2.8.12-Linux-Unicode build, and a SDK for the 3rdp part library c++.

@PB We should look at the sample, maybe it can help to undestand what is wrong with the code, I asked for the call-stack, because the 3rdp-part want some more information after we sent the type of assertion.

Thanks you,

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

Re: Capturing call-stack wx

Post by doublemax »

Usually it's the debugger that gives you the call stack.
Use the source, Luke!
Ruro
Experienced Solver
Experienced Solver
Posts: 83
Joined: Wed May 23, 2007 2:20 pm
Location: Verona, Italy

Re: Capturing call-stack wx

Post by Ruro »

Hi doublemax,

should I compile the project with the debug flag active to see the call stack? At the moment it is in release mode, I'm using the codeblock (13.12) as project manager.

Thanks you all for the support,

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

Re: Capturing call-stack wx

Post by ONEEYEMAN »

Hi,
Yes, you need to compile in debug mode, or even better - move to 3.1.

Thank you.
Ruro
Experienced Solver
Experienced Solver
Posts: 83
Joined: Wed May 23, 2007 2:20 pm
Location: Verona, Italy

Re: Capturing call-stack wx

Post by Ruro »

Hi,

thanks you for the quick answer.

We can try to compile the project in debug mode and look for further informations.

We can also try to move on 3.1 if this could help to solve the issue.

Thanks again for the support,

Nicola.
Ruro
Experienced Solver
Experienced Solver
Posts: 83
Joined: Wed May 23, 2007 2:20 pm
Location: Verona, Italy

Re: Capturing call-stack wx

Post by Ruro »

Hi,

we have rebuilt the project in debug mode, so we should have more info about the crash.

when the software has a crash, another application relaunch the software with wxExecute (async), is there a way to open the software with the shell, so we can see the debug message from if (avoiding the closing of the shell)?

Thanks,

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

Re: Capturing call-stack wx

Post by coderrc »

under windows, you can use dbg view https://technet.microsoft.com/en-us/sys ... gview.aspx to capture all data written to the console.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Capturing call-stack wx

Post by ONEEYEMAN »

Hi,
Or you can try to execute with "/K" option.

See this for details.

Thank you.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Capturing call-stack wx

Post by DavidHart »

Hi,

IIUC you are running 'crashing_software' from another program. If so, instead of running:
wxExecute( " /path/to/crashing_software --any --options" );
perhaps you could run:
wxExecute( "gdb --args /path/to/crashing_software --any --options" );

You should then be able to get useful information from gdb when the crash occurs.

Alternatively, you could use the wxExecute (const wxString &command, wxArrayString &output, wxArrayString &errors) version of wxExecute, which might provide helpful information in the errors array.

Regards,

David
Ruro
Experienced Solver
Experienced Solver
Posts: 83
Joined: Wed May 23, 2007 2:20 pm
Location: Verona, Italy

Re: Capturing call-stack wx

Post by Ruro »

Hi,

thanks for the useful suggestion.

I will try on a computer with the k option, and on another one with the gdb command.

I'll come back as soon as I got some new report.

Thanks again,

Best Regards,

Nicola
Post Reply