GNU bug report logs - #47596
File descriptor error when exiting emacs on android 11

Previous Next

Package: emacs;

Reported by: Henrik Grimler <henrik <at> grimler.se>

Date: Sun, 4 Apr 2021 19:21:02 UTC

Severity: normal

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 47596 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Henrik Grimler <henrik <at> grimler.se>
Cc: 47596 <at> debbugs.gnu.org
Subject: Re: bug#47596: File descriptor error when exiting emacs on android 11
Date: Mon, 05 Apr 2021 15:57:45 +0300
> From: Henrik Grimler <henrik <at> grimler.se>
> Cc: 47596 <at> 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.




This bug report was last modified 2 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.