← Back to team overview

kicad-developers team mailing list archive

Pushback on bug 1838448

 

I asked on the Fedora development list about removing the "-Wp,-D_GLIBCXX_ASSERTIONS" flag as requested in https://bugs.launchpad.net/kicad/+bug/1838448, and I got some pushback (attached) stating that it is not a good idea to hide crashes caused by out-of-bounds memory accesses.

I agree with that, and I made a similar argument in comment #22 of the bug.

Therefore I'd like to have more discussion about this.  Are we really sure we want to hide memory access errors?  In some cases they could cause hard-to-find corruption bugs, as well as hard crashes.  Personally, I'd rather know there is a problem.

	Steve
--- Begin Message ---
On 01/08/2019 19:28, Steven A. Falco wrote:
The upstream KiCAD project has requested that I remove GLIBCXX_ASSERTIONS from the Fedora package, as described here: https://bugs.launchpad.net/kicad/+bug/1838448

What is the best way to do that?  I can add "%undefine _hardened_build" (which I am testing now) but I think that will remove other hardening features that I might want to leave enabled.

Well you just need to add -U_GLIBCXX_ASSERTIONS to the end of the
compiler flags.

But I think upstream is giving very bad advice...

That define does not "add extra crashes" in the way that they
seem to think - well I mean it does literally but those crashes
are reports of program errors on their part.

Specifically in this case they appear to be accessing a
std::vector at an index beyond the end, so they are accessing
memory that may not be allocated at all, and if it is does
not belong to the vector in question. So the program is quite
likely to crash there one day anyway, the extra assertion just
makes sure it always does.

Tom

--
Tom Hughes (tom@xxxxxxxxxx)
http://compton.nu/


--- End Message ---

Follow ups