Skip to content

tests: http_client_chunked: Plug SEGV occurence on macOS#11711

Merged
edsiper merged 1 commit intomasterfrom
comos0920-plug-segv-on-chunked-test-case
Apr 16, 2026
Merged

tests: http_client_chunked: Plug SEGV occurence on macOS#11711
edsiper merged 1 commit intomasterfrom
comos0920-plug-segv-on-chunked-test-case

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented Apr 14, 2026

http_client_chunked test case is always failing on macOS due to uninitialized conroutine on the test case.
We need to ensure initializing coroutine before running the actual assertions.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • Tests
    • Updated test infrastructure for coroutine support initialization.

No user-facing changes in this update.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

📝 Walkthrough

Walkthrough

A test file for HTTP client chunking adds coroutine support initialization. A file-local guard ensures flb_coro_init() runs once, while each context creation calls flb_coro_thread_init() after event-loop setup. No public behavior changes.

Changes

Cohort / File(s) Summary
Coroutine Initialization in Test Context
tests/runtime/http_client_chunked.c
Added coroutine setup: included flb_coro.h, introduced static guard to call flb_coro_init() once, and ensured per-context flb_coro_thread_init() invocation after event-loop initialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • edsiper

Poem

🐰 A tiny init guard stands proud and tall,
Ensuring coros wake but once for all,
Each context blooms with threaded cheer,
The test now dances, crystal clear!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing a segmentation fault in the http_client_chunked test on macOS by initializing coroutines.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch comos0920-plug-segv-on-chunked-test-case

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/runtime/http_client_chunked.c`:
- Around line 172-175: The if-statement that initializes coroutines uses an
opening brace on the same line; update the formatting to place the opening brace
on the next line to follow the project C style for control blocks: locate the
check using coro_initialized and the call flb_coro_init() and reformat the if
(coro_initialized == FLB_FALSE) to put the brace on the next line while keeping
the existing body and logic unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6fa31279-781d-4018-9b25-7fe92cbb928b

📥 Commits

Reviewing files that changed from the base of the PR and between 63ed88e and 893c9fd.

📒 Files selected for processing (1)
  • tests/runtime/http_client_chunked.c

Comment thread tests/runtime/http_client_chunked.c
@edsiper edsiper merged commit 8eef175 into master Apr 16, 2026
54 checks passed
@edsiper edsiper deleted the comos0920-plug-segv-on-chunked-test-case branch April 16, 2026 17:17
@cosmo0920 cosmo0920 added this to the Fluent Bit v5.0.4 milestone Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants