unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Richard Stallman <rms@gnu.org>
Cc: 23912@debbugs.gnu.org
Subject: bug#23912: 25.0.95; Abort in gc when working with streams
Date: Mon, 12 Sep 2016 22:18:52 +0200	[thread overview]
Message-ID: <87k2eg27o3.fsf@web.de> (raw)
In-Reply-To: <83k2gcuxjc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jul 2016 19:30:47 +0300")

Hello Richard,

> I pinged RMS.  It's important for me to hear his opinion on this.

Can you please tell us if we should wait for your answer, or if you
just don't remember?  No need to read the complete thread; this was our
question:

  Richard, do you perhaps remember, or can try to second-guess, why do
  we set the abort_on_gc flag inside prin1-to-string?  I mean this
  fragment of print.c:
  
    /* Save and restore this: we are altering a buffer
       but we don't want to deactivate the mark just for that.
       No need for specbind, since errors deactivate the mark.  */
    Lisp_Object save_deactivate_mark = Vdeactivate_mark;
    bool prev_abort_on_gc = abort_on_gc;
    abort_on_gc = true;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  
    Lisp_Object printcharfun = Vprin1_to_string_buffer;
    PRINTPREPARE;
    print (object, printcharfun, NILP (noescape));
    /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINISH */
    PRINTFINISH;
  
    struct buffer *previous = current_buffer;
    set_buffer_internal (XBUFFER (Vprin1_to_string_buffer));
    object = Fbuffer_string ();
    if (SBYTES (object) == SCHARS (object))
      STRING_SET_UNIBYTE (object);
  
    /* Note that this won't make prepare_to_modify_buffer call
       ask-user-about-supersession-threat because this buffer
       does not visit a file.  */
    Ferase_buffer ();
    set_buffer_internal (previous);
  
    Vdeactivate_mark = save_deactivate_mark;
  
    abort_on_gc = prev_abort_on_gc;
  
  Why do we want to prevent GC while working on Vprin1_to_string_buffer?
  It's just a buffer, and AFAICT we just collect the printed stuff
  there.  And yet this code that tries to avoid GC was there since long
  ago, first as GCPRO, and now as this flag.  What bad things could
  happen if we just remove it?

FWIW, I didn't notice bad things after I removed it locally (several
weeks ago).


Many thanks!

Michael.





  reply	other threads:[~2016-09-12 20:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 16:48 bug#23912: 25.0.95; Abort in gc when working with streams Michael Heerdegen
2016-07-07 17:15 ` Eli Zaretskii
2016-07-07 17:38   ` Michael Heerdegen
2016-07-07 17:57     ` Dmitry Antipov
2016-07-07 20:34       ` Michael Heerdegen
2016-07-08  6:14         ` Eli Zaretskii
2016-07-12 21:53           ` Michael Heerdegen
2016-07-13 15:52             ` Michael Heerdegen
2016-07-13 20:19               ` Eli Zaretskii
2016-07-13 21:28                 ` Michael Heerdegen
2016-07-13 20:16             ` Eli Zaretskii
2016-07-13 21:23               ` Michael Heerdegen
2016-07-14 14:58                 ` Eli Zaretskii
2016-07-14 18:32                   ` Michael Heerdegen
2016-07-23 16:16                     ` Michael Heerdegen
2016-07-23 16:30                       ` Eli Zaretskii
2016-09-12 20:18                         ` Michael Heerdegen [this message]
2016-09-13 12:25                           ` Richard Stallman
2016-09-13 14:40                             ` Eli Zaretskii
2016-09-13 15:58                               ` Michael Heerdegen
2016-09-14 17:42                                 ` Eli Zaretskii
2016-07-14 16:15 ` Adrián Medraño Calvo
2016-07-14 18:30   ` Michael Heerdegen
2016-07-14 18:49     ` Eli Zaretskii
2016-07-14 21:54       ` Michael Heerdegen

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=87k2eg27o3.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=23912@debbugs.gnu.org \
    --cc=rms@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).