-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
I'm running Envoy in a docker container under Kubernetes and it's crashing, producing a stack trace in the log output. Unfortunately, I can't translate the addresses in this stack trace using tools/stack_decode.py because address space layout randomization (ASLR) was in effect when Envoy was running, and when it produces the stack trace, Envoy doesn't print the base address of the process so that the virtual addresses in the stack trace can be transformed into offsets suitable for addr2line. Once the Envoy process has ended, I have no way of getting the base address.
A secondary problem is that stack_decode.py, when run in the mode where it translates addresses that it reads from standard input, doesn't offer a syntax for providing the base address of the process. PR #12989 addressed this for the case when stack_decode.py itself is running the Envoy executable, but not for the other case.
Would it be possible to get Envoy to log the base address of the process at the beginning of stack trace, and then to either automatically adjust the addresses printed in the stack trace by that amount or to enhance stack_decode.py to allow the base address to be specified on the command line so the script can use it to adjust the addresses? To get the base address, some technique similar to the following commands could be used:
cat /proc/<pid>/maps | grep r-xp | grep envoy(I'm sure there's a better way to do that in the Envoy code)