Hi hacker,
I met a problem when i dlopen libLLVM.so for use, but our memory is limited, so we met an abort at
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f10bde19859 in __GI_abort () at abort.c:79
#2 0x00007f109c24cc33 in llvm::report_bad_alloc_error(char const*, bool) () from /lib/x86_64-linux-gnu/libLLVM-10.so.1
#3 0x00007f109c23dc32 in ?? () from /lib/x86_64-linux-gnu/libLLVM-10.so.1
#4 0x00007f109c23dd6c in ?? () from /lib/x86_64-linux-gnu/libLLVM-10.so.1
#5 0x00007f109c2312db in llvm::cl::Option::addArgument() () from /lib/x86_64-linux-gnu/libLLVM-10.so.1
#6 0x00007f109c18c08e in ?? () from /lib/x86_64-linux-gnu/libLLVM-10.so.1
...
#N dlopen stack.
Platform : Ubuntu 20.04. x86_64 Linux 5.15.0-52-generic
I want to ask help for :
- If there is a better way to use the
BadAllocErrorHandler
to prevent abort and let the
user to decide how to deal with OOM when we load the library? - What does
addArgument
do after finish mmap the llvmlib?