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">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 class="h5">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>