From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44320: [PATH] [27.1] Make sure send-string-to-terminal send all contents Date: Fri, 30 Oct 2020 15:25:37 +0200 Message-ID: <83v9eralri.fsf@gnu.org> References: <5f9b49e9.1c69fb81.72b0f.80d6@mx.google.com> <83ft5wb0jz.fsf@gnu.org> <87mu03j3cv.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12996"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44320@debbugs.gnu.org, lin.sun@zoom.us To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 30 14:27:41 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYURR-0003Ey-Ci for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 14:27:41 +0100 Original-Received: from localhost ([::1]:54100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYURQ-0005cX-BS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 09:27:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYUQs-0005by-4x for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 09:27:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45095) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYUQo-0006cD-CM for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 09:27:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYUQo-0007ls-88 for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2020 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Oct 2020 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44320 X-GNU-PR-Package: emacs Original-Received: via spool by 44320-submit@debbugs.gnu.org id=B44320.160406436229784 (code B ref 44320); Fri, 30 Oct 2020 13:27:02 +0000 Original-Received: (at 44320) by debbugs.gnu.org; 30 Oct 2020 13:26:02 +0000 Original-Received: from localhost ([127.0.0.1]:56637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYUPq-0007kK-9U for submit@debbugs.gnu.org; Fri, 30 Oct 2020 09:26:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYUPp-0007jx-08 for 44320@debbugs.gnu.org; Fri, 30 Oct 2020 09:26:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44093) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYUPj-0006G9-H4; Fri, 30 Oct 2020 09:25:55 -0400 Original-Received: from [176.228.60.248] (port=1741 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kYUPi-0000fb-UR; Fri, 30 Oct 2020 09:25:55 -0400 In-Reply-To: <87mu03j3cv.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 30 Oct 2020 13:38:24 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192091 Archived-At: > From: Lars Ingebrigtsen > Cc: Lin Sun , 44320@debbugs.gnu.org > Date: Fri, 30 Oct 2020 13:38:24 +0100 > > Eli Zaretskii writes: > > >> I got a bug that `send-string-to-termina` maybe send part of contents to > >> terminal, calling `fwrite` in loop to make sure all contents are written. > > > > Any idea why does it not write the entire string in the single call, > > or how to reproduce this? What is the size of the string in the case > > where it fails to write everything? > > fwrite isn't guaranteed to write the entire string in one go, is it? So > I'm surprised that this doesn't lead to more problems, but I guess it > doesn't show up more in practice because one usually sends less than one > block at a time to the terminal? I understand the basics, I'd just would like to know the details in this case. fwrite could be interrupted by something, or it could write only part of the buffer, or something else. This is very old code, so it is surprising this only comes up now. I'd rather we understood the issue completely before we decide how to fix it.