Message: previous - next
Month: May 2012

Re: [trinity-devel] No WILD GEESE gcc 4.7 => kwrite/kate crash, gcc 4.6 current code == All Good!

From: Nix <nix@...>
Date: Thu, 03 May 2012 23:55:20 +0100
On 3 May 2012, David C. Rankin stated:

>   After much (wasted) effort, I have come to the definite conclusion that the
> crash seen in kwrite/kate/quanta/konqueror(filemanagement katepart) is 100% due
> to gcc 4.7.
>   I just finished a rebuild of current code on gcc 4.6 and kwrite works
> perfectly/wraps without problem, etc... See:

This is evidence, but not proof. It could perfectly well be that GCC is
optimizing more heavily than before and that the optimizer is buggy, but
it may also be that GCC is optimizing more heavily than before and is
breaking code that is invoking undefined behaviour that nobody noticed
before now because it didn't break anything. C and C++ are tricksy that
way. :)

>   I have no clue what to do next. It is probably premature for a bug against gcc
> 'wrong code' until somebody can confirm that katerenderer.cpp doesn't violate
> coding standards.

Quite so.

>   What to do next?

Localizing the fault, I'd say. Since GCC 4.6 and 4.7 share the same C++
ABI (unless explicitly instructed otherwise, and if not compiling for
C++11), you can binary-search for the faulty file by picking a random
half of the files (or directories) and compiling *only them* with GCC
4.7, and compiling the other half with GCC 4.6. If it doesn't crash,
flip the halves: otherwise, halve that half and compile one half with
4.6 and one half with 4.7, and iterate until you have only one file
left. With only one file left you have a reasonable amount of code to
start dissecting by hand for further info.

This is, I know, really really really boring. But it should work. :)

NULL && (void)