From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: LLVM testsuite, close-stderr.ll hangs
Date: Mon, 17 Dec 2012 12:22:27 -0500 [thread overview]
Message-ID: <20121217172227.GU20323@brightrain.aerifal.cx> (raw)
In-Reply-To: <20121217165829.GT20323@brightrain.aerifal.cx>
On Mon, Dec 17, 2012 at 11:58:29AM -0500, Rich Felker wrote:
> On Mon, Dec 17, 2012 at 03:03:39PM +0400, ojab wrote:
> > On glibc this command exits with code 1, on musl it hangs. strace
> > output can be found in the attached files.
> > [...]
> > 28321 write(2, "LLVM ERROR: IO failure on output stream.\n", 41) = -1 EBADF (Bad file number)
> > 28321 pause(
>
> The only way pause() is called from exit() is when the exit lock is
> already held. There are 3 basic ways this could happen:
>
> 1. Memory corruption that overwrote the lock variable.
> 2. Another thread holding the lock indefinitely (e.g. deadlock an an
> atexit handler).
> 3. Recursive call to exit (i.e. calling exit from an atexit handler or
> a signal handler.
>
> Since I don't see any threads in the strace, I'm ruling out #2. #1 is
> definitely an option, but I suspect what's going on is #3, in which
> case it's an llvm bug. Calling exit more than once is undefined
> behavior; in particular, atexit handlers or global destructors cannot
> call exit.
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.
Rich
next prev parent reply other threads:[~2012-12-17 17:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 11:03 ojab
2012-12-17 16:58 ` Rich Felker
2012-12-17 17:22 ` Rich Felker [this message]
2012-12-18 5:55 ` ojab
2012-12-18 6:14 ` Rich Felker
2012-12-18 6:37 ` ojab
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=20121217172227.GU20323@brightrain.aerifal.cx \
--to=dalias@aerifal.cx \
--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).