public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Caroline Tice <cmtice@google.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	libstdc++@gcc.gnu.org, 	Diego Novillo <dnovillo@google.com>,
	Luis Lozano <llozano@google.com>,
		Bhaskar Janakiraman <bjanakiraman@google.com>
Subject: Re: [PATCH, updated] Vtable pointer verification, runtime library changes (patch 3 of 3)
Date: Mon, 25 Feb 2013 21:15:00 -0000	[thread overview]
Message-ID: <CAH6eHdRJKgQUn59iB4VFoHDBV25zqMVMA=Cc3q++75PpmjuV7w@mail.gmail.com> (raw)
In-Reply-To: <CABtf2+Q4v3yRycHfgqN10K6JrX_8mkaREFLTbws=G8OEH=GN+w@mail.gmail.com>

On 25 February 2013 19:52, Caroline Tice wrote:
> I got too excited about being done and forgot to attach the patch. :-(
>  Sorry. Here it is.

Some comments follow, mostly from reading the comments to understand
what this patch does, it's a really interesting feature!

The generated files (configure, */Makefile.in) don't need to be in the
patch and their ChangeLog entry can be simply "Regenerated"

Was configure regenerated of modified by hand? When regenerating it
with Autoconf 2.64 I get a different output.

I also get this warning when regenerating the configury bits:
src/Makefile.am:80: variable `libvtv___la_LIBADD' is defined but no program or
src/Makefile.am:80: library has `libvtv___la' as canonical name (possible typo)

The copyright dates should be updated to 2012-2013.

vtv_add_to_log in libstdc++-v3/libsupc++/vtv_utils.cc uses va_start
but the matching call to va_end is missing.

Am I right in thinking there's no danger of namespace pollution from
vtv_map.h etc. because those headers will never be included unless
explicitly requested by users?

I'm not sure what the rules are regarding flexible array members in
C++ (as it's an extension) but it looks like insert_only_hash_map is a
non-POD (formally, it has non-trivial initialization) but no
constructor or destructor runs for it, so formally the object's
lifetime never begins or ends, it is just a block of memory that gets
allocated, some bytes are set, then the memory is deallocated again.

The comments in libstdc++-v3/libsupc++/vtv_init.cc have a typo:

+/* This file contains all the definitions that go into the libvtv_init
+   library, which is part of the vtable verification feature.  This
+   library should contain exactly two functionsa (__VLTunprotect and
s/functionsa/functions/

And in the comments in libstdc++-v3/libsupc++/vtv_rts.cc

+  The actual set of valid vtable pointers for a virtual class,
Should that be "polymorphic class" instead of "virtual class"?

Further on there are a few typos:

+   pointters for the class, so we wrote our own hashtable-based symbol
s/pointters/pointers/

+   libvtv_init.so is built from vtv_init.cc.  It is designed to hel[p
s/hel\[p/help/


+   __VLTVerifyVtablePoitner) with stub functions that do nothing.  If
s/Poitner/Pointer/

+   initialize any of these statics with a runtime call (for ex:
+   sysconf.
(Unclosed parenthesis)

+   the secttion offset and size, in conjunction with the data in INFO
s/secttion/section/

+      /* TODO: Meed to revisit this code for dlopen. It most probably
+         is not unlocking the protected vtable vars after for a load

s/Meed/Need/
s/after for a load/after a load/

I see a few TODO comments in the code, I assume the plan is to address
them eventually as time permits, rather than this being a code-drop
that becomes abandonware :-)

  reply	other threads:[~2013-02-25 21:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 19:31 Caroline Tice
2013-02-25 19:53 ` Caroline Tice
2013-02-25 21:15   ` Jonathan Wakely [this message]
2013-02-25 22:44     ` Caroline Tice
2013-02-25 22:49       ` Jonathan Wakely
2013-03-07 23:53     ` Caroline Tice
2013-03-08  0:12       ` Jonathan Wakely
2013-03-08  8:13         ` Dave Korn
2013-05-21  2:01         ` Benjamin De Kosnik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH6eHdRJKgQUn59iB4VFoHDBV25zqMVMA=Cc3q++75PpmjuV7w@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=bjanakiraman@google.com \
    --cc=cmtice@google.com \
    --cc=dnovillo@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=llozano@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).