From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6946 invoked from network); 16 Nov 2020 05:04:53 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2020 05:04:53 -0000 Received: (qmail 25800 invoked by uid 550); 16 Nov 2020 05:04:46 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 25770 invoked from network); 16 Nov 2020 05:04:45 -0000 Date: Mon, 16 Nov 2020 00:04:32 -0500 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20201116050432.GW534@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="BjavXC7V3ilNTWHC" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [musl] aio+fork bug test case --BjavXC7V3ilNTWHC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I'm cleaning up my work spaces and found this draft test case for the aio+fork bug fixed in 34904d830a9fd1f6fc47218f38c111698303d2fe. I'm not sure how best to integrate it with libc-test, but posting it here now so it's not lost. Probably should be edited to use pipe() rather than relying on stdin blocking. Rich --BjavXC7V3ilNTWHC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="aio_fork.c" #include #include #include int main() { char buf[256]; int fd = dup(0); struct aiocb cb = { .aio_fildes = fd, .aio_buf = buf, .aio_nbytes = sizeof buf }; aio_read(&cb); pid_t pid = fork(); if (!pid) { close(fd); _exit(0); } waitpid(pid, 0, 0); } --BjavXC7V3ilNTWHC--