[Bug 60929] [r600-llvm] mono games with opengl are blocking on start

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Aug 26 22:22:38 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=60929

--- Comment #18 from Nicholas Miell <nmiell at gmail.com> ---
(In reply to comment #17)
> Thanks for tracking this down.  I think we'll need to extend the LLVM C API
> in order to get access to this variable.  However, looking through the LLVM
> code it looks like the PrettyStackTrace handler is registered by a static
> initializer, so I wonder if setting this variable is enough and if we can
> guarantee that r600g will set this variable before the handler is
> initialized.

I don't think this is true -- IIRC, all the stack traces I saw were the result
of one of the runOnFunction methods (either BBPassManager or FPPassManager, I
wasn't paying attention) creating a PassManagerPrettyStackEntry object.

> Also, this seems to me like it is a bug in LLVM.  Is it common practice for
> libraries to override signal handlers of applications?

Common enough that both Mono and LLVM stomp on each other, but its
unambiguously wrong for a shared library to globally modify signal handlers.
(Temporarily setting a new handler on entry to your library and later restoring
the saved handler before returning is fine, but that only works in the
single-threaded case since handlers aren't per-thread. Arguably modern
applications shouldn't use any signals at all.)

Mono (generally) gets away with it because it uses crazy signals that
applications never touch (SIGPWR is only sent to PID 1 by the kernel on power
failure, SIGXCPU is relic of obsolete job billing infrastructure that nobody
uses), but had the bad luck of LLVM deciding to future-proof itself against all
possible fatal signals.

If I were to be prescriptive, llvm::DisablePrettyStackTrace should be true by
default, should only ever be set by clang, and shouldn't be a global variable.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130827/b765e6a2/attachment-0001.html>


More information about the dri-devel mailing list