Skip to content

ci: workaround gRPC/OpenSSL memory issue - #16525

Merged
scotthart merged 1 commit into
googleapis:mainfrom
scotthart:ci_quickstart_production_grpc_openssl_memory
Oct 1, 2026
Merged

scotthart merged 1 commit into
googleapis:mainfrom
scotthart:ci_quickstart_production_grpc_openssl_memory

Conversation

@scotthart

Copy link
Copy Markdown
Member

Switched gRPC to use its own boringssl instead of the system OpenSSL to workaround grpc/grpc#22608.

The gRPC + OpenSSL Interaction
When gRPC is built with -DgRPC_SSL_PROVIDER=package (linking system OpenSSL instead of bundled BoringSSL):

  • gRPC initializes SSL state in src/core/tsi/ssl_transport_security.cc (SslInit() / tsi_ssl_create_handshaker_factory).
  • gRPC registers ex_data callbacks with OpenSSL but does not cleanly deregister or reset its OpenSSL state before process termination (as tracked in gRPC Issue #22608).
  • When OpenSSL’s OPENSSL_cleanup deinitializes globals at process termination, the combination of gRPC's ex-data callbacks and OpenSSL 3's cleanup order causes ERR_clear_error to re-allocate or free already-freed memory blocks, producing malloc(): corrupted top size, double free or corruption, or free(): invalid pointer errors under glibc malloc check (MALLOC_CHECK_=3 / Valgrind / ASan).

@scotthart
scotthart requested a review from a team as a code owner October 1, 2026 15:57

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the fedora-cmake-quickstart.Dockerfile to use gRPC version v1.84.0, configures additional third-party dependencies (grpc-proto and boringssl-with-bazel), and changes the SSL provider option to module. However, the specified gRPC version v1.84.0 does not exist on GitHub, which will cause the curl download to fail with a 404 error and break the Docker build. You should revert to a valid released version of gRPC.

Comment thread ci/cloudbuild/dockerfiles/fedora-cmake-quickstart.Dockerfile
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.35%. Comparing base (d80cae6) to head (e9eadaf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16525      +/-   ##
==========================================
- Coverage   92.36%   92.35%   -0.02%     
==========================================
  Files        2262     2262              
  Lines      217027   217027              
==========================================
- Hits       200460   200433      -27     
- Misses      16567    16594      +27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scotthart
scotthart force-pushed the ci_quickstart_production_grpc_openssl_memory branch from 51503fe to e9eadaf Compare October 1, 2026 17:30
@scotthart
scotthart merged commit 92cf97d into googleapis:main Oct 1, 2026
80 of 81 checks passed

This branch was successfully deployed

1 active deployment
false — e9eadafb Deployed Oct 1, 2026 by scotthart via Save PR ref #12228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants