Skip to content

out_azure_logs_ingestion: Plug SEGV on termination#11800

Open
cosmo0920 wants to merge 1 commit into
masterfrom
cosmo0920-plug-segv-on-dry-run
Open

out_azure_logs_ingestion: Plug SEGV on termination#11800
cosmo0920 wants to merge 1 commit into
masterfrom
cosmo0920-plug-segv-on-dry-run

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented May 14, 2026

We just needed to add a NULL check on an exit callback.

Closes #11789.


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

  • Bug Fixes
    • Fixed a potential crash in Azure Logs Ingestion by adding a null-check guard to prevent errors when the plugin context is unavailable.

Review Change Stack

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

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74e881b4-7d99-4085-adf3-1e857ab14e55

📥 Commits

Reviewing files that changed from the base of the PR and between 811b5ef and 0b3a3c8.

📒 Files selected for processing (1)
  • plugins/out_azure_logs_ingestion/azure_logs_ingestion.c

📝 Walkthrough

Walkthrough

The cb_azure_logs_ingestion_exit function now checks whether the plugin context is NULL before attempting to log and destroy it. This prevents a segmentation fault when the plugin is shut down before the context is fully initialized, such as during --dry-run execution.

Changes

Azure Logs Ingestion Plugin NULL Guard

Layer / File(s) Summary
Exit callback NULL pointer guard
plugins/out_azure_logs_ingestion/azure_logs_ingestion.c
The exit callback adds an early return when the context is NULL, preventing log and destroy operations on an invalid pointer.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

docs-required, backport to v4.1.x

Suggested reviewers

  • edsiper

Poem

🐰 A pointer guard stands tall and true,
Checking null before we're through,
No crash in dry-run's gentle way,
Safe shutdown brings a brighter day! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 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: adding a NULL check to prevent a segmentation fault on termination in the azure_logs_ingestion plugin.
Linked Issues check ✅ Passed The code change directly addresses the linked issue #11789 by adding a NULL guard to prevent SIGSEGV during plugin exit, allowing --dry-run to complete cleanly.
Out of Scope Changes check ✅ Passed The change is minimal and focused only on guarding against NULL context in the exit callback, with no extraneous modifications outside the stated objective.

✏️ 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 cosmo0920-plug-segv-on-dry-run

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

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.

azure_logs_ingestion plugin causes Fluent Bit to segfault during --dry-run

1 participant