On a related note is there anything one can do to make the JIT exit gracefully?<br>(except feeding it with IR which doesn't crash it).<br><br><div class="gmail_quote">2010/7/19 Frank Fuchs <span dir="ltr"><<a href="mailto:fk.fuchs@googlemail.com">fk.fuchs@googlemail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Is there a way to intercept the calls to abort() or exit(), specifically ? Disabling all external symbol resolution seems not really feasable since I need some std libs.<br>
<br>-Frank <br><br><div class="gmail_quote">
2010/7/19 Garrison Venn <span dir="ltr"><<a href="mailto:gvenn.cfe.dev@gmail.com" target="_blank">gvenn.cfe.dev@gmail.com</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div style="word-wrap: break-word;">You could use shared memory or the equivalent of UNIX domain sockets. On a UNIX system, you will also probably want to catch <div>SIGCHLD along with implementing "nowait" handling behavior in the parent. This is of course a low level approach. Higher level </div>


<div>libraries that you may be using, or other OSs may provide their own wrappers.</div><div><br></div><div>Garrison</div><div><br></div><div><div><div><div></div><div><div>On Jul 19, 2010, at 4:05, Frank Fuchs wrote:</div>


<br></div></div><blockquote type="cite"><div><div></div><div>Ok, thank you for your explanation. Is it possible for forked processes to share data? Especially for the child process to send some data to the parent?<br>
<br>-Frank<br><br><div class="gmail_quote">2010/7/18 Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div>Frank Fuchs wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I'm doing some tests concerning the embedding of LLVM and clan in my application.<br>
Now I stumbled across the following ... which disturbs me. If the jitted program crashes,<br>
like e.g. if it contains an assert(0==1) or calls an external function which cannot be resolved,<br>
the hosting app goes down as well. There seems no error catch.<br>
<br>
Can this anyhow be circumvented?<br>
</blockquote>
<br></div></div>
Fork?<br>
<br>
LLVM JIT is not a secure VM like Java. Programs running under the JIT are free to make any memory operation or function call that the enclosing program could, even _exit(). You can try to restrict function calls by removing the name resolution:<br>




<br>
<br>
<a href="http://llvm.org/doxygen/classllvm_1_1ExecutionEngine.html#af062585affb7cd16bab9867b706ea460" target="_blank">http://llvm.org/doxygen/classllvm_1_1ExecutionEngine.html#af062585affb7cd16bab9867b706ea460</a><br>
<br>
and/or installing your own (see InstallLazyFunctionCreator), but ultimately they're the same process/task from the point of view of the operating system and there's no "llvm security model" or anything like that.<br>




<br>
If you're very determined, you could create an LLVM IR transformation pass which checks every load/store/call and verifies that it's safe, and if it's not verifiable at compile time makes it call back into your program at runtime to do the check and proceed only if it is.<br>




<br>
Or if you don't need it to be in the same process, don't put it there and let the OS handle the rest.<br><font color="#888888">
<br>
Nick<br>
</font></blockquote></div><br></div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">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></div></div></blockquote></div></div></div><br>
</blockquote></div><br>