Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Crash where I could need some help (RPT)
MortenMacFly:
Dear devs,
rarely C::B crashes for me when I open a (huge) workspace -> usually the C::B workspace with all contrib and other plugins. I've attached a crash report where I demangeled the addresses to lines of code according to my version of C::B (Version 1.0 revision 2580 () gcc 3.4.5 Windows/unicode). I don't get what should go wrong here, espeacially I don't understand why cbproject.cpp:1054 should fail, but this is a bug that I've experienced quite some time now.
Any ideas?
With regards, Morten.
[attachment deleted by admin]
thomas:
Have not observed any such thing, and I couldn't guess why GetCount() would crash, either (don't get me started on wxWidgets, lol).
However, we don't really need to know the count anyway. All we do is count down to zero and check whether it is really zero. This can be implemented more efficiently:
--- Code: ---bool cbProject::SaveAllFiles()
{
bool feelGood = true;
FilesList::Node* node = m_Files.GetFirst();
while(node)
{
ProjectFile* f = node->GetData();
if (!Manager::Get()->GetEditorManager()->Save(f->file.GetFullPath()))
feelGood = false;
node = node->GetNext();
}
return feelGood;
}
--- End code ---
That will 99.9% certain not fix your problem (as the call to GetCount() actually cannot be the cause), but try it nevertheless :)
MortenMacFly:
--- Quote from: thomas on June 20, 2006, 11:35:07 am ---This can be implemented more efficiently: [...]
That will 99.9% certain not fix your problem (as the call to GetCount() actually cannot be the cause), but try it nevertheless :)
--- End quote ---
Thanks!!! I've applied the patch and now I'm going to wait for the next crash... this can take a while becasue as I said: There is no way to reproduce and it occures only rarely.
I hope that when it crashes again the trace will point to another line in the code that actually causes the issue - so it's really worth a try.
BTW: I saw you've committed cbexecute.h. You once provided me with a patch that replaced all wxExecute with (this) cbExecute. Allthough I've still applied this patch it did not change anything. Please remember that this patch was actually for the same issue as within this thread. But anyway... it in fact doesn't harm. ;-)
With regards, Morten.
thomas:
--- Quote ---I saw you've committed cbexecute.h.
--- End quote ---
I was reverting all local modifications in my working copy this morning to get a fresh, pristine copy, and stumbled over that one again. ;)
It seemed a pity to simply throw it away, so I committed it even though the code does not currently use it.
That way, we may change the tool manager and the CC plugin any time later to use it, if we want - or we may as well delete it at a later time :)
Pecan:
--- Code: ---[code]
bool cbProject::SaveAllFiles()
{
int count = m_Files.GetCount();
FilesList::Node* node = m_Files.GetFirst();
while(node)
{
ProjectFile* f = node->GetData();
if (Manager::Get()->GetEditorManager()->Save(f->file.GetFullPath()))
--count;
node = node->GetNext();
}
return count == 0;
}
--- End code ---
My guess: m_Files is not checked to see if it's 0x0. That's usually the cause of crashes in wxWidgets calls like this.
[/code]
Navigation
[0] Message Index
[#] Next page
Go to full version