User forums > Using Code::Blocks
C::B crash (Settings-->Editor)
Pecan:
--- Quote from: Pecan on April 16, 2006, 01:42:33 am ---
--- Quote from: Michael on April 16, 2006, 01:24:27 am ---
--- Quote from: 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.
--- End quote ---
Sorry, but where it is located on Linux?
Best wishes,
Michael
--- End quote ---
I believe it's in your home directory under ".codeblocks"
named default.conf
thanks
pecan
--- End quote ---
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);
--- End code ---
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>
--- End code ---
Michael:
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
Zlika:
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.
Michael:
--- Quote from: Zlika on April 17, 2006, 08:13:22 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.
--- End quote ---
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
[...]
--- End quote ---
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
Pecan:
--- Code: ---"languages[0].name = _T("C/C++");"
--- End code ---
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++"));"
--- End code ---
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
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version