<?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&)" 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&)" offset="0000002d" file="src/main.cpp" line="2951"/>
<frame level="19" function="wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const" offset="00000031"/>
<frame level="20" function="wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)" offset="0000007d"/>
<frame level="21" function="wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)" offset="00000074"/>
<frame level="22" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="000000bd"/>
<frame level="23" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="24" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="25" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="26" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="27" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="28" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="29" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="30" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="31" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="32" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="33" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="34" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="35" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="36" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="37" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="38" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="39" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="40" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="41" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="42" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="43" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="44" function="wxEvtHandler::ProcessEvent(wxEvent&)" offset="00000063"/>
<frame level="45" function="wxEvtHandler::ProcessEvent(wxEvent&)" 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&, wchar_t**)" offset="0000005c"/>
<frame level="75" function="wxEntry(int&, char**)" offset="00000032"/>
<frame level="76" function="main" offset="00000394" file="src/app.cpp" line="89"/>
</stack>
</report>
"/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.
AFAIK, the crash is caused by the codestat plugin.
I haven't investigated why though...
[10:21:32.842]: Add project Client in parsing queue
[10:21:38.808]: Add project Client in parsing queue
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.
Codestat? So why am I having the same problem with no contribs?
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
(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)
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)
QuoteProgram 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.
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)
#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)
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
Codeint 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.
I always svn up, build C::B, ./update and then the contr. plugins...
QuoteI 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...
QuoteI 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.
from Michael....
C::B still crashes when trying Settings-->Editor.
Quotefrom 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.
<codestat>
<NB_LANGUAGES int="7" />
291 ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("codestat"));
292 int nb_languages = cfg->ReadInt(_T("/nb_languages"), 0);
Michael,
would you look in default.conf (or which ever the one you're using)
and show us your <codestat> entry.
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
languages[0].name = _T("C/C++");
The problem seems in language (LoadDefaultSettings at codestatconfig.cpp:224):
CodeStatConfigDlg::CodeStatConfigDlg(wxWindow* parent)
{
wxXmlResource::Get()->LoadPanel(this, parent, _("dlgCodeStatConfig"));
// Load the languages parameters
nb_languages = LoadSettings(languages);
ReInitDialog();
}
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
int LoadSettings(LanguageDef languages[NB_FILETYPES_MAX])
{
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("codestat"));
int nb_languages = cfg->ReadInt(_T("/nb_languages"), 0);
<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>
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.
#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
[...]
"languages[0].name = _T("C/C++");"
"languages[0].name = wxString(_T("C/C++"));"
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.
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.
#0 0xb7a4a349 in wxStringBase::AllocBeforeWrite ()#2 0xb7a4ad34 in wxStringBase::operator= () from /usr/lib/libwx_baseu-2.6.so.0
from /usr/lib/libwx_baseu-2.6.so.0
#1 0xb7a4acb0 in wxStringBase::AssignCopy ()
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
[...]
// 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?
languages[0].name = wxString(_T("C/C++"),14);
Michael,
Would you change statement at line 224 to the following to see
if wxgtk is miscalculating the string length.Codelanguages[0].name = wxString(_T("C/C++"),14);
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).
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;
}
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?
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)
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/)
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?
#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];
};
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.
// 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];
};
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.
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
#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()
{;}
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....
Anyway, it seems that the codestats plugin now return that the project is empty, even if it is not :?.
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,
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 ?
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.... :?
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.
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)?
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...
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]);
}
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.Codevoid 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.
Would it possible to add it to the SVN sources?
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 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? :-)
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.