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#47596: File descriptor error when exiting emacs on android 11 Date: Mon, 05 Apr 2021 15:57:45 +0300 Message-ID: <835z10dh2u.fsf@gnu.org> References: <83im51deye.fsf@gnu.org> <730dad3a54f0f53b22e9603879e949b60f5b2c00.camel@grimler.se> <191e2295b88384adf0e7cc1e3dc84cf8f37eb973.camel@grimler.se> <576632572a00e4ec75b92344cd6cd8957df42820.camel@grimler.se> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29334"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47596@debbugs.gnu.org To: Henrik Grimler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 05 14:58:12 2021 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 1lTOnz-0007Tn-Az for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 14:58:11 +0200 Original-Received: from localhost ([::1]:48992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTOny-0002VD-3l for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 08:58:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTOnq-0002Uo-Qw for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 08:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTOnq-000591-JK for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 08:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTOnq-0003S3-Hl for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 08:58: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: Mon, 05 Apr 2021 12:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47596 X-GNU-PR-Package: emacs Original-Received: via spool by 47596-submit@debbugs.gnu.org id=B47596.161762747713255 (code B ref 47596); Mon, 05 Apr 2021 12:58:02 +0000 Original-Received: (at 47596) by debbugs.gnu.org; 5 Apr 2021 12:57:57 +0000 Original-Received: from localhost ([127.0.0.1]:37271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTOnl-0003Rj-Bw for submit@debbugs.gnu.org; Mon, 05 Apr 2021 08:57:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTOnk-0003RX-3x for 47596@debbugs.gnu.org; Mon, 05 Apr 2021 08:57:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57829) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTOne-00050l-RT; Mon, 05 Apr 2021 08:57:50 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4866 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lTOnd-00070T-FP; Mon, 05 Apr 2021 08:57:50 -0400 In-Reply-To: (message from Henrik Grimler on Mon, 05 Apr 2021 11:48:50 +0200) 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:203591 Archived-At: > From: Henrik Grimler > Cc: 47596@debbugs.gnu.org > Date: Mon, 05 Apr 2021 11:48:50 +0200 > > A better way to fix the error is to use buferr instead of stderr when > calling `close_streams` in `close_output_streams`. I cannot see any > obvious problems with this, so I propose this patch: You are operating on the wrong stream, so I do see a problem with this patch. The purpose of this fragment is to close stderr, not the buffered copy of stderr. > --- ./src/sysdep.c.orig 2021-04-05 09:06:33.847835653 +0000 > +++ ./src/sysdep.c 2021-04-05 09:05:47.957856162 +0000 > @@ -2837,8 +2837,8 @@ > sanitizer might report to stderr after this function is invoked. > */ > bool err = buferr && (fflush (buferr) != 0 || ferror (buferr)); > if (err | (ADDRESS_SANITIZER > - ? fflush (stderr) != 0 || ferror (stderr) > - : close_stream (stderr) != 0)) > + ? fflush (buferr) != 0 || ferror (buferr) > + : close_stream (buferr) != 0)) > _exit (EXIT_FAILURE); > } > ^L > ``` > > With it I can start and exit emacs on android without the fdsan error. Is ADDRESS_SANITIZER defined in your build? In any case, I do want to wait for the Android developers to respond to the issue in their tracker. Thanks.