unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: agrambot@gmail.com, emacs-devel@gnu.org
Subject: Re: Errors building from master with a clean repository
Date: Mon, 22 Apr 2019 10:45:23 +0300	[thread overview]
Message-ID: <83a7gi8ovg.fsf@gnu.org> (raw)
In-Reply-To: <58b59f1d-94ee-cffc-f711-b4fdcdb0b471@cs.ucla.edu> (message from Paul Eggert on Sun, 21 Apr 2019 23:22:19 -0700)

> Cc: agrambot@gmail.com, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 21 Apr 2019 23:22:19 -0700
> 
> > Can we please at least mention
> > specific compiler options and any other tools that could be used
> > instead of the built-in facilities we are removing?  Bonus points for
> > adding to etc/DEBUG a section with more details about the compiler
> > options, tools, and techniques of using them for debugging specific
> > Emacs problems for which these configure options were introduced.
> 
> OK, I tried to earn bonus points by installing the attached patch into master, 
> on top of the two other patches I mentioned earlier.

Thanks, I have a few comments:

> -Modern versions of GCC support more elaborate debug info that is
> -available by just using the -g3 compiler switch.  Try using -gdwarf-4
> -in addition to -g3, and if that fails, try -gdwarf-3.  This is
> -especially important if you have to debug optimized code.  More info
> -about this is available below; search for "analyze failed assertions".
> +Older versions of GCC may need more than just the -g3 flag.  For more,
> +search for "analyze failed assertions" below.

You have consistently removed the references to -gdwarf-N compiler
option, presumably on the assumption that GCC nowadays automatically
uses the highest supported version?  But that doesn't seem to be the
case here, at least with GCC 7.3.0 on MS-Windows: using -g3 produces
DWARF2 info Version 4, but I can use -gdwarf-5 to produce Version 5.
So I wonder whether the assumption about -g3 is valid.

> -** Running Emacs built with malloc debugging packages
> +** Running Emacs with undefined-behavior sanitization
>  
> -If Emacs exhibits bugs that seem to be related to use of memory
> -allocated off the heap, it might be useful to link Emacs with a
> -special debugging library, such as Electric Fence (a.k.a. efence) or
> -GNU Checker, which helps find such problems.
> +Building Emacs with undefined-behavior sanitization can help debug
> +integer overflow and other undefined behavior in C code.  To use
> +UndefinedBehaviorSanitizer with GCC and similar compilers, append
> +'-fsanitize=undefined' to CFLAGS, either when running 'configure' or
> +running 'make'.  For example:

I think this section could greatly benefit from a short explanation
what "undefined behavior" means, or a couple of examples of it.



  reply	other threads:[~2019-04-22  7:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 19:21 Errors building from master with a clean repository Alex Gramiak
2019-04-20  1:05 ` Paul Eggert
2019-04-20  6:48   ` Eli Zaretskii
2019-04-22  6:22     ` Paul Eggert
2019-04-22  7:45       ` Eli Zaretskii [this message]
2019-04-23  0:31         ` Paul Eggert
2019-04-23  6:05           ` Eli Zaretskii
2019-04-20 16:10   ` Alex Gramiak

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83a7gi8ovg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=agrambot@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).