unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: LinSun <lin.sun@zoom.us>
Cc: larsi@gnus.org, sunlin7@yahoo.com, 44320@debbugs.gnu.org
Subject: bug#44320: [PATH] [27.1] Make sure send-string-to-terminal send all contents
Date: Mon, 02 Nov 2020 17:31:56 +0200	[thread overview]
Message-ID: <83eelbepw3.fsf@gnu.org> (raw)
In-Reply-To: <0EA6FC59-A66D-45B8-8B09-62D6A9032FBC@hxcore.ol> (message from LinSun on Mon, 2 Nov 2020 11:11:22 +0800)

> Date: Mon, 2 Nov 2020 11:11:22 +0800
> From: LinSun <lin.sun@zoom.us>
> Cc: "44320@debbugs.gnu.org" <44320@debbugs.gnu.org>
> 
> Attach the log file ` testing-strace-2.log.gz` with a line more which may be a import hints.
> 
> write(6, "…", 256) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)

Thanks.

I don't think I know how to interpret this trace, or understand the
significance of ERESTARTSYS.  Was this trace collected with or without
your change in send-string-to-terminal? did fwrite succeed to write
the entire string or did it write only part of it, and if the latter,
which part was successfully written?

All I see in the trace is a series of calls to 'write' syscall,
progressively writing a large string in chunks of 4K bytes, which
seems normal.  'fwrite' is documented to return an error indication if
it doesn't succeed to write the entire buffer, but you didn't show the
return value of 'fwrite' nor what 'fflush' after it returned, so it is
hard to know what exactly happened.

I think we must understand what happens here and why, because we call
'fwrite' in 2 dozen other places, and it makes little sense to fix
only one of them.  The function where you propose the change calls
'fwrite' twice, but you suggested to fix only one of these two calls,
which also sounds strange to me.  Moreover, I don't think I see any
documentation saying that 'fwrite' can, let alone should be expected
to, fail to write the entire buffer without returning some error
indication.  On what OS do you see the problem?





  reply	other threads:[~2020-11-02 15:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 23:01 bug#44320: [PATH] [27.1] Make sure send-string-to-terminal send all contents Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-30  0:36 ` Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-10-30  8:06 ` Eli Zaretskii
2020-10-30 12:38   ` Lars Ingebrigtsen
2020-10-30 13:25     ` Eli Zaretskii
2020-11-02  2:58       ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-02  3:11         ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-02 15:31           ` Eli Zaretskii [this message]
2020-11-02 15:49             ` Andreas Schwab
2020-11-02 16:14               ` Eli Zaretskii
2020-11-02 16:41                 ` Andreas Schwab
2020-11-02 17:10                   ` Eli Zaretskii
2020-11-02 17:36                     ` Andreas Schwab
2020-11-02 17:59                       ` Eli Zaretskii
2020-11-02 18:02                         ` Andreas Schwab
2020-11-02 18:12                           ` Eli Zaretskii
2020-11-02 18:22                             ` Andreas Schwab
2020-11-02 18:35                               ` Eli Zaretskii
2020-11-02 18:58                                 ` Andreas Schwab
2020-11-02 19:31                                   ` Eli Zaretskii
2020-11-02 20:26                                     ` Andreas Schwab
     [not found]                                       ` <4BD75783-F561-4DB8-A733-13A3D924C8C1@hxcore.ol>
2020-11-03 15:29                                         ` Eli Zaretskii
2020-11-05  0:14                                           ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-07  9:28                                             ` Eli Zaretskii
2020-11-09  2:27                                               ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-05 15:59                                       ` Eli Zaretskii
2020-11-05 16:07                                         ` Andreas Schwab
2020-11-02 15:22         ` Lars Ingebrigtsen
2020-11-02 16:07           ` Eli Zaretskii
2020-11-02 16:30             ` Lars Ingebrigtsen

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=83eelbepw3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=44320@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=lin.sun@zoom.us \
    --cc=sunlin7@yahoo.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).