From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8469 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: process doesn't terminate when closing streams from another thread Date: Wed, 9 Sep 2015 00:47:33 -0400 Message-ID: <20150909044733.GA17773@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1441774074 19072 80.91.229.3 (9 Sep 2015 04:47:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2015 04:47:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8481-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 09 06:47:54 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZZXIU-0008J5-Du for gllmg-musl@m.gmane.org; Wed, 09 Sep 2015 06:47:50 +0200 Original-Received: (qmail 19967 invoked by uid 550); 9 Sep 2015 04:47:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19949 invoked from network); 9 Sep 2015 04:47:47 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8469 Archived-At: On Sun, Sep 06, 2015 at 03:44:45PM +0100, Nuno Gonçalves wrote: > 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, Thanks for the report. This should now be fixed (in git master). Let me know if you still have problems. Rich