User forums > Using Code::Blocks
Kubuntu - C::B 8477 crash on Workspace load
MortenMacFly:
--- Quote from: jens on October 29, 2012, 04:25:11 pm ---Question is: what to do in this case, just step out the function or ... ?
CC devs should look into it I think.
--- End quote ---
For now I would do what's attached (which avoids the crash).
Solution 1: If we don't have a compiler all project path's with macros cannot safely be resolved and are error prone. Also, CC is questionable anyways as we don't have the system headers, for example.
Solution 2: Maybe we could also iterate through the project include dirs and add them only, if they contain no macros in case no compiler is present. Also, if no compiler-related macro is needed (like a simply envvar) it could work, too. This may work nice for projects using the same compiler (GCC) on several platforms.
Solution 3: We just ignore that we cannot resolve the macros correct and use all project path's "as is".
What would be most wise??? Really not that simple. ::)
cacb:
--- Quote from: jens on October 29, 2012, 04:25:11 pm ---Error is simple: nativeparser.cpp:1921
--- Code: --- Compiler* compiler = CompilerFactory::GetCompiler(project->GetCompilerID());
cb::shared_ptr<CompilerCommandGenerator> generator(compiler->GetCommandGenerator(project));
--- End code ---
Missing check for nullptr.
compiler is 0x0, therefore it crashes (obviously).
Question is: what to do in this case, just step out the function or ... ?
CC devs should look into it I think.
--- End quote ---
Thanks for your nice work, that was very fast...
In this case, I guess the nullptr is for MSVC, a compiler that does not exist for the platform in question (here: Linux). I believe it must be allowed to refer to compilers that don't exist for the current platform (or are missing), as long as there are other relevant build targets with valid compilers. On Windows I have the opposite case, no GCC compiler installed, but it does not cause any crash or other problems, and it should not.
Jenna:
--- Quote from: cacb on October 29, 2012, 05:32:16 pm ---On Windows I have the opposite case, no GCC compiler installed, but it does not cause any crash or other problems, and it should not.
--- End quote ---
The difference is most likely that the entry (compilerID) for the gcc compiler exists on windows, but it is (probably) not configured, but on linux no msvc compilerID exists.
MortenMacFly:
I've committed a patch (slightly different to the one posted here) to trunk that should at least fix the crash bug.
MortenMacFly:
--- Quote from: MortenMacFly on October 29, 2012, 10:20:26 pm ---I've committed a patch (slightly different to the one posted here) to trunk that should at least fix the crash bug.
--- End quote ---
Dammed - that one didn't really work due to the shared pointer. Now I am unsure, how to do it.
@obfuscated: Can you have a look at the attached patch, if I can initialise a shared_ptr like that?
At least it compiled and seems to run...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version