unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Kai Ma <justksqsf@gmail.com>
Cc: 59794@debbugs.gnu.org, eliz@gnu.org
Subject: bug#59794: 29.0.60; NSport segfaults when a fullscreen frame is being closed
Date: Sat, 3 Dec 2022 14:53:53 +0100	[thread overview]
Message-ID: <99841eb7-fda0-517a-2454-79b8c5e29991@gmail.com> (raw)
In-Reply-To: <7ADCCFFC-F171-4D65-BE7F-AEB60648FBE7@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

On 03.12.22 14:03, Kai Ma wrote:
> 
> 
>> On Dec 3, 2022, at 19:44, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
>>
>> FWIW, no crash here with dd7a7633bebc4db5caca3898bf318721f1f370c8 (master), macOS 13.0.1, ASAN enabled.
> 
> Weird.  I tested this commit with the default configure options and it segfaulted.  How to enable ASAN?

I forgot to mentions that I have an M1 here, maybe it's that.

For simplicity, I attach a crude shell script that I use for building 
Emacs.  Please search for "sanitize" in the script.  You'll have to add 
something to CFLAGS and LDFLAGS.  I'm using Xcode 14.1 for building.

[-- Attachment #2: make-emacs --]
[-- Type: text/plain, Size: 2941 bytes --]

#! /usr/bin/env zsh
#set -x

# Build Emacs from scratch.

# Display usage information and exit.
function usage () {
    cat <<EOF
Usage $0 [options]

Build Emacs starting from a clean Git repository.  When run without
addtional command-line flags, build with native compilation.

--asan		build with address sanitizer and -O1 (this takes 3x the
		time of a build without)
--bootstrap	make bootstrap
--checking	configure with --emanle-checking
--configure	run configure only
--debug		configure with -g -O0
--elc		build without native compilation
--help		show this help
--no-cache      delete config cache

Add 'compdef _gnu_generic make-emacs' to your ~/.zshrc for options
completion on the command line.
EOF
    exit 1
}

# Parse command line options. 
zmodload zsh/zutil
if ! zparseopts -E -D -F -- \
     -asan=asan \
     -bootstrap=bootstrap \
     -checking=checking \
     -configure=conf \
     -debug=debug \
     -elc=elc \
     -help=help \
     -no-cache=no_cache \
	|| [ "$help" != "" ]
then
    usage
fi

# Go to the root of the current worktree.
while ! test -f configure.ac; do
    if [ "$(pwd)" = "/" ]; then
	echo "Not in worktree"
	exit 
    fi
    cd ..
done

# The file to use as config.cache
worktree="$(basename $(pwd))"
config_cache=~"/tmp/config.cache.$worktree"

# Delete the config cache file if --no-config is specified.
if [ "$no_cache" != "" ]; then
    rm -f $config_cache
fi

# Flags and options to pass to configure.
config_flags=(--cache-file $config_cache)

# Configure with --enable-checking
if [ "$checking" != "" ]; then
    config_flags+=(--enable-checking)
fi

# Build with native compiler unless --elc is specified.
if [ "$elc" = "" ]; then
    config_flags+=(--with-native-compilation)
fi

config_flags+=(--disable-silent-rules)
#config_flags+=(--with-tree-sitter)

# Define CFLAGS and LDFLAGS for address sanitizer if --asan is
# specified.
if [ "$asan" != "" ]; then
    config_flags+=(LDFLAGS="-fsanitize=address -fno-omit-frame-pointer"
		   CFLAGS="-g -O0 -fsanitize=address -fno-omit-frame-pointer")
elif [ "$debug" != "" ]; then
    config_flags+=(CFLAGS="-g -O0")
fi

# Clean Git repo, configure and make install.  Also, build a
# compilation database while we're at it.
function build_emacs_from_scratch () {
    git clean -qxdf \
	&& ./autogen.sh \
	&& ./configure $config_flags[@] \
	&& bear -- gmake --output-sync=line \
	&& emacs-fixup-compile-commands.py \
	&& gmake install
}

function bootstrap_emacs () {
    ./configure $config_flags[@] \
	&& bear -- make bootstrap \
}

# Note that the zsh built-in 'time' is not able to time shell
# functions directly, it just prints nothing.  We have to use a
# sub-shell instead.
TIMEFMT=$'\nreal\t%*E\nuser\t%*U\nsys\t%*S'

if [ "$conf" != "" ]; then
    time ./configure $config_flags[@]
elif [ "$bootstrap" != "" ]; then
    time (bootstrap_emacs)
else
    time (build_emacs_from_scratch)
fi

echo "$0 $config_flags[@] complete."
    
# End.

  reply	other threads:[~2022-12-03 13:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 12:01 bug#59794: 29.0.60; NSport segfaults when a fullscreen frame is being closed Kai Ma
2022-12-03 10:08 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-03 10:27 ` Eli Zaretskii
2022-12-03 11:44   ` Gerd Möllmann
2022-12-03 13:03     ` Kai Ma
2022-12-03 13:53       ` Gerd Möllmann [this message]
2022-12-03 20:51         ` Kai Ma
     [not found] ` <handler.59794.B.167005568724588.ack@debbugs.gnu.org>
2022-12-03 10:48   ` bug#59794: Acknowledgement (29.0.60; NSport segfaults when a fullscreen frame is being closed) Kai Ma
2022-12-04  6:54     ` bug#59794: 29.0.60; " Eli Zaretskii
2022-12-04  9:10       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 10:24         ` Eli Zaretskii
2022-12-04 11:59           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 12:21             ` Eli Zaretskii
2022-12-04 12:23               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 12:45               ` Kai Ma
2022-12-04 12:53                 ` Eli Zaretskii
2022-12-04 13:53                 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 14:04                   ` Kai Ma
2022-12-05  1:10                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-10 20:35 ` Steven E. Harris
2023-01-11  1:14   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-11  4:38     ` Gerd Möllmann
2023-01-17 21:37       ` Steven E. Harris
2023-01-18  5:06         ` Gerd Möllmann

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=99841eb7-fda0-517a-2454-79b8c5e29991@gmail.com \
    --to=gerd.moellmann@gmail.com \
    --cc=59794@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=justksqsf@gmail.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.
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).