tetratelabs / archive-envoy

Archive of Envoy® release binaries
Apache License 2.0
12 stars 4 forks source link

Adds debug version support #7

Closed codefromthecrypt closed 3 years ago

codefromthecrypt commented 3 years ago

This allows us to archive debug builds, via a naming convention ${version}_debug. The naming convention intentionally avoids hyphens in order to allow easy copy-paste and prevent interference on those splitting on hyphen.

This also fixes #6, by including all binaries (notably we were only missing bin/su-exec)

Many thanks to @mathetake who helped elaborate the use case of debug builds. Even if not many should need these, knowing why helps!

Debug releases

Debug versions help provide troubleshooting information to Envoy maintainers when there is a crash (Segmentation fault). A debug version ends in _debug (ex v1.18.3_debug) and listed in envoy-versions_debug.json.

NOTE Debug builds are very large. For example, the normal build may be less than 70MB, while its debug build is >2GB. Only use debug versions in advanced situations.

The main visible change is insight into the source that led to a segmentation fault.

Ex. a normal version may crash with a backtrace like this:

[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:104] Caught Segmentation fault, suspect faulting address 0x0
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:91] Backtrace (use tools/stack_decode.py to get line numbers):
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:92] Envoy version: d362e791eb9e4efa8d87f6d878740e72dc8330ac/1.18.2/Clean/RELEASE/BoringSSL
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #0: __restore_rt [0x7f75e06d1980]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #1: [0x55974d40da69]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #2: [0x55974daae313]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #3: [0x55974cf2d94d]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #4: [0x55974cf316d5]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #5: [0x55974cf3fd41]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #6: [0x55974d02e2e0]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #7: [0x55974d036a36]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #8: [0x55974ce066bf]
[2021-06-18 03:51:22.264][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #9: [0x55974cf65f40]
[2021-06-18 03:51:22.265][33][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #10: [0x55974cf66382]

A debug version has more information in the backtrace, and may lead to faster diagnosis:

[2021-06-18 03:44:43.425][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:104] Caught Segmentation fault, suspect faulting address 0x0
[2021-06-18 03:44:43.425][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:91] Backtrace (use tools/stack_decode.py to get line numbers):
[2021-06-18 03:44:43.425][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:92] Envoy version: d362e791eb9e4efa8d87f6d878740e72dc8330ac/1.18.2/Clean/RELEASE/BoringSSL
[2021-06-18 03:44:43.425][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #0: __restore_rt [0x7f93cafa5980]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:98] #1: [0x55e14b315a69]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #2: std::__terminate() [0x55e14b9b6313]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #3: Envoy::Http::ConnectionManagerImpl::ActiveStream::chargeStats() [0x55e14ae3594d]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #4: Envoy::Http::ConnectionManagerImpl::ActiveStream::encodeHeaders() [0x55e14ae396d5]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #5: Envoy::Http::FilterManager::encodeHeaders() [0x55e14ae47d41]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #6: Envoy::Router::Filter::onUpstreamHeaders() [0x55e14af362e0]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #7: Envoy::Router::UpstreamRequest::decodeHeaders() [0x55e14af3ea36]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #8: Envoy::Http::Http1::ActiveClient::StreamWrapper::decodeHeaders() [0x55e14ad0e6bf]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #9: Envoy::Http::Http1::ClientConnectionImpl::onHeadersCompleteBase() [0x55e14ae6df40]
[2021-06-18 03:44:43.432][32][critical][backtrace] [bazel-out/k8-opt/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #10: Envoy::Http::Http1::ClientConnectionImpl::onHeadersCompleteBase() [0x55e14ae6e382]
netlify[bot] commented 3 years ago

:heavy_check_mark: Deploy Preview for archive-envoy ready!

:hammer: Explore the source changes: 6572d07b43db85d5e4beea038c14c033789d8210

:mag: Inspect the deploy log: https://app.netlify.com/sites/archive-envoy/deploys/60cc3ad06daaa800075328d6

:sunglasses: Browse the preview: https://deploy-preview-7--archive-envoy.netlify.app

codefromthecrypt commented 3 years ago

@mathetake PTAL at the script headers if you don't mind. I think they hopefully make more sense now

mathetake commented 3 years ago

much better I think 😄

codefromthecrypt commented 3 years ago

good.. I think future me will appreciate this also :D

codefromthecrypt commented 3 years ago

ok final name is bin/tar_envoy_artifact.sh as it is making the a release artifact in tar format. Thanks for all the backchannel on this @mathetake!