Process terminated with status -11

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
User avatar
PATRICKMULOT
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Apr 25, 2017 6:07 pm

Process terminated with status -11

Post by PATRICKMULOT »

Hello,
I have a problem when I launch the execution of my program which is however minimal and without error in compilation.
I can't seem to find where the error is. If anyone can help me, I thank them in advance.

My laptop: Asus k73SV Intel® Core ™ i7-2630QM CPU @ 2.00GHz × 8 - 1TB SSD
My environment: Ubuntu 20.04.2 - CodeBlocks 20.03 - wxWidgets 3.0.5 (build: ../configure --with-gtk = 3 - enable-shared --enable-monolithic --enable-unicode).

The build log :
-------------- Clean: debug in pmGenealogy2 (compiler: GNU GCC Compiler)---------------
Cleaned "pmGenealogy2 - debug"
-------------- Build: debug in pmGenealogy2 (compiler: GNU GCC Compiler)---------------
g++ -Wall -std=gnu++17 -g -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -std=c++17 -g -std=c++17 -I/home/patrick/CBProjects/pmGenealogy2/ -c /home/patrick/CBProjects/pmGenealogy2/mainframe.cpp -o debug/obj/mainframe.o
g++ -Wall -std=gnu++17 -g -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -std=c++17 -g -std=c++17 -I/home/patrick/CBProjects/pmGenealogy2/ -c /home/patrick/CBProjects/pmGenealogy2/myapp.cpp -o debug/obj/myapp.o
g++ -o debug/bin/pmGenealogy2 debug/obj/mainframe.o debug/obj/myapp.o -L/usr/local/lib -pthread -lwx_gtk3u-3.0
Output file is debug/bin/pmGenealogy2 with size 725.13 KB
Process terminated with status 0 (0 minute(s), 4 second(s))
0 error(s), 0 warning(s) (0 minute(s), 4 second(s))
-------------- Run: debug in pmGenealogy2 (compiler: GNU GCC Compiler)---------------
Checking for existence: /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2
Set variable: LD_LIBRARY_PATH=.:/usr/local/lib:
Executing: /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2 (in /home/patrick/CBProjects/pmGenealogy2/.)
Process terminated with status -11 (0 minute(s), 0 second(s))

My sources:

Code: Select all

[b]myapp.cpp:[/b]
#include "myapp.h"
#include "mainframe.h"
wxIMPLEMENT_APP( myApp );
bool myApp::OnInit()
{
    if ( ! myApp::OnInit() ) { return false; }
    mainFrame * frame = new mainFrame( m_locale, m_lang );
    frame->Center();
    frame->Show();
    return true;
}

[b]myapp.h:[/b]
#ifndef MY_APP_H_INCLUDED
#define MY_APP_H_INCLUDED
#include <wx/wx.h>
class myApp : public wxApp
{
    public:
        myApp() { m_lang = wxLANGUAGE_UNKNOWN; }
        virtual bool OnInit();
     private:
        wxLocale m_locale;  // locale that will be used
        wxLanguage m_lang;  // language specified by user
};
// implement myApp & wxGetApp()
wxDECLARE_APP( myApp );
#endif // MY_APP_H_INCLUDED

[b]mainframe.cpp:[/b]
#include "mainframe.h"
#include "icons/wxwidgets.xpm"
wxBEGIN_EVENT_TABLE( mainFrame, wxFrame )
    EVT_CLOSE( mainFrame::OnClose )
wxEND_EVENT_TABLE()
mainFrame::mainFrame( wxLocale & locale, wxLanguage lang )
         : wxFrame( NULL, wxID_ANY, APPLICATION, wxDefaultPosition, wxSize( 800, 400 ),
            wxDEFAULT_FRAME_STYLE & ~ ( wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX ) ),
            m_locale( locale ), m_lang( lang )
{
    this->SetIcon( wxICON( wxwidgets ) );
    this->SetMinSize( wxSize( 800, 400 ) );
    this->SetMaxSize( wxSize( 800, 400 ) );
    this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
}
Void mainFrame::OnClose( wxCloseEvent & WXUNUSED( event ) )
{
    mainFrame::Destroy();
}

[b]mainframe.h:[/b]
#ifndef MY_FRAME_H_INCLUDED
#define MY_FRAME_H_INCLUDED
#include <wx/wx.h>
// =============================================================================
// global constants of the application
#define APPLICATION "pmGenealogy"
#define COPYRIGHT   "Copyright © 2021-"
#define DEVELOPER   "Patrick MULOT - [email protected]"
#define VERSION     "Version 1.0.00"
// =============================================================================
class mainFrame : public wxFrame
{
    public:
        mainFrame( wxLocale & m_locale, wxLanguage m_lang );
        virtual ~mainFrame() {}
        void OnClose( wxCloseEvent & WXUNUSED( event ) );
    private:
        wxLocale & m_locale;
        wxLanguage m_lang;
    wxDECLARE_EVENT_TABLE();
};
#endif // MY_FRAME_H_INCLUDED
Patrick MULOT.
Lenovo-V17-G2-ITL - 11th Gen Intel Core i5-1135G7 CPU @ 2.40GHz × 8 - Ram 16 Gb - SSD 512 Go + 2 x 1 To
Ubuntu 22.04 LTS 64 bits - wxWidgets 3.2.2.1 - C++ - wxSqlite3
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Process terminated with status -11

Post by doublemax »

Can you run your program under a debugger and provide a call stack?
Use the source, Luke!
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Process terminated with status -11

Post by DavidHart »

Hi,
wxWidgets 3.0.5 (build: ../configure --with-gtk = 3 - enable-shared --enable-monolithic --enable-unicode).
I expect that was really '--with-gtk=3 --enable-shared' i.e. without the spaces...

Two questions:
1) Why monolithic? It's very rarely used on Linux, and so very rarely tested. Try a separate build with just
../configure --with-gtk=3 --enable-debug --prefix=`pwd`
'-- enable-shared --enable-unicode' are the defaults; '--prefix=' means you create a build that doesn't need installation; when you build your program, you just point to the wx-config that's created in that dir.
Alternatively, use ubuntu focal's official wx3.0.4 debs.

2) What happens if you run the samples that come with the wx source? e.g. ${build-dir}/samples/minimal/ If that builds and runs successfully, it suggests that the problem is in your code, or its build, rather that your wx build.

Regards,

David
User avatar
PATRICKMULOT
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Apr 25, 2017 6:07 pm

Re: Process terminated with status -11

Post by PATRICKMULOT »

here is the result of debug:

Code: Select all

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target: 
debug
Adding source dir: /home/patrick/CBProjects/pmGenealogy2/
Adding source dir: /home/patrick/CBProjects/pmGenealogy2/
Adding file: /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2
Changing directory to: /home/patrick/CBProjects/pmGenealogy2/.
Set variable: LD_LIBRARY_PATH=.:/usr/local/lib:

[debug]Command-line: /usr/bin/gdb -nx -fullname -quiet  -args /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2
[debug]Working dir : /home/patrick/CBProjects/pmGenealogy2

Starting debugger: /usr/bin/gdb -nx -fullname -quiet  -args /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2
Setting SHELL to '/bin/sh'
done

[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]Reading symbols from /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2...
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
[debug]Copyright (C) 2020 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.
[debug]Type "show copying" and "show warranty" for details.
[debug]This GDB was configured as "x86_64-linux-gnu".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]    <http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory /home/patrick/CBProjects/pmGenealogy2/
[debug]Source directories searched: /home/patrick/CBProjects/pmGenealogy2:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2 
[debug][Thread debugging using libthread_db enabled]
[debug]Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Child process PID: 8735

[debug][New Thread 0x7ffff3f4b700 (LWP 8735)]
[debug][New Thread 0x7ffff374a700 (LWP 8736)]
[debug]Thread 1 "pmGenealogy2" received signal SIGSEGV, Segmentation fault.
[debug]0x000055555556368e in myApp::OnInit (this=<error reading variable: Cannot access memory at address 0x7fffff7fefd8>) at /home/patrick/CBProjects/pmGenealogy2/myapp.cpp:18
[debug]/home/patrick/CBProjects/pmGenealogy2/myapp.cpp:18:539:beg:0x55555556368e
[debug]18	{
[debug]>>>>>>cb_gdb:

At /home/patrick/CBProjects/pmGenealogy2/myapp.cpp:18
Continuing...

[debug]> cont
[debug]Couldn't get registers: Aucun processus de ce type.
[debug]Couldn't get registers: Aucun processus de ce type.
[debug]Continuing.
[debug]>>>>>>cb_gdb:
[debug]> info frame
[debug]Couldn't get registers: Aucun processus de ce type.
[debug]>>>>>>cb_gdb:
[debug][Thread 0x7ffff374a700 (LWP 8736) exited]
[debug][Thread 0x7ffff3f4b700 (LWP 8735) exited]
[debug]Program terminated with signal SIGSEGV, Segmentation fault.
[debug]The program no longer exists.

Continuing...

[debug]> cont
[debug]The program is not being run.
[debug]>>>>>>cb_gdb:

Program terminated with signal SIGSEGV, Segmentation fault.

[debug]> quit

The program is not being run.
Debugger finished with status 0
Last edited by DavidHart on Tue Feb 09, 2021 6:03 pm, edited 1 time in total.
Reason: Added code-tags
Patrick MULOT.
Lenovo-V17-G2-ITL - 11th Gen Intel Core i5-1135G7 CPU @ 2.40GHz × 8 - Ram 16 Gb - SSD 512 Go + 2 x 1 To
Ubuntu 22.04 LTS 64 bits - wxWidgets 3.2.2.1 - C++ - wxSqlite3
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Process terminated with status -11

Post by doublemax »

Code: Select all

if ( ! myApp::OnInit() ) { return false; }
Try calling wxApp::OnInit() instead.
Use the source, Luke!
User avatar
PATRICKMULOT
Earned a small fee
Earned a small fee
Posts: 15
Joined: Tue Apr 25, 2017 6:07 pm

Re: Process terminated with status -11

Post by PATRICKMULOT »

@DoubleMax: it's Ok . compile and run, no error.
Many thanks.
Patrick MULOT
Patrick MULOT.
Lenovo-V17-G2-ITL - 11th Gen Intel Core i5-1135G7 CPU @ 2.40GHz × 8 - Ram 16 Gb - SSD 512 Go + 2 x 1 To
Ubuntu 22.04 LTS 64 bits - wxWidgets 3.2.2.1 - C++ - wxSqlite3
Post Reply