Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #814956
| From | Florian Weimer <fw@deneb.enyo.de> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.maint.glibc |
| Subject | Bug#858529: libc6: fgets repeats content after fork on stretch only |
| Date | 2017-03-23 15:50 +0100 |
| Message-ID | <tocdP-3va-5@gated-at.bofh.it> (permalink) |
| References | <to2o9-5jo-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Cross-posted to 2 groups.
tags 858529 upstream
forwarded 858529 https://sourceware.org/bugzilla/show_bug.cgi?id=20598
thanks
* Neil Spring:
> if(fork() == 0) { exit(1); }
exit flushes the stdio buffers in the child. Upstream concluded that
this leads to undefined behavior:
| Yes, this is about the exit actually. But reading "2.5.1
| Interaction of File Descriptors and Standard I/O Streams", I think
| this is really undefined, because the required action is not
| performed before the call to fork, and the correct fix is to use
| _exit in the forked child.
<https://sourceware.org/bugzilla/show_bug.cgi?id=20598#c2>
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Find similar | Unroll thread
Bug#858529: libc6: fgets repeats content after fork on stretch only Neil Spring <nspring@cs.umd.edu> - 2017-03-23 05:20 +0100 Bug#858529: libc6: fgets repeats content after fork on stretch only Florian Weimer <fw@deneb.enyo.de> - 2017-03-23 15:50 +0100
csiph-web