New issue
Advanced search Search tips
Starred by 9 users
Status: Available
Owner: ----
HW: ----
NextAction: ----
OS: ----
Priority: 2
Type: Bug

Blocking:
issue 3770



Sign in to add a comment
V8 is not -fsanitize=null clean
Reported by svenpanne@chromium.org, Dec 19 2014 Back to list
V8 uses the bad idea (a.k.a. "technique") of pretending that JavaScript entities are C++ pointers all over the place, see objects.h and friends. Combined with our Smi encoding, we actually call via a "null" pointer quite a lot. Fundamentally this is fixable by making the functions static and explicitly passing the entity as parameter, but that's a  tremendous amount of work.

Nevertheless, this is highly dangerous: We already had at least one bug caused by the fact that the C++ compiler optimized away some code on the assumption that "this" is never null. There could be even more assumptions made by the compiler, e.g. alignment (= values of the lower bits), so we are on very thin ice here and should remove this madness in the long run.
 
Blocking: v8:3770
Comment 2 by habl...@google.com, Apr 29 2015
Status: Assigned
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68853 for another example.
Is anyone looking at this? Compilers are getting more aggressive with assuming that "this" can not be a null pointer.
Owner: ----
Status: Available
Nobody is currently working on this, and it's not on the short-term agenda either.
It's starting to affect Node.js with gcc 6.0.0.
Comment 8 by ofrobots@google.com, Aug 29 2016
Another issue from Node.js: https://github.com/nodejs/node/issues/8310
Project Member Comment 9 by bugdroid1@chromium.org, Sep 8 2016
Project Member Comment 10 by bugdroid1@chromium.org, Sep 8 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/20d427a1e22776762e1382dd4c01dc0a896a13b4

commit 20d427a1e22776762e1382dd4c01dc0a896a13b4
Author: ofrobots <ofrobots@google.com>
Date: Thu Sep 08 15:55:43 2016

Revert of Use -fno-delete-null-pointer-checks with gcc builds (patchset #2 id:20001 of https://codereview.chromium.org/2310513002/ )

Reason for revert:
Fails on MIPS: https://build.chromium.org/p/client.v8.ports/builders/V8%20Mips%20-%20builder/builds/3653

Original issue's description:
> Use -fno-delete-null-pointer-checks with gcc builds
>
> R=bmeurer@chromium.org, jochen@chromium.org, machenbach@chromium.org
> BUG=v8:3782
>
> Committed: https://crrev.com/dbefc8ee2e9ee6e41b83f3d09c788c34bc923b43
> Cr-Commit-Position: refs/heads/master@{#39286}

TBR=jochen@chromium.org,bmeurer@chromium.org,machenbach@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3782

Review-Url: https://codereview.chromium.org/2328563002
Cr-Commit-Position: refs/heads/master@{#39287}

[modify] https://crrev.com/20d427a1e22776762e1382dd4c01dc0a896a13b4/BUILD.gn
[modify] https://crrev.com/20d427a1e22776762e1382dd4c01dc0a896a13b4/gypfiles/toolchain.gypi

Comment 11 Deleted
Labels: Priority-2
Sign in to add a comment