User forums > Using Code::Blocks

C::B crash (Settings-->Editor)

<< < (4/16) > >>

Michael:

--- Quote from: Pecan on April 14, 2006, 02:27:53 pm ---
--- Quote ---Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1228880192 (LWP 13442)]
0xb7a05349 in wxStringBase::AllocBeforeWrite ()
   from /usr/lib/libwx_baseu-2.6.so.0
(gdb)

--- End quote ---

Michael,

Could you do that again. Then when the "(gdb)" prompt
occurs after the SIGSEGV could you issue a backtrace
command. "bt" so we can see who is entering the
AllocBeforeWrite() segfaulted routine. You may have
to issue a number of "bt"s to see the *cause* of the error.

--- End quote ---

I have got the following (quite a lot):


--- Quote ---Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1228597568 (LWP 1370)]
0xb7a4a349 in wxStringBase::AllocBeforeWrite ()
   from /usr/lib/libwx_baseu-2.6.so.0
(gdb) bt
#0  0xb7a4a349 in wxStringBase::AllocBeforeWrite ()
   from /usr/lib/libwx_baseu-2.6.so.0
#1  0xb7a4acb0 in wxStringBase::AssignCopy ()
   from /usr/lib/libwx_baseu-2.6.so.0
#2  0xb7a4ad34 in wxStringBase::operator= () from /usr/lib/libwx_baseu-2.6.so.0
#3  0x0806da16 in wxString::operator= (this=0x98db36c, psz=0xb5cd1210)
    at string.h:854
#4  0xb5cba35e in LoadDefaultSettings (languages=0x98db36c)
    at codestatconfig.cpp:224
#5  0xb5cbac3b in LoadSettings (languages=0x98db36c) at codestatconfig.cpp:297
#6  0xb5cbb3f4 in CodeStatConfigDlg (this=0x98db208, parent=0x879ebd0)
    at codestatconfig.cpp:42
#7  0xb5cb64ed in CodeStat::GetConfigurationPanel (this=0x87c7e00,
    parent=0x879ebd0) at codestat.cpp:80
#8  0xb7858504 in PluginManager::GetConfigurationPanels (this=0x9180228,
    group=4, parent=0x879ebd0, arrayToFill=@0xbfbbb34c)
    at sdk/pluginmanager.cpp:470
#9  0xb77feb1f in EditorConfigurationDlg::AddPluginPanels (this=0xbfbbb158)
    at sdk/editorconfigurationdlg.cpp:258
#10 0xb78039be in EditorConfigurationDlg (this=0xbfbbb158, parent=0x89aac08)
    at sdk/editorconfigurationdlg.cpp:234
#11 0xb7815ac3 in EditorManager::Configure (this=0x8b042c0)
    at sdk/editormanager.cpp:269
---Type <return> to continue, or q <return> to quit---
#12 0x0809128d in MainFrame::OnSettingsEditor (this=0x89aac08,
    event=@0xbfbbb730) at src/main.cpp:2975
#13 0xb79fa2c1 in wxAppConsole::HandleEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#14 0xb7a82edf in wxEvtHandler::ProcessEventIfMatches ()
   from /usr/lib/libwx_baseu-2.6.so.0
#15 0xb7a830b0 in wxEventHashTable::HandleEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#16 0xb7a83261 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#17 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#18 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#19 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#20 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#21 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#22 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#23 0xb7a83207 in wxEvtHandler::ProcessEvent ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/libwx_baseu-2.6.so.0
#24 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#25 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#26 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#27 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#28 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#29 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#30 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#31 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#32 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#33 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#34 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
---Type <return> to continue, or q <return> to quit---
#35 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#36 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#37 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#38 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#39 0xb7a83207 in wxEvtHandler::ProcessEvent ()
   from /usr/lib/libwx_baseu-2.6.so.0
#40 0xb7c7de45 in wxMenu::~wxMenu () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#41 0xb6dfeab3 in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#42 0xb6df33a8 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#43 0xb6e01b13 in g_signal_stop_emission () from /usr/lib/libgobject-2.0.so.0
#44 0xb6e03150 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#45 0xb6e034c3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#46 0xb7231f8d in IA__gtk_widget_activate (widget=0x8357a80)
    at gtkwidget.c:3766
#47 0xb715ec69 in IA__gtk_menu_shell_activate_item (menu_shell=0x8b02448,
    menu_item=0x8357a80, force_deactivate=1) at gtkmenushell.c:1057
#48 0xb715ef3d in gtk_menu_shell_button_release (widget=0x8b02448,
    event=0x83c20f0) at gtkmenushell.c:663
---Type <return> to continue, or q <return> to quit---
#49 0xb715566e in gtk_menu_button_release (widget=0x8b02448, event=0x98db36c)
    at gtkmenu.c:2571
#50 0xb715002c in _gtk_marshal_BOOLEAN__BOXED (closure=0x8141e60,
    return_value=0xbfbbbdf0, n_param_values=2, param_values=0xbfbbbedc,
    invocation_hint=0xbfbbbddc, marshal_data=0xb715561f) at gtkmarshalers.c:83
#51 0xb6df2d75 in g_cclosure_new_swap () from /usr/lib/libgobject-2.0.so.0
#52 0xb6df33a8 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#53 0xb6e01c9f in g_signal_stop_emission () from /usr/lib/libgobject-2.0.so.0
#54 0xb6e02ec3 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#55 0xb6e034c3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#56 0xb723216f in gtk_widget_event_internal (widget=0x8b02448, event=0x83c20f0)
    at gtkwidget.c:3735
#57 0xb714e767 in IA__gtk_propagate_event (widget=0x8b02448, event=0x83c20f0)
    at gtkmain.c:2169
#58 0xb714eba0 in IA__gtk_main_do_event (event=0x83c20f0) at gtkmain.c:1406
#59 0xb735cb2d in gdk_event_dispatch (source=0x98db36c, callback=0,
    user_data=0x0) at gdkevents-x11.c:2291
#60 0xb6d854ee in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#61 0xb6d884f6 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#62 0xb6d887e3 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#63 0xb714de65 in IA__gtk_main () at gtkmain.c:985
#64 0xb7c0a2a7 in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#65 0xb7c99b6a in wxAppBase::MainLoop ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/libwx_gtk2u_core-2.6.so.0
#66 0xb7c99c4f in wxAppBase::OnRun () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#67 0x08069f40 in CodeBlocksApp::OnRun (this=0x8129de0) at src/app.cpp:470
#68 0xb7a2dad4 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#69 0xb7a2db88 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#70 0x080693d0 in main (argc=1, argv=0xbfbbc494) at src/app.cpp:96
(gdb)

--- End quote ---

Best wishes,
Michael

Pecan:

--- Code: ---#3  0x0806da16 in wxString::operator= (this=0x98db36c, psz=0xb5cd1210)
    at string.h:854
#4  0xb5cba35e in LoadDefaultSettings (languages=0x98db36c)
    at codestatconfig.cpp:224
#5  0xb5cbac3b in LoadSettings (languages=0x98db36c) at codestatconfig.cpp:297
#6  0xb5cbb3f4 in CodeStatConfigDlg (this=0x98db208, parent=0x879ebd0)
    at codestatconfig.cpp:42
#7  0xb5cb64ed in CodeStat::GetConfigurationPanel (this=0x87c7e00,
    parent=0x879ebd0) at codestat.cpp:80
#8  0xb7858504 in PluginManager::GetConfigurationPanels (this=0x9180228,
    group=4, parent=0x879ebd0, arrayToFill=@0xbfbbb34c)


--- End code ---

My initial impression:

It appear to me that codestats is referencing an unallocated array(languages)in statement 224. Editor Settings calls codestate config routine which attempts to read in info into array "languages" which is only allocated locally in CodeStat::Execute() which has not been executed.

I'll try to get this error myself, but if I cannot, I'll ask Michael to do a "frame 5" then a "print languages" and see what happens.

Any comments?

thanks
pecan


Pecan:

--- Code: ---int LoadSettings(LanguageDef languages[NB_FILETYPES_MAX])
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("codestat"));
    int nb_languages = cfg->ReadInt(_T("/nb_languages"), 0);

    // If no comment styles exist, use and save default ones
    if (nb_languages == 0)
    {
       nb_languages = LoadDefaultSettings(languages);
    }
    // else, load the user settings


--- End code ---

I've tried for a couple of hours to recreate the error, but have failed.
It appears to be happening when nb_languages == 0.
My system always gets an nb_languages = 7. So...
Yiannis may be right about corrupted resources. But the err should
not segfault CB.

I'll work on this some more when I have time. But for now...
It's Easter and I have to pay attention to family.

thanks
pecan

Michael:

--- Quote from: Pecan on April 15, 2006, 03:31:36 am ---
--- Code: ---int LoadSettings(LanguageDef languages[NB_FILETYPES_MAX])
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("codestat"));
    int nb_languages = cfg->ReadInt(_T("/nb_languages"), 0);

    // If no comment styles exist, use and save default ones
    if (nb_languages == 0)
    {
       nb_languages = LoadDefaultSettings(languages);
    }
    // else, load the user settings


--- End code ---

I've tried for a couple of hours to recreate the error, but have failed.
It appears to be happening when nb_languages == 0.
My system always gets an nb_languages = 7. So...
Yiannis may be right about corrupted resources. But the err should
not segfault CB.

--- End quote ---

Hello,

Thanks for your investigation :).

About corrupted resources, I am do not know. I always svn up, build C::B, ./update and then the contr. plugins... I think that the resources should be up tp date, or?

I will check about nb_languages. May be a additional check could be add to prevent nb_languages=0 problems.


--- Quote from: Pecan on April 15, 2006, 03:31:36 am ---I'll work on this some more when I have time. But for now...
It's Easter and I have to pay attention to family.

--- End quote ---

Happy Easter :).

Best wishes,
Michael

Pecan:

--- Quote --- I always svn up, build C::B, ./update and then the contr. plugins...

--- End quote ---

could you try to svn update; CB compile; contrib plugin compile, *then*
./update

see if that makes a difference...

thanks
pecan

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version