From: "Nuno Gonçalves" <nunojpg@gmail.com>
To: musl@lists.openwall.com
Subject: process doesn't terminate when closing streams from another thread
Date: Sun, 6 Sep 2015 15:44:45 +0100 [thread overview]
Message-ID: <CAEXMXLRpDPB0WosO+75+VjcDtud2i1cZB9510L8MOwf7ML0cBg@mail.gmail.com> (raw)
I'm having problems when closing streams from another thread.
The following code:
static void *func(void *arg)
{
fclose(stdout);
fprintf(stderr,"Thread about to exit\n");
return 0;
}
int main(int argc, char **argv)
{
int thread_id;
pthread_create(&thread_id,NULL,&func,NULL);
pthread_join(thread_id,NULL);
fprintf(stderr,"Process about to terminate\n");
return 0;
}
Prints:
root@OpenWrt:/tmp# ./myapp_withmusl
Thread about to exit
Process about to terminate
But never returns! I have to send it a SIGINT.
This happens on target-mips_34kc_musl-1.1.11.
Thanks,
Nuno
next reply other threads:[~2015-09-06 14:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-06 14:44 Nuno Gonçalves [this message]
2015-09-06 17:00 ` Szabolcs Nagy
2015-09-07 4:50 ` Rich Felker
2015-09-09 4:47 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEXMXLRpDPB0WosO+75+VjcDtud2i1cZB9510L8MOwf7ML0cBg@mail.gmail.com \
--to=nunojpg@gmail.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).