Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568048 - www-client/chromium should add -fno-delete-null-pointer-checks flag
Summary: www-client/chromium should add -fno-delete-null-pointer-checks flag
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-12 08:24 UTC by octoploid
Modified: 2016-01-22 09:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description octoploid 2015-12-12 08:24:07 UTC
The Chromium source contains several instances of calls via a NULL pointer.
This is of course invalid C++, but the real issue is that gcc happily
optimizes away code, because it can assume that "this" can never be NULL.
The result of this optimization are potential crashes.

See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68853 for an example
And: https://bugs.chromium.org/p/v8/issues/detail?id=3782 

To fix this issue -fno-delete-null-pointer-checks should be added to the
CXXFLAGS. Gcc then retains these checks, instead of optimizing them away.

Reproducible: Always
Comment 1 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2016-01-05 19:45:59 UTC
Is there an actual specific crash caused by this?

I tend to stay as close to upstream as possible, and users are free to add any flags to their CXXFLAGS.
Comment 2 octoploid 2016-01-05 19:55:24 UTC
Yes, see the gcc bug link. If you compile Chromium with upcoming gcc-6 it will crash almost immediately at startup.

But every other compiler also have the right to optimize the NULL pointer checks away, because undefined behavior is invoked.

Upstream doesn't seem to care about gcc, but most Gentoo users will use gcc, so -fno-delete-null-pointer-checks will avoid needless browser crashes...
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2016-01-05 22:17:42 UTC
If there's an actual crash with gcc-6, could you file an upstream bug and reference it here?
Comment 4 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2016-01-22 09:12:40 UTC
Feel free to reopen after providing info requested above.