We are doing a research around LLVM libraries and we have found that the IR library sometimes reaches call stacks up to 29 method calls.
Sometimes when I see some crashes in iOS frameworks I also observe quite deep call stacks.
My question is whether we can reason about if there might be something wrong with a design of a code that calls itself at so big level of depth.
Here is an example:
/usr/local/LLVM/llvm/unittests/IR/AttributesTest.cpp:54
/usr/local/LLVM/llvm/lib/IR/LLVMContext.cpp:162
/usr/local/LLVM/llvm/lib/IR/LLVMContext.cpp:162
/usr/local/LLVM/llvm/lib/IR/LLVMContextImpl.cpp:54
/usr/local/LLVM/llvm/lib/IR/LLVMContextImpl.cpp:59
/usr/local/LLVM/llvm/lib/IR/Module.cpp:60
/usr/local/LLVM/llvm/lib/IR/Module.cpp:62
/usr/local/LLVM/llvm/lib/IR/Module.cpp:456
/usr/local/LLVM/llvm/lib/IR/Function.cpp:350
/usr/local/LLVM/llvm/lib/IR/BasicBlock.cpp:98
/usr/local/LLVM/llvm/include/llvm/ADT/ilist.h:282
/usr/local/LLVM/llvm/include/llvm/ADT/ilist.h:267
/usr/local/LLVM/llvm/lib/IR/SymbolTableListTraitsImpl.h:76
/usr/local/LLVM/llvm/lib/IR/BasicBlock.cpp:90
/usr/local/LLVM/llvm/lib/IR/SymbolTableListTraitsImpl.h:58
/usr/local/LLVM/llvm/lib/IR/ValueSymbolTable.cpp:75
/usr/local/LLVM/llvm/lib/IR/ValueSymbolTable.cpp:47
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:132
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:112
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:122
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:96
/usr/local/LLVM/llvm/include/llvm/IR/Value.h:777
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:132
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:122
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:75
/usr/local/LLVM/llvm/include/llvm/IR/Value.h:771
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:132
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:122
/usr/local/LLVM/llvm/include/llvm/Support/Casting.h:75
/usr/local/LLVM/llvm/include/llvm/IR/Value.h:759
P.S. The example call stack is actually produced by a destructor of an LLVMContext class: LLVMContext::~LLVMContext()
. This is another example from a very old post from Java world: Java call stack – from HTTP upto JDBC as a picture.