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:52:22 +0300 Message-ID: <837dlgdhbt.fsf@gnu.org> 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: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6446"; 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:53:09 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 1lTOj7-0001ZX-4L for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 14:53:09 +0200 Original-Received: from localhost ([::1]:47988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTOj6-0001dn-1Y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 08:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTOj0-0001df-Kx for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 08:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTOj0-0001xH-Dr for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 08:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTOj0-0003Ks-Cc for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 08:53: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:53: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.161762715512780 (code B ref 47596); Mon, 05 Apr 2021 12:53:02 +0000 Original-Received: (at 47596) by debbugs.gnu.org; 5 Apr 2021 12:52:35 +0000 Original-Received: from localhost ([127.0.0.1]:37264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTOiY-0003K4-N8 for submit@debbugs.gnu.org; Mon, 05 Apr 2021 08:52:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTOiW-0003JZ-NZ for 47596@debbugs.gnu.org; Mon, 05 Apr 2021 08:52:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57793) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTOiR-0001ad-Fr; Mon, 05 Apr 2021 08:52:27 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4518 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lTOiQ-0004V6-UN; Mon, 05 Apr 2021 08:52:27 -0400 In-Reply-To: <576632572a00e4ec75b92344cd6cd8957df42820.camel@grimler.se> (message from Henrik Grimler on Mon, 05 Apr 2021 10:59:55 +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:203590 Archived-At: > From: Henrik Grimler > Cc: 47596@debbugs.gnu.org > Date: Mon, 05 Apr 2021 10:59:55 +0200 > > > #include > > int main() > > { > >   fdopen (2, "w"); > >   fclose (stderr); > > } > > ``` > > Changing to this: > > ``` > > #include > int main() > { > FILE *err = fdopen (2, "w"); > fclose (err); > } > ``` > > makes it work. Which again makes no sense, because the program that works is a no-op: it creates a copy of stderr and immediately closes it. > So I suppose the sanitizer does not like that stderr is > closed with `fclose (stderr)` instead of by using the fd obtained from > fdopen (which was thrown away in my minimal example). > > Still not sure if this is actually problematic, but at least now I > understand how the sanitizer "thinks". If that's what it thinks, it's a clear bug in the sanitizer, IMO.