<div>The best way to reliably isolate software errors without leaking memory is to give the code it's own address space which you can cleanly throw away afterwards. In other words, fork a child process.</div><div><br>
</div><div>---</div><div><br></div><div>I'm just being cheeky, I agree it would be nice if there were better error recovery mechanisms. The current philosophy is that once you shake out the bugs in your frontend so you always generate valid IR, LLVM *shouldn't* generate fatal errors. A fatal error is just as unexpected as a crash, and trying to recover from either is just as dicey as the other.</div>
<div><br>Reid</div><div><br></div>On Fri, Oct 28, 2011 at 2:00 AM, Gregory Junker <span dir="ltr"><<a href="mailto:gjunker@dayark.com">gjunker@dayark.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am looking through the source and Support/ErrorHandling.cpp/.h says, in so<br>
many words, "don't throw exceptions from inside an installed fatal error<br>
handling routine".<br>
<br>
So how are people handling errors during JIT? For command-line compilers,<br>
calling exit() or abort() isn't as big a deal -- the compiler is probably<br>
going to exit anyway. But say, for instance, the host application is Firefox<br>
-- my guess is that just letting exit() handle the situation isn't the<br>
solution.<br>
<br>
So what is the "proper" way to handle exceptional LLVM conditions ("cannot<br>
select", for instance)? Yes, I know this is something that needs to be<br>
brought to the programmer's attention, but having the user's application<br>
crash out on them isn't the way I expect most actual LLVM-JIT-based<br>
applications are handling these things...<br>
<br>
Thanks<br>
Greg<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br>