Skip to content

[C-core] Fixed occasional segmentation fault in C-core#41630

Closed
Zgoda91 wants to merge 2 commits into
grpc:masterfrom
Zgoda91:fix_for_occasional_seg_fault
Closed

[C-core] Fixed occasional segmentation fault in C-core#41630
Zgoda91 wants to merge 2 commits into
grpc:masterfrom
Zgoda91:fix_for_occasional_seg_fault

Conversation

@Zgoda91

@Zgoda91 Zgoda91 commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

There is an occasional segmentation fault in C-core in chttp2_transport.cc

The issue is related to non-existing grpc_core::ExecCtx object (NULL) during lambda destructor call. notify_on_receive_settings lambda-captured object might actually use grpc_core::ExecCtx object internally, meaning that we need to re-organize object destruction sequence a bit.

Found while executing src/python/grpcio_tests/tests_aio/unit/call_test test suite (test_cancel_unary_unary_in_task test case) in a loop for 1'000 iterations.

Before the fix the issue was reproducible every 100-200 test runs.

After the fix was implemented I was not able to reproduce the issue after 10'000 test runs (both gLinux and vanilla Ubuntu 20.04).

@Zgoda91 Zgoda91 marked this pull request as ready for review February 13, 2026 15:22
@Zgoda91 Zgoda91 requested a review from ctiller as a code owner February 13, 2026 15:22
@Zgoda91 Zgoda91 requested a review from markdroth February 13, 2026 15:25
@Zgoda91

Zgoda91 commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

@markdroth @ctiller PTAL

Comment thread src/core/ext/transport/chttp2/transport/chttp2_transport.cc Outdated

@markdroth markdroth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix!

@markdroth markdroth added the release notes: no Indicates if PR should not be in release notes label Feb 17, 2026
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
----
DO NOT SUBMIT. This PR is for testing purposes only. [cl/871616072](http://cl/871616072)

PiperOrigin-RevId: 871616072
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2026
PiperOrigin-RevId: 871881944
Zgoda91 added a commit to Zgoda91/grpc that referenced this pull request Mar 22, 2026
There is an occasional segmentation fault in C-core in `chttp2_transport.cc`

The issue is related to non-existing `grpc_core::ExecCtx` object (NULL) during lambda destructor call. `notify_on_receive_settings` lambda-captured object might actually use `grpc_core::ExecCtx` object internally, meaning that we need to re-organize object destruction sequence a bit.

Found while executing `src/python/grpcio_tests/tests_aio/unit/call_test` test suite (`test_cancel_unary_unary_in_task` test case) in a loop for 1'000 iterations.

Before the fix the issue was reproducible every 100-200 test runs.

After the fix was implemented I was not able to reproduce the issue after 10'000 test runs (both gLinux and vanilla Ubuntu 20.04).

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#41630

COPYBARA_INTEGRATE_REVIEW=grpc#41630 from Zgoda91:fix_for_occasional_seg_fault e5d9393
PiperOrigin-RevId: 871513750
Zgoda91 pushed a commit to Zgoda91/grpc that referenced this pull request Mar 22, 2026
PiperOrigin-RevId: 871881944
asheshvidyut pushed a commit to asheshvidyut/grpc that referenced this pull request Mar 26, 2026
PiperOrigin-RevId: 871881944
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat/none lang/core release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants