[LLVMdev] Making LLVM safer in out-of-memory situations

Philip Reames listmail at philipreames.com
Fri Dec 20 09:34:40 PST 2013


Adding Andrew Kaylor to the conversation.

On 12/20/13 5:16 AM, Gasiunas, Vaidas wrote:
>>> To increase stability for us we have already moved the main part of the compilation to a separate process that may crash in case of an error without doing much harm, i.e. does not crash the database.
>> Were there any interesting challenges that arose during this process?
>> This seems to be an approach many folks are either taking or
>> considering.  If there are things we could do to make this easier, it
>> might be worth considering.
> After porting our project to LLVM3.1, we realized that we can use
> the MCJIT architecture to move compilation into a separate process,
> because it enables loading ELF objects  generated in another process.
> In fact, it worked as expected. It was really an important improvement
> for our use scenario.
>
> Maybe what was not so nice is that we had to patch RuntimeDyld to
> adapt it to our requirements. We had to extend it with a method for
> computing the total size of memory required for loading all sections
> required for execution, so that we can allocate one memory block for
> all sections, and another method to retrieve the address ranges of all
> loaded functions so that we have a mapping from addresses to function
> names.
Andy - Do either of these sound like things for which you'd welcome 
patches?  They're not directly useful for me, but since you're the code 
owner for MCJIT I figured it wouldn't hurt to ask.

Philip




More information about the llvm-dev mailing list