Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9911)

Issue 309750043: Issue 4814: grob.cc segfaults with gcc6 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 9 months ago by dak
Modified:
2 years, 4 months ago
Reviewers:
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Issue 4814: grob.cc segfaults with gcc6 From the release notes of GCC 6: Optimizations remove null pointer checks for this When optimizing, GCC now assumes the this pointer can never be null, which is guaranteed by the language rules. Invalid programs which assume it is OK to invoke a member function through a null pointer (possibly relying on checks like this != NULL) may crash or otherwise fail at run time if null pointer checks are optimized away. With the -Wnull-dereference option the compiler tries to warn when it detects such invalid code. If the program cannot be fixed to remove the undefined behavior then the option -fno-delete-null-pointer-checks can be used to disable this optimization. That option also disables other optimizations involving pointers, not only those involving this. As a consequence, we cannot call a member function on a prospective null pointer (which actually is a bad idea for a number of other reasons, like when anything tries accessing the vtable) and then try sorting out the condition in the routine itself. This problem was first observed with Fedora 24. The Ubuntu GCC6 prerelease does not show this problem; presumably the respective optimization has been disabled in the Ubuntu/Debian packaging because of affecting other programs. Commit-message-by: David Kastrup <dak@gnu.org> Signed-off-by: David Kastrup <dak@gnu.org>

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -2 lines) Patch
M lily/grob.cc View 2 chunks +3 lines, -2 lines 0 comments Download

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b