Well, I think it's because drmingw gives me a report whether the crashing program is under a debugging session or not. Anyway gdb spit the backtrace below:
#0 0000000062711545 wxBaseArrayPtrVoid::Index(void const*, bool) const() (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#1 0000000062847448 wxCheckListBoxItem::Check(bool) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#2 0000000070A87898 nsEnvVars::EnvvarArrayApply(envvar=3 count of wxArrayString = {...}, lstEnvVars=0x1664cfa0) (D:\coding\projects\sw\codeblocks\trunk\src\plugins\contrib\envvars\envvars_common.cpp:479)
#3 0000000070A82E1F EnvVarsConfigDlg::LoadSettings(this=0x165d1a90) (D:\coding\projects\sw\codeblocks\trunk\src\plugins\contrib\envvars\envvars_cfgdlg.cpp:167)
#4 0000000070A82836 EnvVarsConfigDlg::EnvVarsConfigDlg(this=0x165d1a90, parent=0x164ca250) (D:\coding\projects\sw\codeblocks\trunk\src\plugins\contrib\envvars\envvars_cfgdlg.cpp:68)
#5 0000000070A82448 EnvVars::GetConfigurationPanel(this=0x7311d10, parent=0x164ca250) (D:\coding\projects\sw\codeblocks\trunk\src\plugins\contrib\envvars\envvars.cpp:286)
#6 000000000151E0E2 PluginManager::GetConfigurationPanels(this=0x6ed0160, group=-4, parent=0x164ca250, arrayToFill=...) (D:\coding\projects\sw\codeblocks\trunk\src\sdk\pluginmanager.cpp:1290)
#7 0000000000438671 EnvironmentSettingsDlg::AddPluginPanels(this=0x22e690) (D:\coding\projects\sw\codeblocks\trunk\src\src\environmentsettingsdlg.cpp:330)
#8 0000000000437B35 EnvironmentSettingsDlg::EnvironmentSettingsDlg(this=0x22e690, parent=0x61cbe10, art=0x61e0c00) (D:\coding\projects\sw\codeblocks\trunk\src\src\environmentsettingsdlg.cpp:308)
#9 0000000000462EA2 MainFrame::OnSettingsEnvironment(this=0x61cbe10, event=...) (D:\coding\projects\sw\codeblocks\trunk\src\src\main.cpp:4620)
#10 0000000062786541 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#11 0000000062786603 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#12 00000000627869B7 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#13 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#14 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#15 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#16 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#17 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#18 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#19 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#20 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#21 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#22 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#23 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#24 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#25 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#26 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#27 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#28 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
#29 0000000062786948 wxEvtHandler::ProcessEvent(wxEvent&) () (D:\coding\projects\sw\codeblocks\trunk\src\devel_64\wxmsw28u_gcc_custom.dll:??)
Can a C++ expert explain how sel can hold the result of new EnvVariableListClientData(key, value)?
Edit: Or does the sequence operator "," do something different in C++ than I think it does?
Tim S.
int sel = -1;
if (lstEnvVars)
{
sel = lstEnvVars->Append(key + _T(" = ") + value, new EnvVariableListClientData(key, value));
lstEnvVars->Check(sel, bCheck);
}
The crash stopped when I fixed the seq. operations.
Edit: But, I think the second line does nothing useful; but, maybe in the C++ world it does something.
diff --git a/src/plugins/contrib/envvars/envvars_cfgdlg.cpp b/src/plugins/contrib/envvars/envvars_cfgdlg.cpp
index 200e930..c47a3a6 100644
--- a/src/plugins/contrib/envvars/envvars_cfgdlg.cpp
+++ b/src/plugins/contrib/envvars/envvars_cfgdlg.cpp
@@ -450,7 +450,8 @@ void EnvVarsConfigDlg::OnAddEnvVarClick(wxCommandEvent& WXUNUSED(event))
if (nsEnvVars::EnvvarVetoUI(key, NULL, -1))
return;
- int sel = lstEnvVars->Append(key + _T(" = ") + value, new nsEnvVars::EnvVariableListClientData(key, value));
+ int sel = lstEnvVars->Append(key + _T(" = ") + value);
+ new nsEnvVars::EnvVariableListClientData(key, value);
bool success = nsEnvVars::EnvvarApply(key, value);
if (sel>=0)
lstEnvVars->Check(sel, success);
diff --git a/src/plugins/contrib/envvars/envvars_common.cpp b/src/plugins/contrib/envvars/envvars_common.cpp
index fa4ded0..d1de5f4 100644
--- a/src/plugins/contrib/envvars/envvars_common.cpp
+++ b/src/plugins/contrib/envvars/envvars_common.cpp
@@ -475,7 +475,8 @@ bool nsEnvVars::EnvvarArrayApply(const wxArrayString& envvar,
int sel = -1;
if (lstEnvVars)
{
- sel = lstEnvVars->Append(key + _T(" = ") + value, new EnvVariableListClientData(key, value));
+ sel = lstEnvVars->Append(key + _T(" = ") + value);
+ new EnvVariableListClientData(key, value);
lstEnvVars->Check(sel, bCheck);
}
Tim S.
Can a C++ expert explain how sel can hold the result of new EnvVariableListClientData(key, value)?
Edit: Or does the sequence operator "," do something different in C++ than I think it does?
I'm not a C++ expert but 'sel' has nothing to with 'new EnvVariableListClientData(key, value)':
int sel = lstEnvVars->Append(key + _T(" = ") + value, new nsEnvVars::EnvVariableListClientData(key, value));
invokes the overloaded 'Append' function with 2 arguments, there is no sequencing here. Sorry if I misunderstood you and you were talking about something else.
CB crashes at line 479 in 'envvars_common.cpp', I don't think 'Append' is the problematic part.
Can someone extract his/her env settings from default.conf and share them?
<envvars>
<sets>
<default>
<ENVVAR0>
<str>
<![CDATA[1|LC_ALL|en_US.utf8]]>
</str>
</ENVVAR0>
</default>
<wx28>
<ENVVAR0>
<str>
<![CDATA[1|wxcfg|gcc_dll\mswu]]>
</str>
</ENVVAR0>
<ENVVAR1>
<str>
<![CDATA[1|wxwin|C:\wxMSW\wxMSW-2.8\wxMSW-2.8.12]]>
</str>
</ENVVAR1>
</wx28>
<wx30>
<ENVVAR0>
<str>
<![CDATA[1|wxcfg|gcc_dll\mswu]]>
</str>
</ENVVAR0>
<ENVVAR1>
<str>
<![CDATA[1|wxwin|C:\wxMSW\wxMSW-3.0\wxWidgets-3.0.2]]>
</str>
</ENVVAR1>
</wx30>
</sets>
<ACTIVE_SET>
<str>
<![CDATA[wx30]]>
</str>
</ACTIVE_SET>
<DEBUG_LOG bool="1" />
</envvars>
Tim S.
Windows CB 10311 edited to enable debug mode with wxWidgets 2.8.12 debug.
---------------------------
wxWidgets Debug Alert
---------------------------
../../src/msw/listbox.cpp(441): assert "wxAssertFailure" failed in DoSetItemClientData(): Can't use client data with owner-drawn listboxes
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
---------------------------
Yes No Cancel
---------------------------
---------------------------
wxWidgets Debug Alert
---------------------------
../../src/msw/listbox.cpp(441): assert "wxAssertFailure" failed in DoSetItemClientData(): Can't use client data with owner-drawn listboxes
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
---------------------------
Yes No Cancel
---------------------------