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: Mon, 02 Nov 2020 17:31:56 +0200 Message-ID: <83eelbepw3.fsf@gnu.org> References: <5f9b49e9.1c69fb81.72b0f.80d6@mx.google.com> <83ft5wb0jz.fsf@gnu.org> <87mu03j3cv.fsf@gnus.org>, <83v9eralri.fsf@gnu.org>, <0EA6FC59-A66D-45B8-8B09-62D6A9032FBC@hxcore.ol> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10696"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, sunlin7@yahoo.com, 44320@debbugs.gnu.org To: LinSun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 02 16:35:04 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 1kZbrM-0002fL-DP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Nov 2020 16:35:04 +0100 Original-Received: from localhost ([::1]:36094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZbrL-0002fF-Et for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Nov 2020 10:35:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZbpO-0001EZ-Q1 for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2020 10:33:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZbpO-0000u3-GI for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2020 10:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZbpO-00033S-E2 for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2020 10:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2020 15:33: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.160433114211682 (code B ref 44320); Mon, 02 Nov 2020 15:33:02 +0000 Original-Received: (at 44320) by debbugs.gnu.org; 2 Nov 2020 15:32:22 +0000 Original-Received: from localhost ([127.0.0.1]:42175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZbok-00032L-1S for submit@debbugs.gnu.org; Mon, 02 Nov 2020 10:32:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZboi-000327-3A for 44320@debbugs.gnu.org; Mon, 02 Nov 2020 10:32:20 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48297) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZbob-0000nR-Fc; Mon, 02 Nov 2020 10:32:13 -0500 Original-Received: from [176.228.60.248] (port=4878 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZboV-00019W-IM; Mon, 02 Nov 2020 10:32:09 -0500 In-Reply-To: <0EA6FC59-A66D-45B8-8B09-62D6A9032FBC@hxcore.ol> (message from LinSun on Mon, 2 Nov 2020 11:11:22 +0800) 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:192527 Archived-At: > Date: Mon, 2 Nov 2020 11:11:22 +0800 > From: LinSun > 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?