Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA CMake conditional was added to the bundled Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
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 `@CMakeLists.txt`:
- Around line 668-674: The compiler check for applying debug/optimization flags
to target_compile_options(yyjson ...) omits AppleClang, so macOS system builds
won't get the stack-shrinking -Og adjustment; update the CMAKE_C_COMPILER_ID
MATCHES expression used in the if(...) guarding target_compile_options for the
yyjson target to include "AppleClang" (make it match "GNU|Clang|AppleClang") so
the -Og option is applied on AppleClang debug/RelWithDebInfo configurations.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 930f191ee2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # yyjson's O0 reader can exceed the default coroutine stack budget. | ||
| # Keep debug symbols, but force enough optimization to shrink the frame. | ||
| target_compile_options(yyjson PRIVATE | ||
| $<$<AND:$<COMPILE_LANGUAGE:C>,$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>>:-Og> |
There was a problem hiding this comment.
Skip the
-Og override when coverage is enabled
When Fluent Bit is configured with -DFLB_COVERAGE=On, CMakeLists.txt:467-472 explicitly adds -O0 --coverage and forces CMAKE_BUILD_TYPE=Debug, and that mode is exercised in .github/workflows/unit-tests.yaml:52. This new $<CONFIG:Debug> branch still appends -Og for yyjson, so the parser is no longer built with the project’s intended coverage flags (the last optimization flag wins for GCC/Clang). In that configuration the coverage job will collect different, less faithful line/branch coverage for yyjson than before, even though only interactive debug builds needed the stack-frame workaround.
Useful? React with 👍 / 👎.
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
yyjson's reader can generate an oversized stack frame in SIMD-enabled Debug/RelWithDebInfo builds, which exceeds Fluent Bit's default coroutine stack budget and can break JSON parsing in coroutine paths such as filter_kubernetes.
This change forces -Og for the yyjson target in Debug and RelWithDebInfo builds for GNU/Clang/ Intel compilers. It preserves debug symbols while shrinking yyjson_read_opts() from 26112 bytes to 1472 bytes in the affected build, avoiding coroutine stack overflows without changing parser behavior.
(cc: @cosmo0920 )
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