uwsgi icon indicating copy to clipboard operation
uwsgi copied to clipboard

backtraces are not printed when running under Alpine Linux

Open jbehrends opened this issue 8 years ago • 4 comments

Alpine: 3.5.2 uWSGI 2.0.14

I'm experiencing a segfault issue with uwsgi running inside of Alpine, and no matter what I do I can't get ANY backtrace to be printed. I've tested this by installing the same uwsgi configuration into unbuntu and forcing a segfault (kill -SIGSEGV ) and I will get a backtrace everytime.

Poking around in the code, I think it's related to this line: https://github.com/unbit/uwsgi/blob/bc536ee62b34fe01f3a8ef2c9e9a502c78d18c06/core/uwsgi.c#L1886

I'm guessing the lack of GLIBC is the root cause. Not knowing a lot about c, would it be possible to update this to support musl libc as well for printing backtraces?

Thx

jbehrends avatar Apr 18 '17 22:04 jbehrends

It looks like musl doesn't provide execinfo.h which is a requirement for that code.

xrmx avatar Apr 19 '17 07:04 xrmx

Doing a little googling it appears that other projects have implemented "libunwind" as an alternative for backtrace functionality when running under Alpine/musl.

http://www.nongnu.org/libunwind/

jbehrends avatar Apr 19 '17 15:04 jbehrends

@jbehrends you are very welcome to open a PR or sponsor someone to do the work :)

xrmx avatar Apr 19 '17 16:04 xrmx

Any solution to this problem? uWSGI raises segmentation error while using Apline but It's impossible to find the root of the problem without the backtrace.

I took a look at the aformentioned libunwind, but I couldn't find any description how that can help.

So do you have any exact solution to catch the backtrace or write it into a log file under Alpine?

caelus-dev avatar Aug 14 '23 22:08 caelus-dev