Skip to content

Fix memory corruption issue when executing context queries in RAM/SAVE memory mode#10933

Merged
stelfrag merged 1 commit intonetdata:masterfrom
stelfrag:fix_memory_corruption_on_context_request
Apr 7, 2021
Merged

Fix memory corruption issue when executing context queries in RAM/SAVE memory mode#10933
stelfrag merged 1 commit intonetdata:masterfrom
stelfrag:fix_memory_corruption_on_context_request

Conversation

@stelfrag
Copy link
Copy Markdown
Collaborator

@stelfrag stelfrag commented Apr 7, 2021

Fixes #10929

Summary

Then executing queries in RAM / SAVE mode, the metric_uuid was never properly allocated and
would result in memory corruption.

Component Name

database
web

Test Plan
  • Start agent with memory mode not being dbengine e.g RAM / SAVE
  • Execute a query http://127.0.0.1:19999/api/v1/data?context=net.net
    • This will attempt to free a copy of a rd->state->metric_uuid that belongs to the original rrddim and result to a crash
  • Apply the PR
  • Agent should not crash
Additional Information

Note: This is a temporary fix. A new PR in the next version avoids the memory allocation of the metric_uuid

Copy link
Copy Markdown
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

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

I tested locally and on cloud and netdata did not crash when I ran netdata using ram.

@stelfrag stelfrag merged commit ee64ef0 into netdata:master Apr 7, 2021
@stelfrag stelfrag deleted the fix_memory_corruption_on_context_request branch April 7, 2021 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Netdata processes die while connect to Cloud/WarRoom

4 participants