Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Michael on March 09, 2006, 01:13:44 pm

Title: C::B crash (Settings-->Editor)
Post by: Michael on March 09, 2006, 01:13:44 pm
Hello,

I think that this is an already-know problem, but I would like to know how can I continue to use the: Settings-->Editor.

I had just finished to build C::B by using its project file (C::B rev2156) and I wanted to change something in the Settings-->Editor. C::B crashed and I had to kill the process. When trying to re-opening it, C::B looked ok, but when I tried to open the Settings-->Editor, I got a "Debug report "codeblocks" dialog. It said that a debug report was generated under "/tmp/codeblocks_dbgrpt-10597-20060309T124959". The report is depicted below, but how can I re-use the Settings-->Editor? I continue to get the "Debug report "codeblocks" dialog.

Quote
<?xml version="1.0" encoding="utf-8"?>
<report version="1.0" kind="exception">
  <system description="Linux 2.6.12-10-386 i686"/>
  <modules>
    <module path="[heap]" address="080e1000" size="017bc000"/>
    <module path="/SYSV00000000" address="b675f000" size="000c0000"/>
    <module path="/SYSV00000000" address="b7f08000" size="00003000"/>
    <module path="[stack]" address="bfd0f000" size="00016000"/>
  </modules>
  <stack>
    <frame level="2" function="wxStackWalker::Walk(unsigned int)" offset="00000030"/>
    <frame level="3" function="wxDebugReport::AddContext(wxDebugReport::Context)" offset="00000a16"/>
    <frame level="4" function="wxDebugReport::AddAll(wxDebugReport::Context)" offset="00000018"/>
    <frame level="5" function="CodeBlocksApp::OnFatalException()" offset="00000000" file="src/app.cpp" line="490"/>
    <frame level="6" function="wxFatalSignalHandler" offset="00000026"/>
    <frame level="7"/>
    <frame level="8" function="wxStringBase::AllocBeforeWrite(unsigned int)" offset="0000001f"/>
    <frame level="9" function="wxStringBase::AssignCopy(unsigned int, wchar_t const*)" offset="00000060"/>
    <frame level="10" function="wxStringBase::operator=(wchar_t const*)" offset="00000038"/>
    <frame level="11" function="wxString::operator=(wchar_t const*)" offset="00000022" file="/usr/include/wx-2.6/wx/string.h" line="854"/>
    <frame level="12" function="CodeStat::LoadSettings(LanguageDef*)" offset="00000027"/>
    <frame level="13" function="CodeStat::GetConfigurationPanel(wxWindow*)" offset="00000090"/>
    <frame level="14" function="PluginManager::GetConfigurationPanels(int, wxWindow*, ConfigurationPanelsArray&amp;)" offset="00000124"/>
    <frame level="15" function="EditorConfigurationDlg::AddPluginPanels()" offset="000000cb"/>
    <frame level="16" function="EditorConfigurationDlg::EditorConfigurationDlg(wxWindow*)" offset="00002276"/>
    <frame level="17" function="EditorManager::Configure()" offset="00000051"/>
    <frame level="18" function="MainFrame::OnSettingsEditor(wxCommandEvent&amp;)" offset="0000002d" file="src/main.cpp" line="2951"/>
    <frame level="19" function="wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&amp;), wxEvent&amp;) const" offset="00000031"/>
    <frame level="20" function="wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&amp;, wxEvtHandler*, wxEvent&amp;)" offset="0000007d"/>
    <frame level="21" function="wxEventHashTable::HandleEvent(wxEvent&amp;, wxEvtHandler*)" offset="00000074"/>
    <frame level="22" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="000000bd"/>
    <frame level="23" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="24" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="25" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="26" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="27" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="28" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="29" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="30" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="31" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="32" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="33" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="34" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="35" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="36" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="37" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="38" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="39" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="40" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="41" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="42" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="43" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="44" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="45" function="wxEvtHandler::ProcessEvent(wxEvent&amp;)" offset="00000063"/>
    <frame level="46"/>
    <frame level="47" function="g_cclosure_marshal_VOID__VOID" offset="00000043"/>
    <frame level="48" function="g_closure_invoke" offset="0000011e"/>
    <frame level="49"/>
    <frame level="50" function="g_signal_emit_valist" offset="000006ab"/>
    <frame level="51" function="g_signal_emit" offset="00000029"/>
    <frame level="52" function="gtk_widget_activate" offset="0000008a"/>
    <frame level="53" function="gtk_menu_shell_activate_item" offset="000000d0"/>
    <frame level="54"/>
    <frame level="55"/>
    <frame level="56" function="_gtk_marshal_BOOLEAN__BOXED" offset="00000058"/>
    <frame level="57"/>
    <frame level="58" function="g_closure_invoke" offset="0000011e"/>
    <frame level="59"/>
    <frame level="60" function="g_signal_emit_valist" offset="0000041e"/>
    <frame level="61" function="g_signal_emit" offset="00000029"/>
    <frame level="62"/>
    <frame level="63" function="gtk_propagate_event" offset="000000c1"/>
    <frame level="64" function="gtk_main_do_event" offset="00000325"/>
    <frame level="65"/>
    <frame level="66" function="g_main_context_dispatch" offset="000001dc"/>
    <frame level="67"/>
    <frame level="68" function="g_main_loop_run" offset="000001a1"/>
    <frame level="69" function="gtk_main" offset="000000b4"/>
    <frame level="70" function="wxEventLoop::Run()" offset="00000055"/>
    <frame level="71" function="wxAppBase::MainLoop()" offset="0000004c"/>
    <frame level="72" function="wxAppBase::OnRun()" offset="00000021"/>
    <frame level="73" function="CodeBlocksApp::OnRun()" offset="00000000" file="src/app.cpp" line="461"/>
    <frame level="74" function="wxEntry(int&amp;, wchar_t**)" offset="0000005c"/>
    <frame level="75" function="wxEntry(int&amp;, char**)" offset="00000032"/>
    <frame level="76" function="main" offset="00000394" file="src/app.cpp" line="89"/>
  </stack>
</report>

Thank you very much.

Best wishes,
Michael

PS.: I use ubuntu 5.10
Title: Re: C::B crash (Settings-->Editor)
Post by: MortenMacFly on March 09, 2006, 01:27:13 pm
"/tmp/codeblocks_dbgrpt-10597-20060309T124959" [...]
Did you run the C::B version of the output folder? If so, could you please try again using the "debug" version from the devel folder? Thus the offset addresses in the crash report should be de-referenced to the actual lines in the sources.
With regards, Morten.
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on March 09, 2006, 01:41:55 pm
Hello,

Thanks for your answer :).

I use already the devel C::B. I have done a link of the run.sh, which is located under /home/michael/devel/trunk/src/devel/run.sh

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: mandrav on March 09, 2006, 02:27:33 pm
AFAIK, the crash is caused by the codestat plugin.
I haven't investigated why though...
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on March 09, 2006, 02:37:21 pm
AFAIK, the crash is caused by the codestat plugin.
I haven't investigated why though...

Thank you very much for your answer :D. I always keep each plugin active and never de-selected one (on windows at least). I will try to remove Codestat plugin.

I have tried to re-start the computer, but I continue to get the Debug report dialog and then C:.B quits. So, I think that I have to delete the devel repository and make a full re-build with the C::B I have built using make.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on March 09, 2006, 04:31:22 pm
Yes, it seems it was the codestat plugin. Strange, because since I use C::B on ubuntu 5.10, I never got that crush. But since I got it, C::B crushes at each time, I try to change the Editor's settings. Now that I have removed it it works well again.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Ceniza on March 14, 2006, 04:23:30 pm
Codestat? So why am I having the same problem with no contribs?

If I open Code::Blocks (without opening anything) and go to Settings -> Editor, it shows the dialog without problems, but if I open a project and try the same it just dies (but no ugly crash). If I open the project, close it and try it, it also dies. A lovely 0% CPU usage death.

I just tried disabling CodeCompletion and it works fine.

In fact I've found that plugin really useless under Linux. I just cannot get it to work.

I loaded a project, tried Reparse now and it's all I get:

Quote from: Code::Blocks Debug
[10:21:32.842]: Add project Client in parsing queue
[10:21:38.808]: Add project Client in parsing queue
Title: Re: C::B crash (Settings-->Editor)
Post by: takeshimiya on March 14, 2006, 04:38:24 pm
I just tried disabling CodeCompletion and it works fine.
Same here.

In fact I've found that plugin really useless under Linux. I just cannot get it to work.
Indeed, I think we need to put a big warning on linux, because the CodeCompletion and wxSmith plugins are really unuseable there at the moment.
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on March 14, 2006, 05:01:35 pm
Codestat? So why am I having the same problem with no contribs?

I have not tried a lot, but what I have remarked is that when I have installed C::B for the first time and enabled all the plugins, C::B worked fine. Then when I tried to open the Settings-->Editor, it crashed and continue to crash even if no project were loaded. I misundertood Yannis and disabled code completion. C::B continued to crash. Then I disabled codestat and re-enabled code completition and...C::B worked. Anyway, there must be some bugs somewhere that prevent C::B under Linux to work fine.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: aarti_pl on March 14, 2006, 08:54:14 pm
I got the same bug from quite a long time. It drives me crazy because before I couldn't even compile CB from source using Makefiles. Now it compiles, but it crashes when I try to open almost any dialog which is defined in resources (not only Settings-->Editor).

My Config: Ubuntu Breezy; Codeblocks svn compiled with Makefile.

BR
Aarti_pl
Title: Re: C::B crash (Settings-->Editor)
Post by: mandrav on March 14, 2006, 09:39:18 pm
I got the same bug from quite a long time. It drives me crazy because before I couldn't even compile CB from source using Makefiles. Now it compiles, but it crashes when I try to open almost any dialog which is defined in resources (not only Settings-->Editor).

My Config: Ubuntu Breezy; Codeblocks svn compiled with Makefile.

BR
Aarti_pl

A forum search would have helped you from going crazy...


make clean-zipfiles
make
sudo make install
Title: Re: C::B crash (Settings-->Editor)
Post by: aarti_pl on March 14, 2006, 11:00:56 pm
Probably I will have to get mad :(

I applied your hint and it changed nothing at all. From settings only works: Editor and Global variables.
Dialogs which doesn't work: Settings-->Environment, Settings-->Compiler and Debugger, Plugins-->Manage Plugins.
When I choose one of these dialogs I get: Error in resource - there is no handler for wxCheckList.

PS1. I recompiled the whole project to make sure that everything is ok. It also doesn't help.
PS2. I can't attach zipped logs because "upload folder is full".

BR
Aarti_pl
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on March 15, 2006, 10:58:36 am
Hello,

That very strange, because I have had no problems building C::B and contr.plugins both by make and by using the project file(s). You can try to fully unistall C::B and then trying to re-install it by following the wiki instructions (http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Linux_%28applies_to_all_distros%29). Anyway, you do not need to build wxWidgets, you can use the pre-installed Ubuntu package (do not forget wx-common package :)).

You can also give a try of a .deb package (look at my signature) and see if it works for you.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 14, 2006, 11:30:58 am
Hello,

Following Pecan's suggestion (and to avoid to hijack another topic), I have tried to get more info on my Settings-->Editor crash with codestats plugin (C::B rev2317). Here is the gdb output:

Quote
(gdb) run
Starting program: /home/michael/devel/trunk/src/devel/codeblocks
[Thread debugging using libthread_db enabled]
[New Thread -1228880192 (LWP 13442)]

(process:13442): Gdk-WARNING **: locale not supported by Xlib

(process:13442): Gdk-WARNING **: cannot set locale modifiers
[New Thread -1236251728 (LWP 13653)]
[New Thread -1249666128 (LWP 13669)]
[New Thread -1259459664 (LWP 13670)]
[Thread -1259459664 (zombie) exited]

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)

It seems a problem of zombie thread. I have done some tests without codestats plugin, and there still are zombie threads. So, it is probably not the cause of the crash or not directly.

[EDIT]: I have remarked that only the Editor menu has zombie threads. When opening the other Settings menu, no additional thread(s) is created, but when opening Editor (withour or with codestats plugin), two new threads are created and relatively fast, the third is exited and marked as zombie. When closing the Editor menu (without codestats plugin) the second thread is closed and marked as zombie, then another thread is created, exited and marked as zombie.

May be this fact could make problems with codestats plugins and generate the SIGSEGV. 

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: 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)

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.

thanks
pecan

Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 14, 2006, 02:40:23 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)

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.

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)

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 15, 2006, 01:35:14 am
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)


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


Title: Re: C::B crash (Settings-->Editor)
Post by: 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


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
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 15, 2006, 08:30:30 pm
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


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.

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.

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.

Happy Easter :).

Best wishes,
Michael

Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 15, 2006, 11:00:46 pm
Quote
I always svn up, build C::B, ./update and then the contr. plugins...

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

see if that makes a difference...

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 15, 2006, 11:19:00 pm
Quote
I always svn up, build C::B, ./update and then the contr. plugins...

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

see if that makes a difference...

Ok, I will give it a try.

Thanks for the suggestion.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 15, 2006, 11:35:12 pm
Quote
I always svn up, build C::B, ./update and then the contr. plugins...

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

see if that makes a difference...

Ok, I will give it a try.

C::B still crashes when trying Settings-->Editor.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 16, 2006, 12:25:35 am
Quote
from Michael....
C::B still crashes when trying Settings-->Editor.

Ok, thanks. It was just a stab in the dark.
I'm currently 200 miles from my Linux system,
so I'll pick up on this on Thursday next.

thanks
pecan

Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 16, 2006, 12:29:31 am
Quote
from Michael....
C::B still crashes when trying Settings-->Editor.

Ok, thanks. It was just a stab in the dark.
I'm currently 200 miles from my Linux system,
so I'll pick up on this on Thursday next.

Anyway, it was worth trying :).

I try to debug C::B/codestats too, but my Pentium III is so slow that is not really a pleasure to work with.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 16, 2006, 12:57:38 am
EDIT: never mind.. nb_lanugages is in default.conf.
Code
	<codestat>

<NB_LANGUAGES int="7" />
Will someone explain the following statements in CodeStat
Code
291    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("codestat"));
292    int nb_languages = cfg->ReadInt(_T("/nb_languages"), 0);
evidently, my guess at what they're doing is incorrect. I cannot find a field "nb_languages"
in the resources.

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 16, 2006, 01:06:17 am
Michael,

would you look in default.conf (or which ever the one you're using)
and show us your <codestat> entry.

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 16, 2006, 01:24:27 am
Michael,

would you look in default.conf (or which ever the one you're using)
and show us your <codestat> entry.

Sorry, but where it is located on Linux? I have just <str>CodeStatistics</str> under <locale> and <CodeStatistics bool="1" /> under <plugins>.

I will try to delete it and see what happen.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 16, 2006, 01:42:33 am
Michael,

would you look in default.conf (or which ever the one you're using)
and show us your <codestat> entry.

Sorry, but where it is located on Linux?

Best wishes,
Michael


I believe it's in your home directory under ".codeblocks"
named default.conf


thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 16, 2006, 02:03:32 am
I believe it's in your home directory under ".codeblocks"
named default.conf

Thank you :). I though it was somewhere under /, But after 15 minutes I have found it :).

Anyway, deleting it does not solve the crash.

The problem seems in language (LoadDefaultSettings at codestatconfig.cpp:224):

Code
languages[0].name = _T("C/C++");

But I have not found exactly why. May be it depends on my configuration.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 16, 2006, 02:15:04 am
Code
The problem seems in language (LoadDefaultSettings at codestatconfig.cpp:224):

Actually, I'm leaning toward the fact that "languages" in
"LoadSetting(languages)" in the following code has never been allocated. But I
can't prove it yet.

The only allocation of languages is in the routine Execute()
which is never executed when the Editor/Settings routines
invokes CodeStatConfigDlg

I've got to figure out why "LoadSettings(languages)" doesn't get an error
from the compiler.

Code
CodeStatConfigDlg::CodeStatConfigDlg(wxWindow* parent)
{
    wxXmlResource::Get()->LoadPanel(this, parent, _("dlgCodeStatConfig"));

    // Load the languages parameters
    nb_languages = LoadSettings(languages);

    ReInitDialog();
}

Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 16, 2006, 02:20:06 am
Michael,

would you look in default.conf (or which ever the one you're using)
and show us your <codestat> entry.

Sorry, but where it is located on Linux?

Best wishes,
Michael


I believe it's in your home directory under ".codeblocks"
named default.conf


thanks
pecan


Actually, I want to know what is in your default.conf
under the key <codestat> to see why
Code
int LoadSettings(LanguageDef languages[NB_FILETYPES_MAX])
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("codestat"));
    int nb_languages = cfg->ReadInt(_T("/nb_languages"), 0);

nb_languages ends up being 0.
For example, my default.conf key <codestat> contains
Code
	<codestat>
<NB_LANGUAGES int="7" />
<l0>
<NAME>
<str>C/C++</str>
</NAME>
<EXT>
<str>c cpp h hpp </str>
</EXT>
<SINGLE_LINE_COMMENT>
<str>//</str>
</SINGLE_LINE_COMMENT>
<MULTIPLE_LINE_COMMENT_BEGIN>
<str>/*</str>
</MULTIPLE_LINE_COMMENT_BEGIN>
<MULTIPLE_LINE_COMMENT_END>
<str>*/</str>
</MULTIPLE_LINE_COMMENT_END>
</l0>
<l1>
<NAME>
<str>Java</str>
</NAME>
<EXT>
<str>java </str>
</EXT>
<SINGLE_LINE_COMMENT>
<str>//</str>
</SINGLE_LINE_COMMENT>
<MULTIPLE_LINE_COMMENT_BEGIN>
<str>/*</str>
</MULTIPLE_LINE_COMMENT_BEGIN>
<MULTIPLE_LINE_COMMENT_END>
<str>*/</str>
</MULTIPLE_LINE_COMMENT_END>
</l1>
<l2>
<NAME>
<str>Python</str>
</NAME>
<EXT>
<str>py </str>
</EXT>
<SINGLE_LINE_COMMENT>
<str>#</str>
</SINGLE_LINE_COMMENT>
<MULTIPLE_LINE_COMMENT_BEGIN>
<str />
</MULTIPLE_LINE_COMMENT_BEGIN>
<MULTIPLE_LINE_COMMENT_END>
<str />
</MULTIPLE_LINE_COMMENT_END>
</l2>
<l3>
<NAME>
<str>Perl</str>
</NAME>
<EXT>
<str>pl </str>
</EXT>
<SINGLE_LINE_COMMENT>
<str>#</str>
</SINGLE_LINE_COMMENT>
<MULTIPLE_LINE_COMMENT_BEGIN>
<str />
</MULTIPLE_LINE_COMMENT_BEGIN>
<MULTIPLE_LINE_COMMENT_END>
<str />
</MULTIPLE_LINE_COMMENT_END>
</l3>
<l4>
<NAME>
<str>ASM</str>
</NAME>
<EXT>
<str>asm </str>
</EXT>
<SINGLE_LINE_COMMENT>
<str>;</str>
</SINGLE_LINE_COMMENT>
<MULTIPLE_LINE_COMMENT_BEGIN>
<str />
</MULTIPLE_LINE_COMMENT_BEGIN>
<MULTIPLE_LINE_COMMENT_END>
<str />
</MULTIPLE_LINE_COMMENT_END>
</l4>
<l5>
<NAME>
<str>Pascal</str>
</NAME>
<EXT>
<str>pas </str>
</EXT>
<SINGLE_LINE_COMMENT>
<str />
</SINGLE_LINE_COMMENT>
<MULTIPLE_LINE_COMMENT_BEGIN>
<str>{</str>
</MULTIPLE_LINE_COMMENT_BEGIN>
<MULTIPLE_LINE_COMMENT_END>
<str>}</str>
</MULTIPLE_LINE_COMMENT_END>
</l5>
<l6>
<NAME>
<str>Matlab</str>
</NAME>
<EXT>
<str>m </str>
</EXT>
<SINGLE_LINE_COMMENT>
<str>%</str>
</SINGLE_LINE_COMMENT>
<MULTIPLE_LINE_COMMENT_BEGIN>
<str />
</MULTIPLE_LINE_COMMENT_BEGIN>
<MULTIPLE_LINE_COMMENT_END>
<str />
</MULTIPLE_LINE_COMMENT_END>
</l6>
</codestat>
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 16, 2006, 02:34:16 am
Hello,

What I have found is that language[NB_FILETYPES_MAX] and nb_languages are private members of the class CodeStatConfigDlg (in codestatconfig.h).

The problem with the Settings-->Editor come from here CodeStatConfigDlg::CodeStatConfigDlg(wxWindow* parent) (codestatconfig.cpp, lignes 35-45).

When in LoadDefaultSettings C::B tries languages[0].name = _T("C/C++"); it crashes.

In my config file I do not have this. MAy be because when C::B crashes, modification are not stored into the config file?

I just will try to add part of your config to mine. [EDIT]: It still crashes :(.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Zlika on April 17, 2006, 08:13:22 pm
Hi
The default settings are stored in the config file at the first use of codestat (in the LoadSettings function, the "int nb_languages = cfg->ReadInt(_T("/nb_languages"), 0);" should return 0 and then the LoadDefaultSettings function is called to load and save the default settings of the plugin). So it's normal that your config file doen't contains any codestat settings (until it works correctly...).

However, your crash is very strange because I can't understand where there can be an error in "languages[0].name = _T("C/C++");", just before your crash. There is no problem of memory allocation because "languages" is an array of fixed size.

I'll try to investigate the problem but it's very difficult because I can't reproduce the error. Tell me if you have more info about it.
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 17, 2006, 08:42:41 pm
However, your crash is very strange because I can't understand where there can be an error in "languages[0].name = _T("C/C++");", just before your crash. There is no problem of memory allocation because "languages" is an array of fixed size.

I'll try to investigate the problem but it's very difficult because I can't reproduce the error. Tell me if you have more info about it.

Hello,

I am not fully sure, but it seems to me that the problem is related to the operator =.

Quote
#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
[...]

Anyway, it should be a local problem (may b e from my wxGTK library). I will try to investigate and see what i cna find out.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 17, 2006, 10:03:14 pm
Code
"languages[0].name = _T("C/C++");"

To see if it's a wxGTK error in wxString operator=() try
the following on the first assignment statement and
see if the crash moves to the second assignment.

Code
"languages[0].name = wxString(_T("C/C++"));"

This forces the creation of the string form operator=
to wxString::Clear() and then to wxString::Append().

This is looking more and more like a wxGTK error, but
I couldn't find anything about an assignment bug on
google or wxWidgets.

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 17, 2006, 10:09:09 pm
Quote
However, your crash is very strange because I can't understand where there can be an error in "languages[0].name = _T("C/C++");", just before your crash. There is no problem of memory allocation because "languages" is an array of fixed size.

The allocation crash is not in the allocation of the lanugages
array, it's in the allocation of memory for the creation of the
wxString. wxGTK is allocating 2 byte at a time and copying
"C/C++" into a wxString at AllocBeforWrite().

pecan

Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 17, 2006, 10:28:09 pm
Code
"languages[0].name = _T("C/C++");"

To see if it's a wxGTK error in wxString operator=() try
the following on the first assignment statement and
see if the crash moves to the second assignment.

Code
"languages[0].name = wxString(_T("C/C++"));"

This forces the creation of the string form operator=
to wxString::Clear() and then to wxString::Append().

This is looking more and more like a wxGTK error, but
I couldn't find anything about an assignment bug on
google or wxWidgets.

It still crash, but with a difference:

Quote
#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
[...]

The cause for the SIGSEGV seems now to be the wxStringBase::operator= () from /usr/lib/libwx_baseu-2.6.so.0.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 18, 2006, 12:11:38 am
Here's the code executed during the assignment.
Notice that the assignment can fail if memory allocation fails.
No message will occur because wxFail_Msg is issued only in
__wxDEBUG__ mode.
Code
// assigns C string
wxStringBase& wxStringBase::operator=(const wxChar *psz)
{
  if ( !AssignCopy(wxStrlen(psz), psz) ) {
    wxFAIL_MSG( _T("out of memory in wxStringBase::operator=(const wxChar *)") );
  }
  return *this;
}

// helper function: does real copy
bool wxStringBase::AssignCopy(size_t nSrcLen, const wxChar *pszSrcData)
{
  if ( nSrcLen == 0 ) {
    Reinit();
  }
  else {
    if ( !AllocBeforeWrite(nSrcLen) ) {
      // allocation failure handled by caller
      return false;
    }
    memcpy(m_pchData, pszSrcData, nSrcLen*sizeof(wxChar));
    GetStringData()->nDataLength = nSrcLen;
    m_pchData[nSrcLen] = wxT('\0');
  }
  return true;
}



Is it possible that your're giving out of memory? How much memory
do you have on that system?

pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 18, 2006, 12:24:30 am
Is it possible that your're giving out of memory? How much memory
do you have on that system?

After the System Monitor I have 504.4MB User Memory and 528.0MB Used swap.

I would exclude a lack of memory.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 18, 2006, 04:40:01 am
Michael,
Would you change statement at line 224 to the following to see
if wxgtk is miscalculating the string length.

Code
    languages[0].name = wxString(_T("C/C++"),14);

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 18, 2006, 12:59:07 pm
Michael,
Would you change statement at line 224 to the following to see
if wxgtk is miscalculating the string length.

Code
    languages[0].name = wxString(_T("C/C++"),14);

Done.

I get the same error(s) as depicted above (http://forums.codeblocks.org/index.php?topic=2586.msg22891#msg22891).

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Zlika on April 18, 2006, 06:38:31 pm
Just to be sure, do you have the same problem when executing the plugin? (it should execute the same function if the settings are missing, but I want to be sure the error is not related to the way CB load the "settings->editor" forms).
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 18, 2006, 09:39:27 pm
Just to be sure, do you have the same problem when executing the plugin? (it should execute the same function if the settings are missing, but I want to be sure the error is not related to the way CB load the "settings->editor" forms).

I not yet give a try to it in Linux. In Windows I have used it 2-3 times. Let me check and I will report.

[EDIT]: If I try to use codestats plugin, C::B crashes with the same errors as Settings-->Editor.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 19, 2006, 09:33:59 pm
The following is the backtrace and code causing the crash.
the "name" string data pointer inside the languages array is never initialized to wxEmptyString on gtk.

GetStringData() is returning m_pchData as 0x0 -1 or (0xfffffff4) as
the address of the languages[].name wxString data.

The culprit is Statement 801: GetStringData()->Unlock();
Now...
Why is languages[].name data pointer not being constructed? Its being set to
all 0x0's

Is it possible that name *is* being constructed, then the non wxWidget array
"languages" is being cleared because languages is not holding pointers
but objects?

I'll test that conjecture next.

Code
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1230338368 (LWP 30464)]
0x0806e494 in wxStringData::IsEmpty (this=0xfffffff4) at string.h:219
219       bool  IsEmpty()   const { return (nRefs == -1); }
(gdb) bt
#0  0x0806e494 in wxStringData::IsEmpty (this=0xfffffff4) at string.h:219
#1  0x0806e4fc in wxStringData::Unlock (this=0xfffffff4) at string.h:236
#2  0xb78e5569 in wxStringBase::operator= (this=0x8822644,
    stringSrc=@0xbfa66a20) at ../src/common/string.cpp:801
#3  0x0806ea4b in wxString::operator= (this=0x8822644) at string.h:610
#4  0xb52767b1 in LoadDefaultSettings (languages=0x8822644)
    at codestatconfig.cpp:224
#5  0xb52770c3 in LoadSettings (languages=0x8822644) at codestatconfig.cpp:297
#6  0xb527787c in CodeStatConfigDlg (this=0x88224e0, parent=0x8a5e518)
    at codestatconfig.cpp:42
#7  0xb527275d in CodeStat::GetConfigurationPanel (this=0x88540b0,
    parent=0x8a5e518) at codestat.cpp:80
#8  0xb76b20f0 in PluginManager::GetConfigurationPanels (this=0x8a040b0,
    group=4, parent=0x8a5e518, arrayToFill=@0xbfa6718c)
    at sdk/pluginmanager.cpp:454
#9  0xb7655632 in EditorConfigurationDlg::AddPluginPanels (this=0xbfa66f98)
    at sdk/editorconfigurationdlg.cpp:258
#10 0xb765adaa in EditorConfigurationDlg (this=0xbfa66f98, parent=0x8338098)
    at sdk/editorconfigurationdlg.cpp:234
#11 0xb766d512 in EditorManager::Configure (this=0x846ac38)
    at sdk/editormanager.cpp:264
#12 0x08093cd5 in MainFrame::OnSettingsEditor (this=0x8338098,
    event=@0xbfa67524) at src/main.cpp:2976
#13 0xb7885a99 in wxAppConsole::HandleEvent (this=0x8130ea0,
    handler=0x8338098, func=
      {__pfn = 0x8093ca8 <MainFrame::OnSettingsEditor(wxCommandEvent&)>, __delta = 0}, event=@0xbfa67524) at ../src/common/appbase.cpp:320
#14 0xb79246d2 in wxEvtHandler::ProcessEventIfMatches (entry=@0x80eb298,
    handler=0x8338098, event=@0xbfa67524) at ../src/common/event.cpp:1185
#15 0xb7924abb in wxEventHashTable::HandleEvent (this=0x80eb4d8,
    event=@0xbfa67524, self=0x8338098) at ../src/common/event.cpp:867
#16 0xb7925a33 in wxEvtHandler::ProcessEvent (this=0x8338098,
---Type <return> to continue, or q <return> to quit---q
event=@0xbfa67524)Quit
(gdb) l
867     ../src/common/event.cpp: No such file or directory.
        in ../src/common/event.cpp
(gdb)

// assigns one string to another
wxStringBase& wxStringBase::operator=(const wxStringBase& stringSrc)
{
  wxASSERT( stringSrc.GetStringData()->IsValid() );

  // don't copy string over itself
  if ( m_pchData != stringSrc.m_pchData ) {
    if ( stringSrc.GetStringData()->IsEmpty() ) {
      Reinit();
    }
    else {
      // adjust references
      GetStringData()->Unlock();    <==== crash victim =====
      m_pchData = stringSrc.m_pchData;
      GetStringData()->Lock();
    }
  }

  return *this;
}

Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 19, 2006, 10:52:48 pm
Quote
Is it possible that name *is* being constructed, then the non wxWidget array
"languages" is being cleared because languages is not holding pointers
but objects?

Bad news. languages[].name is actually being constructed as
as an array and being set to 0x0.

Note that all the other strings
are being constructed as wxEmptyString's.

Here are the results just after languages is constructed in CodeStatConfigDlg.
Code
0xb76b957f in LanguageDef (this=0x86ec874) at sdk/projectfileoptionsdlg.cpp:54
54      {
(gdb) n
CodeStatConfigDlg (this=0x86ec6f0, parent=0x85a7788) at codestatconfig.cpp:39
39          wxXmlResource::Get()->LoadPanel(this, parent, _("dlgCodeStatConfig"));(gdb) l
34
35      /** Load the language settings and display the configuration dialog.
36       */
37      CodeStatConfigDlg::CodeStatConfigDlg(wxWindow* parent)
38      {
39          wxXmlResource::Get()->LoadPanel(this, parent, _("dlgCodeStatConfig"));40
41          // Load the languages parameters
42          nb_languages = LoadSettings(languages);
43
(gdb) p languages[0].name
$1 = {<wxStringBase> = {static npos = 4294967295,
    m_pchData = 0x0}, <No data fields>}  <==== constructed to 0x0 =====
(gdb) p languages[0].single_line_comment
$2 = {<wxStringBase> = {static npos = 4294967295,
    m_pchData = 0xb795235c}, <No data fields>}
(gdb) p languages[0].multiple_line_comment[0]
$3 = {<wxStringBase> = {static npos = 4294967295,
    m_pchData = 0xb795235c}, <No data fields>}
(gdb)

I'll spend some time trying to find why this is happening.
Then I'll work on a workaround.
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 20, 2006, 08:00:47 pm
I am getting really bad results attempting to shoot this constructor
bug inside CodeStats plugin. The compiler is not constructing Languages_Def class correctly. It's calling the wxArrayString to construct the "name" wxString.

And... when I add a constructor to Languages_Def class, it's never
invoked under linux. But the same code executes correctly under windows.

My ubuntu 510 is using:
gcc version 4.0.2 20050808 (prerelease ) (Ubuntu 4.0.1-4 ubuntu9)

Questions:
Are all Linux users getting the Codestat crash, or just Ubuntu users?
What gcc compiler version are *non-crash* Linux users using?
Is there another gcc for Ubuntu that I can test with?

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Ceniza on April 20, 2006, 08:07:53 pm
There's GCC 3.4.3: http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/ (http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/)
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 20, 2006, 08:12:42 pm
There's GCC 3.4.3: http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/ (http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/)

Is there an "apt-get" type command to install this?

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 20, 2006, 08:26:48 pm
There's GCC 3.4.3: http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/ (http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/)

Is there an "apt-get" type command to install this?

I would use Synaptic Package Manager instead :). Anyway, I am not sure that it is a compiler issue. My colleague on Kubuntu 5.10, running the .deb compiled by me, has not Setting-->Editor crash (and I have tried several times).

May be the problems is related or to some packages I have installed and that make conflicts. The wxGTK libraries that I use are the same as him (anway, I will ask him just to be sure).

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 20, 2006, 08:30:28 pm
There is a module in sdk/Projectfileoptionsdlg.cpp that
is being used as the constructor for LanguagesDef under
ubuntu gcc 4.0.2

Code
#include "projectfileoptionsdlg.h"
#include <wx/slider.h>
#include <wx/textfile.h>

BEGIN_EVENT_TABLE(ProjectFileOptionsDlg, wxDialog)
EVT_CHOICE(-1, ProjectFileOptionsDlg::OnCompilerCombo)
EVT_UPDATE_UI(-1, ProjectFileOptionsDlg::OnUpdateUI)
END_EVENT_TABLE()

// some help functions and type (copied and adapted from the codestat plug-in)
struct LanguageDef
{
wxArrayString ext;
wxString single_line_comment;
wxString multiple_line_comment[2];
};


What is this all about. NOTE: the "wxString name" declaration
is missing.
Title: Re: C::B crash (Settings-->Editor)
Post by: Ceniza on April 20, 2006, 08:34:38 pm
Maybe apt-get install gcc-3.4 g++-3.4?

Beware it allows different versions to coexist and gcc, g++ and friends could be all symlinked to 4.0.

When going to compile Code::Blocks, force it to use gcc-3.4 and g++-3.4: CXX=g++-3.4 CC=gcc-3.4 CPP=cpp-3.4 ./configure (haven't tried though).
Title: Re: C::B crash (Settings-->Editor)
Post by: Zlika on April 20, 2006, 09:12:25 pm
There is a module in sdk/Projectfileoptionsdlg.cpp that
is being used as the constructor for LanguagesDef under
ubuntu gcc 4.0.2
What is this all about. NOTE: the "wxString name" declaration
is missing.

Yiannis took some functions of codestat to compute the number of comment/code lines for a particular file and display it in the "properties" menu of the selected file.
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 20, 2006, 09:19:53 pm
Ok, Yiannis can have it.

I've change CodeStats LanguageDef symbol to csLanguageDef
and the crash has gone away. The correct constructor is being called.
This still looks like a compiler err though.

EDIT:: Not a compiler err I'm thinking. Projectfileoptionsdlg.h is not being included
by CodeStat. LanguageDef is a structure in a .cpp and the other a
Class in CodeStats. How can it be being treated like a hidden constructor?.
But it IS....

Now... CodeStat still crashes on Linux at a new location.

It fails loading its resources in CodeStatConfigDlg::ReInitDialog(). And... it doesn't check to see if it failed, so it uses 0x0 as its txt_FileTypes address getting a SIGSEGV for its efforts.

Did this thing ever work on Linux?

I'm tired....
Title: [solved] C::B crash (Settings-->Editor)
Post by: Michael on April 20, 2006, 09:21:11 pm
Hello,

I think Pecan has solved the crash :D. I still have to test more in depth, but I got no more Settings-->Editors crash with codestats plugin :D. Moreover, codestats plugin works too without a crash :D.

To "solve" the problem, just:

Quote
// some help functions and type (copied and adapted from the codestat plug-in)
struct LanguageDef
{
   wxString name; <-- Add this!
        wxArrayString ext;
   wxString single_line_comment;
   wxString multiple_line_comment[2];
};

Pecan, you save my day :). If you decide to visit Austria and/or Switzerland (Eventually Thailand too :)), let me know and I will pay at least a dinner :D.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: mandrav on April 20, 2006, 09:22:23 pm
Yiannis took some functions of codestat to compute the number of comment/code lines for a particular file and display it in the "properties" menu of the selected file.

No, it was not Yiannis. It was Lieven, IIRC...
Title: Re: [solved] C::B crash (Settings-->Editor)
Post by: Pecan on April 20, 2006, 09:33:35 pm
Hello,

I think Pecan has solved the crash :D. I still have to test more in depth, but I got no more Settings-->Editors crash with codestats plugin :D. Moreover, codestats plugin works too without a crash :D.

To "solve" the problem, just:

Quote
// some help functions and type (copied and adapted from the codestat plug-in)
struct LanguageDef
{
   wxString name; <-- Add this!
        wxArrayString ext;
   wxString single_line_comment;
   wxString multiple_line_comment[2];
};

Pecan, you save my day :). If you decide to visit Austria and/or Switzerland (Eventually Thailand too :)), let me know and I will pay at least a dinner :D.

Best wishes,
Michael


I don't think you want to do that!! That structure is being
treated as the default "constructor" for LanguageDef.
Change the name of LanguageDef to something like csLanguageDef
and define a constructor and destructor like:
Code
#include "language_def.h"
csLanguageDef::csLanguageDef()
{
    name = wxEmptyString;
    ext.clear();
    single_line_comment = wxEmptyString;
    multiple_line_comment[0] = wxEmptyString;
    multiple_line_comment[1] = wxEmptyString;
}
csLanguageDef::~csLanguageDef()
{;}

This is going to happen again if you dont get away from that
structure....

thanks
pecan


Title: Re: [solved] C::B crash (Settings-->Editor)
Post by: Michael on April 20, 2006, 11:42:51 pm
I don't think you want to do that!! That structure is being
treated as the default "constructor" for LanguageDef.
Change the name of LanguageDef to something like csLanguageDef
and define a constructor and destructor like:
Code
#include "language_def.h"
csLanguageDef::csLanguageDef()
{
    name = wxEmptyString;
    ext.clear();
    single_line_comment = wxEmptyString;
    multiple_line_comment[0] = wxEmptyString;
    multiple_line_comment[1] = wxEmptyString;
}
csLanguageDef::~csLanguageDef()
{;}

This is going to happen again if you dont get away from that
structure....

Ok. So, I have taken out the the wxString name from the structure and changed the name of the class LanguageDef (in Code Statistics project-->language_def.h) in CsLanguageDef and its instances in cslanguages/cslanguage (in Code Statistics project).

This seems to work too. I got no crashes until now :D.

Anyway, it seems that the codestats plugin now return that the project is empty, even if it is not :?.

Best wishes,
Michael
Title: Re: [solved] C::B crash (Settings-->Editor)
Post by: Pecan on April 20, 2006, 11:51:58 pm
Anyway, it seems that the codestats plugin now return that the project is empty, even if it is not :?.

Ok, it makes sense that some quirks would occur now that
the code is changed. But it's much safer this way.

If you'd like me to test/trace through some of these problems,
you could zip up your code and attach it. I'll help if you'd like...

Also, How do you execute the plugin? Does it have a menu item?
I've never used it since the configuration structure changed some
months ago,

EDIT: found the menu item...

thanks
pecan
Title: Re: [solved] C::B crash (Settings-->Editor)
Post by: Michael on April 21, 2006, 12:06:28 am
Anyway, it seems that the codestats plugin now return that the project is empty, even if it is not :?.

Ok, it makes sense that some quirks would occur now that
the code is changed. But it's much safer this way.

If you'd like me to test/trace through some of these problems,
you could zip up your code and attach it. I'll help if you'd like...

I have just changed the class name and the name of all its instances within the Code Statistics project. Theoretically it should works, but may be there is a dependency with the structure in the sdk. Would have to check.

I have compressed the codestats plugin and put in my File Hosting system. You can get it from here.

Thank you very much for your help :).

Also, How do you execute the plugin? Does it have a menu item?
I've never used it since the configuration structure changed some
months ago,

To execute the plugin, just open a project and then Plugins-->Code Statistics (be sure to have it selected under Plugins-->Manage plugins).

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: killerbot on April 21, 2006, 07:52:54 am
I have borrowed some code and functions from the codestats, to provide some statistics in the properties panel of a projectfile.
Though the functions are at global scope; so different name then the plug-in, but it seems (have to check code, will do that in 2 hours) the structure has the same name. Maybe the linker/???/??? get's confused>. Though both definitions are in different dll's; so only when both dll's are loaded we (could) have twice the definition.

If there's a name clash, I don't think the plug-in should change, the "borrower" should change, that's only fair. Although I might have an idea on how to plug-in can protect itself against those "code stealers" ;-)

More on this later, should reread tha last topics and look at the code fore some better analysis.

Will be back soon ...
Title: Re: C::B crash (Settings-->Editor)
Post by: killerbot on April 21, 2006, 09:14:57 am
it's weird that compiler/linker/loader/ ??? is mixing them up.
As said, no need to change the plug-in, I adjusted the name of the structure in the projectfileoptionsdlg.cpp :

LanguageDef --> SLanguageDef  (S from struct).


How about the following ideas :
 - plug-ins : use pimpl idiom
 - put the plug-in implementation in a seperate namespace

Now it was some kind of obvious because of the copy, but it might well be possible that a type might be created in the sdk and a plug-in (or in several plug-ins).

Should we make a guideline out of this : namespaces !!
 - for that matter we could put the CB core/code also in a namespace (lot's of files to adjust though), but it would be better. Maybe it's easier to start out with the plug-ins.

What do you think ?



[edit] : could you give it a try with the original codestats code and rev 2367 ?
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 21, 2006, 03:38:39 pm
it's weird that compiler/linker/loader/ ??? is mixing them up.
As said, no need to change the plug-in, I adjusted the name of the structure in the projectfileoptionsdlg.cpp :

LanguageDef --> SLanguageDef  (S from struct).


How about the following ideas :
 - plug-ins : use pimpl idiom
 - put the plug-in implementation in a seperate namespace

Now it was some kind of obvious because of the copy, but it might well be possible that a type might be created in the sdk and a plug-in (or in several plug-ins).

Should we make a guideline out of this : namespaces !!
 - for that matter we could put the CB core/code also in a namespace (lot's of files to adjust though), but it would be better. Maybe it's easier to start out with the plug-ins.

What do you think ?

I am not an expert with C++ namespaces, but their implementation within C::B would probably require some code re-designing.

[edit] : could you give it a try with the original codestats code and rev 2367 ?

No crashes, but codestats plugin does not work (it does not crash anyway). Still get the warning dialog "The project is empty" (even if it is not).

The only way to make happy both (codestats plugin & Settings-->Editor) was to add wxString name; to the structure in the sdk.... :?

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 21, 2006, 03:45:13 pm
No crashes, but codestats plugin does not work (it does not crash anyway). Still get the warning dialog "The project is empty" (even if it is not).

The only way to make happy both (codestats plugin & Settings-->Editor) was to add wxString name; to the structure in the sdk.... :?


Please don't do that. Give me some more time. I'll get
this fixed.

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 21, 2006, 03:59:50 pm
No crashes, but codestats plugin does not work (it does not crash anyway). Still get the warning dialog "The project is empty" (even if it is not).

The only way to make happy both (codestats plugin & Settings-->Editor) was to add wxString name; to the structure in the sdk.... :?


Please don't do that. Give me some more time. I'll get
this fixed.

I do no want to do that :). I just wanted to say what seems to work for both at this moment. There should be something that prevent the codestats to work. The project files are parsed, but then the warning message appears. This is strange. If the project is empty why parsing the files takes such a lot of time (e.g., C::B cbp)?

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 21, 2006, 06:34:19 pm
There should be something that prevent the codestats to work. The project files are parsed, but then the warning message appears. This is strange. If the project is empty why parsing the files takes such a lot of time (e.g., C::B cbp)?

Actually, it is working. Only very wierdly.

Make sure to clear data between <codestat> and </codestat> out of the
  default.conf (backup defautl.conf first please)
Start CB with codestat enabled.
Open a project.
Invoke Plugins/Code Statistics menu iitem.
     Do *NOT* invoke Settings/Editor
     (It scans and reports for me).
      (You can do this many times)
Now, invoke Setting Editor/Code Stat Settings
Note that all but the "name" fields are blank
Click on OK

Now when you invoke Plugins/CodeStat it reports there is no project
because it has no fields to compare against except "blank". All its settings have been set to blank.

There is a logic err somewhere. Will look at that now...

thanks
pecan

Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 21, 2006, 07:11:18 pm
There should be something that prevent the codestats to work. The project files are parsed, but then the warning message appears. This is strange. If the project is empty why parsing the files takes such a lot of time (e.g., C::B cbp)?

Actually, it is working. Only very wierdly.

Make sure to clear data between <codestat> and </codestat> out of the
  default.conf (backup defautl.conf first please)
Start CB with codestat enabled.
Open a project.
Invoke Plugins/Code Statistics menu iitem.
     Do *NOT* invoke Settings/Editor
     (It scans and reports for me).
      (You can do this many times)
Now, invoke Setting Editor/Code Stat Settings
Note that all but the "name" fields are blank
Click on OK

Now when you invoke Plugins/CodeStat it reports there is no project
because it has no fields to compare against except "blank". All its settings have been set to blank.

There is a logic err somewhere. Will look at that now...

Yes, I can confirm all what you have said. Doing Settings-->Editor makes the codestats plugin stopping to work (until you deleted the data between the codestat element).

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 21, 2006, 09:20:42 pm
Success! Both in windows and in Linux. Whew...!

It seems that there are a lot of evils one can perform under
wxMSW that bites you in the @ss when performed under
wxGTK.

For example, under wxMSW you can allocate a wxStaticText
in code, but define it as  a wxTextCtrl in XRC, then use SetLabel() on it when there is NO SetLabel() routine defined for wxTextCtrl.

This doesn't work under Linux.

And... this sort of thing will often cause a segfault when running under the
debug version of wxWidgets.

Code
void CodeStatConfigDlg::PrintLanguageInfo(int id)
{
    selected_language = id;
wxStaticText* txt_FileTypes = XRCCTRL(*this, "txt_FileTypes", wxStaticText);
wxString ext_string = _T("");
for (unsigned int i=0; i<languages[id].ext.GetCount(); ++i)
{
   ext_string = ext_string + _T(" ") + languages[id].ext[i];
}
txt_FileTypes->SetLabel(ext_string);
wxStaticText* txt_SingleComment = XRCCTRL(*this, "txt_SingleComment", wxStaticText);
txt_SingleComment->SetLabel(languages[id].single_line_comment);
wxStaticText* txt_MultiLineCommentBegin = XRCCTRL(*this, "txt_MultiLineCommentBegin", wxStaticText);
txt_MultiLineCommentBegin->SetLabel(languages[id].multiple_line_comment[0]);
wxStaticText* txt_MultiLineCommentEnd = XRCCTRL(*this, "txt_MultiLineCommentEnd", wxStaticText);
txt_MultiLineCommentEnd->SetLabel(languages[id].multiple_line_comment[1]);
}


All the above wxStaticText's are defined in the CodeStat XRC as wxTextCtrl's
So I've changed the code accordingly.

Please find attached the source for the fixed CodeStat.

thanks
pecan


[attachment deleted by admin]
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 21, 2006, 09:36:07 pm
Success! Both in windows and in Linux. Whew...!

It seems that there are a lot of evils one can perform under
wxMSW that bites you in the @ss when performed under
wxGTK.

For example, under wxMSW you can allocate a wxStaticText
in code, but define it as  a wxTextCtrl in XRC, then use SetLabel() on it when there is NO SetLabel() routine defined for wxTextCtrl.

This doesn't work under Linux.

And... this sort of thing will often case a segfault when running under the
debug version of wxWidgets.

Code
void CodeStatConfigDlg::PrintLanguageInfo(int id)
{
    selected_language = id;
wxStaticText* txt_FileTypes = XRCCTRL(*this, "txt_FileTypes", wxStaticText);
wxString ext_string = _T("");
for (unsigned int i=0; i<languages[id].ext.GetCount(); ++i)
{
   ext_string = ext_string + _T(" ") + languages[id].ext[i];
}
txt_FileTypes->SetLabel(ext_string);
wxStaticText* txt_SingleComment = XRCCTRL(*this, "txt_SingleComment", wxStaticText);
txt_SingleComment->SetLabel(languages[id].single_line_comment);
wxStaticText* txt_MultiLineCommentBegin = XRCCTRL(*this, "txt_MultiLineCommentBegin", wxStaticText);
txt_MultiLineCommentBegin->SetLabel(languages[id].multiple_line_comment[0]);
wxStaticText* txt_MultiLineCommentEnd = XRCCTRL(*this, "txt_MultiLineCommentEnd", wxStaticText);
txt_MultiLineCommentEnd->SetLabel(languages[id].multiple_line_comment[1]);
}


All the above wxStaticText's are defined in the CodeStat XRC as wxTextCtrl's
So I've changed the code accordingly.

Please find attached the source for the fixed CodeStat.

Thank you very much. That was great work :).

Would it possible to add it to the SVN sources?

May be the problem with Settings-->Environment is similar as the Settings-->Editor one.

Now I have just to understand why the deb package generation does not work :).

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 21, 2006, 09:47:41 pm
Would it possible to add it to the SVN sources?

um.. who is responsible for CodeStat? If no one is,
I'll ask Yiannis for permission to update it, but I don't
want to step on anyones toes.

thanks
pecan
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 21, 2006, 09:55:15 pm
Would it possible to add it to the SVN sources?

um.. who is responsible for CodeStat? If no one is,
I'll ask Yiannis for permission to update it, but I don't
want to step on anyones toes.

I understand. I am not sure too, but I think Zlika.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Zlika on April 21, 2006, 10:14:48 pm
Thank you very much for your help.
I have commited the "wxTextCtrl's changes", but not the CSLanguageDef because killerbot changed its LanguageDef to SLanguageDef, so it should be ok now on this point.

But someone have made a change because when compiling I have:
codestat.cpp: In member function `virtual cbConfigurationPanel* CodeStat::GetConfigurationPanel(wxWindow*)':
codestat.cpp:80: error: cannot allocate an object of type `CodeStatConfigDlg'
codestat.cpp:80: error:   because the following virtual functions are abstract:
sdk/configurationpanel.h:19: error:  virtual wxString cbConfigurationPanel::GetTitle()
sdk/configurationpanel.h:21: error:  virtual wxString cbConfigurationPanel::GetBitmapBaseName()

Doctor C++, could you cure this too? :-)
Title: Re: C::B crash (Settings-->Editor)
Post by: Michael on April 21, 2006, 11:05:55 pm
I have commited the "wxTextCtrl's changes", but not the CSLanguageDef because killerbot changed its LanguageDef to SLanguageDef, so it should be ok now on this point.

Thank you very much :).

Yes, I think so too. The CSLanguageDef should be not necessary now.

Best wishes,
Michael
Title: Re: C::B crash (Settings-->Editor)
Post by: Pecan on April 21, 2006, 11:19:32 pm
But someone have made a change because when compiling I have:
codestat.cpp: In member function `virtual cbConfigurationPanel* CodeStat::GetConfigurationPanel(wxWindow*)':
codestat.cpp:80: error: cannot allocate an object of type `CodeStatConfigDlg'
codestat.cpp:80: error:   because the following virtual functions are abstract:
sdk/configurationpanel.h:19: error:  virtual wxString cbConfigurationPanel::GetTitle()
sdk/configurationpanel.h:21: error:  virtual wxString cbConfigurationPanel::GetBitmapBaseName()

Doctor C++, could you cure this too? :-)

Yes.. I had that problem too. It seems the plugin interface
changed recently.

But if you'll just use the .zip I uploaded with the latest SVN,
(changing the CSLanguage back to Language), I think it'll
work fine with the latest SVN.

thanks
pecan


EDIT: the .zip I uploaded compiles fine with SVN 2366 on
both windows XP and Ubuntu 510

Someone added some const's to the declaration headers, making
the current definitions incompatible. But if you'll modify
the current (from SVN 2366) versions, all will compile.
 
Title: Re: C::B crash (Settings-->Editor)
Post by: killerbot on April 21, 2006, 11:39:43 pm
yes, some methods became const, but all plug-ins in svn have been updated.
So apply your changes on the latest in svn and all should be fine.
Title: Re: C::B crash (Settings-->Editor)
Post by: Der Meister on May 12, 2006, 09:48:26 pm
Anyway, I still had the problem that the textcontrols in the config-dialog were empty. I found out that the problem was the function that was used to set the value for the textcontrol. The function that was used was SetLabel. But this function is not even mentioned as member of wxTextCtrl. I don't know from which parent-class this member-function was inherited (I would gess wxWindow) but it was probably not intended to set the value for the textcontrol. After changing SetLabel to SetValue (that is the correct function, according to the documentation of wxTextCtrl) everything works fine. The values are displayed and the codestats plugin doesn't complain about an empty project any more.
Here is the patch for this:
Code
Index: src/plugins/contrib/codestat/codestatconfig.cpp
===================================================================
--- src/plugins/contrib/codestat/codestatconfig.cpp     (revision 2448)
+++ src/plugins/contrib/codestat/codestatconfig.cpp     (working copy)
@@ -50,13 +50,13 @@
 {
     // Clear text fields and combobox
     wxTextCtrl* txt_FileTypes = XRCCTRL(*this, "txt_FileTypes", wxTextCtrl);
-    txt_FileTypes->SetLabel(_T(""));
+    txt_FileTypes->SetValue(_T(""));
     wxTextCtrl* txt_SingleComment = XRCCTRL(*this, "txt_SingleComment", wxTextCtrl);
-    txt_SingleComment->SetLabel(_T(""));
+    txt_SingleComment->SetValue(_T(""));
     wxTextCtrl* txt_MultiLineCommentBegin = XRCCTRL(*this, "txt_MultiLineCommentBegin", wxTextCtrl);
-    txt_MultiLineCommentBegin->SetLabel(_T(""));
+    txt_MultiLineCommentBegin->SetValue(_T(""));
     wxTextCtrl* txt_MultiLineCommentEnd = XRCCTRL(*this, "txt_MultiLineCommentEnd", wxTextCtrl);
-    txt_MultiLineCommentEnd->SetLabel(_T(""));
+    txt_MultiLineCommentEnd->SetValue(_T(""));
     wxComboBox* combo_Names = XRCCTRL(*this, "combo_Names", wxComboBox);
     combo_Names->Clear();
 
@@ -150,13 +150,13 @@
        {
           ext_string = ext_string + _T(" ") + languages[id].ext[i];
        }
-       txt_FileTypes->SetLabel(ext_string);
+       txt_FileTypes->SetValue(ext_string);
        wxTextCtrl* txt_SingleComment = XRCCTRL(*this, "txt_SingleComment", wxTextCtrl);
-       txt_SingleComment->SetLabel(languages[id].single_line_comment);
+       txt_SingleComment->SetValue(languages[id].single_line_comment);
        wxTextCtrl* txt_MultiLineCommentBegin = XRCCTRL(*this, "txt_MultiLineCommentBegin", wxTextCtrl);
-       txt_MultiLineCommentBegin->SetLabel(languages[id].multiple_line_comment[0]);
+       txt_MultiLineCommentBegin->SetValue(languages[id].multiple_line_comment[0]);
        wxTextCtrl* txt_MultiLineCommentEnd = XRCCTRL(*this, "txt_MultiLineCommentEnd", wxTextCtrl);
-       txt_MultiLineCommentEnd->SetLabel(languages[id].multiple_line_comment[1]);
+       txt_MultiLineCommentEnd->SetValue(languages[id].multiple_line_comment[1]);
 }
 
 /** Add configuration for a new language.
Title: Re: C::B crash (Settings-->Editor)
Post by: killerbot on May 12, 2006, 09:56:27 pm
thanks Der Meister : been applied