From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Henrik Grimler Newsgroups: gmane.emacs.bugs Subject: bug#47596: File descriptor error when exiting emacs on android 11 Date: Mon, 05 Apr 2021 11:48:50 +0200 Message-ID: References: <83im51deye.fsf@gnu.org> <730dad3a54f0f53b22e9603879e949b60f5b2c00.camel@grimler.se> <191e2295b88384adf0e7cc1e3dc84cf8f37eb973.camel@grimler.se> <576632572a00e4ec75b92344cd6cd8957df42820.camel@grimler.se> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11884"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.38.4 Cc: 47596@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 05 11:49:16 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 1lTLr7-0002uU-Jo for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 11:49:13 +0200 Original-Received: from localhost ([::1]:47076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTLr6-0000mc-Kd for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 05:49:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTLqw-0000kg-TA for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 05:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTLqw-00025o-M4 for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 05:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTLqw-0004RT-L4 for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 05:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Henrik Grimler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Apr 2021 09:49: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.161761613717048 (code B ref 47596); Mon, 05 Apr 2021 09:49:02 +0000 Original-Received: (at 47596) by debbugs.gnu.org; 5 Apr 2021 09:48:57 +0000 Original-Received: from localhost ([127.0.0.1]:36962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTLqr-0004Qu-7c for submit@debbugs.gnu.org; Mon, 05 Apr 2021 05:48:57 -0400 Original-Received: from h01mx15.reliablemail.org ([173.236.5.211]:13393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTLqo-0004Ql-PF for 47596@debbugs.gnu.org; Mon, 05 Apr 2021 05:48:56 -0400 X-Halon-Out: 20938dc8-95f4-11eb-a316-00163c81f1a9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=grimler.se; s=default; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1sJHJzOYAkicYUVcAj5F7bqAGyptyvgKybtxzim8evs=; b=UlC+oBRqBXrFg6sMYPOZH1FD0q MeXn9ZOmdWWj3JFlHPyQERo/k/6V4vyBPJttOwT3aP49NTQ/BiRvKLsQ+pkqZivV5HNwxs4eTgFhn Zp1eJ4zdalrG+lkg9uX9lBlveW24GcTtLY/fv/tsldNg7CwiyD/hjkRmth4T3RlASHVr/SHVu4kHM oD4Hcmf036SiBsm1G0O3SMByJkMsyGi9WlmX5mGIVzHuQ+jd08FBefXJv8BFdbOCTzzIARRSoL763 9RJ/V6I+MSz4sTZp1p00S0sWCwDYjm663pj5h7k+oT3HGIZgz8A8ZJVTWy2KgJXcYx9LRzrHk3AyA TId2Uuzg==; In-Reply-To: <576632572a00e4ec75b92344cd6cd8957df42820.camel@grimler.se> X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpsrv07.misshosting.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - grimler.se X-Get-Message-Sender-Via: cpsrv07.misshosting.com: authenticated_id: henrik@grimler.se X-Authenticated-Sender: cpsrv07.misshosting.com: henrik@grimler.se 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:203584 Archived-At: Hi, 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: ``` --- ./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. Best regards, Henrik Grimler