GNU bug report logs - #29600
Emacs port to gcc -fcheck-pointer-bounds

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Thu, 7 Dec 2017 07:20:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29600 in the body.
You can then email your comments to 29600 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29600; Package emacs. (Thu, 07 Dec 2017 07:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 Dec 2017 07:20:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Emacs bug reports and feature requests <bug-gnu-emacs <at> gnu.org>
Subject: Emacs port to gcc -fcheck-pointer-bounds
Date: Wed, 6 Dec 2017 23:18:35 -0800
[Message part 1 (text/plain, inline)]
Attached is a series of three patches to port Emacs to 'gcc 
-fcheck-pointer-bounds'. This feature enables hardware bounds checking for some 
internal pointers of the Emacs interpreter, and I've used it to find a bug in 
Emacs itself. It's intended primarily for debugging Emacs internals, and is off 
by default. I would like to install these patches soon unless some problems turn 
up, and am submitting this as a bug report in case others who care about Emacs 
low-level internals would like to review the patches.

The first patch changes the basic Emacs internal type from an integer to a 
pointer of the same width. Although this doesn't significantly affect ordinary 
builds it's essential for -fcheck-pointer-type, where the C compiler must be 
told the location of every pointer (including tagged pointers) for the checking 
to work well. (No doubt I'm partial, but I think this patch also cleans up Emacs 
internals a bit even for typical platforms.) The patch should not change the 
behavior of the Emacs interpreter; it's mostly just treating some intptr_t 
values as pointer values instead.

The second patch builds on the first to fix Emacs so that it doesn't crash when 
-fcheck-pointer-bounds is used.

The third patch enables more pointer bounds checking. Not every pointer access 
is checked, just the ones for which -fcheck-pointer-bounds is easy. Although 
this doesn't catch every pointer-bounds error, it does catch some of them. 
Perhaps more checking could be added later.
[0001-Reimplement-Lisp_Object-as-pointer-to-incomplete.patch (text/x-patch, attachment)]
[0002-Port-to-gcc-fcheck-pointer-bounds.patch (text/x-patch, attachment)]
[0003-Narrow-pointer-bounds-when-appropriate.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 07 Dec 2017 07:22:01 GMT) Full text and rfc822 format available.

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 15 Dec 2017 07:27:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Fri, 15 Dec 2017 07:27:02 GMT) Full text and rfc822 format available.

Message #12 received at 29600-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 29600-done <at> debbugs.gnu.org
Subject: Emacs port to gcc -fcheck-pointer-bounds
Date: Thu, 14 Dec 2017 23:26:11 -0800
Closing this bug report, as the basic idea is installed on master now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 12 Jan 2018 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 106 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.