-
Notifications
You must be signed in to change notification settings - Fork 692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backtraces are not printed when running under Alpine Linux #1514
Comments
It looks like musl doesn't provide execinfo.h which is a requirement for that code. |
Doing a little googling it appears that other projects have implemented "libunwind" as an alternative for backtrace functionality when running under Alpine/musl. |
@jbehrends you are very welcome to open a PR or sponsor someone to do the work :) |
When exceptions are thrown or when a signal is caught, we want a backtrace so we can diagnose problems. For some reason I cannot debug further, execinfo's backtrace() function call segfaults on alpine linux. This commit disables backtrace by detecting the OS and turning backtrace off on alpine. It appears that on alpine backtrace never worked for us, but we also never tested it. ;-) Previously, it was disabled on RELEASE builds (which we test) and now that I want to enable backtraces independent of DEBUG vs RELEASE (or whatever), this breaks, so this commit puts in an alpine-specific fix. I'm not very happy with this solution. For example, detecing execinfo instead would have been better, but alpine's quick'n'dirty implementation of gnu's libexecinfo package does not provide a compiler macro for detecting execinfo, so we disable backtrace on alpine. References: http://man7.org/linux/man-pages/man3/backtrace.3.html https://pkgs.alpinelinux.org/package/edge/main/x86/libexecinfo-dev https://www.freshports.org/devel/libexecinfo https://www.gnu.org/software/libc/manual/html_node/Backtraces.html unbit/uwsgi#1514 (may be related)
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? |
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:
uwsgi/core/uwsgi.c
Line 1886 in bc536ee
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
The text was updated successfully, but these errors were encountered: