From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2497 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: LLVM testsuite, close-stderr.ll hangs Date: Tue, 18 Dec 2012 01:14:01 -0500 Message-ID: <20121218061401.GV20323@brightrain.aerifal.cx> References: <50CEFC0B.70307@ojab.ru> <20121217165829.GT20323@brightrain.aerifal.cx> <20121217172227.GU20323@brightrain.aerifal.cx> <50D0056A.4090303@ojab.ru> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1355811254 24094 80.91.229.3 (18 Dec 2012 06:14:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Dec 2012 06:14:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2498-gllmg-musl=m.gmane.org@lists.openwall.com Tue Dec 18 07:14:29 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TkqRg-0008OQ-CY for gllmg-musl@plane.gmane.org; Tue, 18 Dec 2012 07:14:28 +0100 Original-Received: (qmail 32589 invoked by uid 550); 18 Dec 2012 06:14:15 -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 32581 invoked from network); 18 Dec 2012 06:14:14 -0000 Content-Disposition: inline In-Reply-To: <50D0056A.4090303@ojab.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2497 Archived-At: On Tue, Dec 18, 2012 at 09:55:54AM +0400, ojab wrote: > On 17.12.2012 21:22, Rich Felker wrote: > >On Mon, Dec 17, 2012 at 11:58:29AM -0500, Rich Felker wrote: > >To track this down, you could run under gdb and just interrupt the > >program and look at a backtrace once it hangs. This should make it > >clear whether exit was called recursively. > > Looks something like that (gdb output in the attached file, `bt` > while `opt` hangs in the bottom): I've set `break exit` and stepped > till it hangs, first exit() happens in command line parsing (https://github.com/llvm-mirror/llvm/blob/master/lib/Support/CommandLine.cpp#L846), > which calls report_fatal_error("IO failure on output stream.");, > which calls exit itself. > > Looks like (note that I'm barely know C/C++) something wrong in > ostream destruction: after changing ifdef to ifndef @ > https://github.com/llvm-mirror/llvm/blob/master/lib/Support/raw_ostream.cpp#L501 > all works as it should: I suspect there may be similar problems in more places than just this. It definitely calls for a bug report. Calling exit from global dtors is invalid (invokes undefined behavior). Rich