Not sure this is actually a bug, but here goes. Codeblocks hangs when compiling. Around 3 days ago I downloaded and built svn 12306 on a Linux Mint / XFCE system, which is completely up to date.
When Codeblocks is started with --debug-log, and a project is loaded (into the tree), an endless cycle of errors appears and the program hangs. Here's one ...
Call stack: [01] wxColour::Red() const [02] CCTree::CalculateCrc32(CCTreeItem*, Crc32&) const [03] CCTree::GetCrc32() const [04] ClassBrowserBuilderThread::FillGUITree(bool) [05] ClassBrowserBuilderThread::BuildTree() [06] ClassBrowserBuilderThread::Entry() [07] wxThread::CallEntry() [08] 0x7f358d2956c8 [09] 0x7f358bd186db [10] clone ../src/gtk/colour.cpp(197): assert ""IsOk()"" failed in Green(): invalid colour [in thread 7f357bf52700]
Unsurprisingly, they appear in cycles of three. Needless the say, the compilation problem is a red herring.
Apologies if this is not a bug.
Can this be reproduced on a simple project? Can you share your Help -> About -> Information?
Sorry. Didn't really understand your first question. The behaviour is persistent and renders CB unusable. About info follows ...
Forgot to mention I'm on Linux Mint 19.3 Tricia. Just upgraded, and I think CB started misbehaving at that time too.
I'm asking if this problem can be reproduced with a simple sample/hello world project. Can it? Or does it require some specific project?
Does it happen if you disable the symbol browser in the settings?
Have you used the same version in the old OS? What was the old OS?
OK, I can reproduce this with a simple project.
Probably this is related to [#1031]
@Miguel Gimenez do you have any idea what is going on?
Related
Tickets:
#1031The color used for a tree item is invalid, I will look where this colour comes from and also make CalculateCrc32() inmune to an invalid colour,
The colour isn't used at all, I can ditch it completely or initialize it with wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT)
Not that I know very much about the codebase here, but surely the latter would be safer. More future-proof??? Many thanks to both of you for your time and effort BTW.
Ditch it. Remove as much code as possible. :)
There's always that. This is my first time here, so may I ask how long it might take for the changes to result in a new svn?
It will be fixed when it is fixed. We're non-profit/non-fulltime, so we cannot provide any guarantees/ETAs or similar.
If you don't use the symbol browser you could temporarily disable it.
Sorry to appear impatient. I'm not. I've already tried disabling the symbols browser, but it has no effect.
You see the colour asserts even if the symbol browser is disabled? Or CB hangs without the asserts?
I see the colour asserts even if the symbol browser is disabled. I imagine CB hangs because of those asserts.
Again I am not familiar with the code base, but when I looked last night, it seemed to me that the colour is being used to build a tree. Surely there's more than one tree in the manager pane.
Are you using packages? Can you attach a debugger and post a backtrace from all threads (thread apply all bt in gdb)?
Packages? Sorry, don't understand. I built the program from source. Attach a debugger? Er, maybe. I'll look into it.
You can build packages even if you're building from source.
gdb /usb/bin/codeblocks and then run the apply command when it hangs (probably you'll need to press ctrl-c)
It can't be ditched, looks like "Find references" does not work when the symbol is used in the include file, i.e. this code inside class' definition is not found:
void SetItemTextColour(CCTreeItem* item, const wxColour& col) {if (item) item->m_colour = col;}
This patch initializes m_colour properly and checks for validity before accessing it.
@Stephen Wilson Can you try the patch and tell us if the hang is gone?
Working on it ...
That seems to have done the trick. Many thanks.