Skip to content

Fix segfault in processors/parser#9283

Merged
reimda merged 6 commits intoinfluxdata:masterfrom
HRI-EU:processor_parser_segfaul_fix
Jun 15, 2021
Merged

Fix segfault in processors/parser#9283
reimda merged 6 commits intoinfluxdata:masterfrom
HRI-EU:processor_parser_segfaul_fix

Conversation

@srebhan
Copy link
Copy Markdown
Member

@srebhan srebhan commented May 20, 2021

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.

resolves #9282

Parsers can use the telegraf logging facility by defining a Log field. When using those parsers in inputs the logging facility is automatically set by telegraf after instantiation. However, in this processor the parsers are instantiated manually and setting the log facility is omitted. This in turn leads to segfault-panics for all parsers that rely on the logging facility.

This PR fixes the issue by passing its (newly added) logging facility on to the parser and in this step also gets rid of the unrecommended usage of the log package.
Additionally, some minor improvements like making the parser private and fixing the remaining linter issues are performed.

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label May 20, 2021
@srebhan srebhan added fix pr to fix corresponding bug plugin/processor labels May 20, 2021
@mirkocomparetti-synesis
Copy link
Copy Markdown

Tested. Looks good for me!

Copy link
Copy Markdown
Contributor

@ssoroka ssoroka left a comment

Choose a reason for hiding this comment

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

Not sure about the debug lines (see comment), but otherwise looks good

@reimda reimda merged commit 6cc942f into influxdata:master Jun 15, 2021
reimda pushed a commit that referenced this pull request Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin fix pr to fix corresponding bug plugin/processor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[processors.parser] Segmentation fault in nested parsing

4 participants