GNU bug report logs -
#47596
File descriptor error when exiting emacs on android 11
Previous Next
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 #26 received at 47596 <at> debbugs.gnu.org (full text, mbox):
> From: Henrik Grimler <henrik <at> grimler.se>
> Cc: 47596 <at> debbugs.gnu.org
> Date: Mon, 05 Apr 2021 10:59:55 +0200
>
> > #include <stdio.h>
> > int main()
> > {
> > fdopen (2, "w");
> > fclose (stderr);
> > }
> > ```
>
> Changing to this:
>
> ```
>
> #include <stdio.h>
> 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.
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.