The systems where I use libunwind have relatively small stacks. Parts
of libunwind put PATH_MAX on the stack, sometimes more than once. This
can lead to stack overflow, at which point my applications die without
*ANY* indication of why they died.
I'm using the patch below. It converts the big stack allocations I've
found into mallocs. It remedies the problems I've been seeing, at least
for me.
Please do not introduce mallocs in libunwind. It makes libunwind unusable as a heap profiler.
Does mempool_alloc() work for you?
-Arun