all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Carranza <nicarran@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 44111@debbugs.gnu.org, nicarran@yandex.com
Subject: bug#44111: 27.1; segmentation fault starting emacsclient with -n option
Date: Wed, 21 Oct 2020 16:25:27 -0500	[thread overview]
Message-ID: <CAEgwkPdX0hE8uQL2dT9UpzcP=KEapOokreJeM1y02pN_zTqgDQ@mail.gmail.com> (raw)
In-Reply-To: <83mu0fmw22.fsf@gnu.org>

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

I tested branch emacs-27 including your patch
<http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-27&id=e29cace60afdab04ff20c4f4043a3ee64ec9d01d>
and the bug is gone, excellent, :-)
I will continue using this version and report new problems if there are
any.
Thank you!

On Wed, Oct 21, 2020 at 10:35 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Nicolas Carranza <nicarran@gmail.com>
> > Date: Wed, 21 Oct 2020 00:07:49 -0500
> > Cc: nicarran@yandex.com
> >
> > I can reproduce an emacs segmentation fault following this steps on my
> > system:
> >
> > 1. Start emacs as daemon using:
> > emacs --daemon=myEmacs
> >
> > 2. Start emacsclient using:
> > emacsclient -s myEmacs -n -c test.org
> >
> > 3. emacs crashes:
>
> Thanks.
>
> Can you try the patch below?  I've just installed it on the emacs-27
> branch.
>
> diff --git a/src/xdisp.c b/src/xdisp.c
> index 6c401d0..03dc4be 100644
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -22793,6 +22793,10 @@ maybe_produce_line_number (struct it *it)
>    int lnum_face_id = merge_faces (it->w, Qline_number, 0,
> DEFAULT_FACE_ID);
>    int current_lnum_face_id
>      = merge_faces (it->w, Qline_number_current_line, 0, DEFAULT_FACE_ID);
> +  /* From here onwards, we must prevent freeing realized faces, because
> +     we are using the above 2 face IDs for the glyphs we produce.  */
> +  bool save_free_realized_faces = inhibit_free_realized_faces;
> +  inhibit_free_realized_faces = true;
>    /* Compute point's line number if needed.  */
>    if ((EQ (Vdisplay_line_numbers, Qrelative)
>         || EQ (Vdisplay_line_numbers, Qvisual)
> @@ -22922,10 +22926,13 @@ maybe_produce_line_number (struct it *it)
>           it->lnum_width = 0;
>           it->lnum_pixel_width = 0;
>           bidi_unshelve_cache (itdata, false);
> +         inhibit_free_realized_faces = save_free_realized_faces;
>           return;
>         }
>      }
>
> +  inhibit_free_realized_faces = save_free_realized_faces;
> +
>    /* Record the width in pixels we need for the line number display.  */
>    it->lnum_pixel_width = tem_it.current_x;
>    /* Copy the produced glyphs into IT's glyph_row.  */
>

[-- Attachment #2: Type: text/html, Size: 2967 bytes --]

  reply	other threads:[~2020-10-21 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  5:07 bug#44111: 27.1; segmentation fault starting emacsclient with -n option Nicolas Carranza
2020-10-21 15:35 ` Eli Zaretskii
2020-10-21 21:25   ` Nicolas Carranza [this message]
2020-10-22  2:37     ` Eli Zaretskii

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='CAEgwkPdX0hE8uQL2dT9UpzcP=KEapOokreJeM1y02pN_zTqgDQ@mail.gmail.com' \
    --to=nicarran@gmail.com \
    --cc=44111@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=nicarran@yandex.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.