-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault when using postgres plugin #5829
Comments
Please send the output of the postgres plugin with chart definitions and the first two steps of data collection. |
hi @davidmehren
so it crashes immediately after the start? |
Enable debugging and set |
Please have a look at https://gist.github.com/davidmehren/05196dcbb0df2a45ecc47648bee1b0c2
When I use
I have tried to run netdata a few times:
As you can see, it runs for a bit and seems so collect metrics (including postgres, I can see them in the instance they are streamed to) for one or two times, then crashes. |
Recompile netdata with |
Sorry, I did that yesterday and didn't realize the updater ran this morning and broke it. |
There is a problem with chart naming. If names are not provided explicitly, charts are named automatically using chart IDs. The issue is that due to troubles of handling special characters in JavaScript names are 'normalised' in a way that any non-alphanumeric character except "." is converted to "_". In this particular case, there are problematic charts which include When a chart is created with a converted name which already exists in the netdata database, the pointer to the name remains null and it leads to segmentation fault when streaming to a master. |
The replacement isn't done in javascript, but here. Duplicate names are supposed to be handled in https://github.com/netdata/netdata/blob/master/database/rrdset.c#L152 @vlvkobal can you test your theory of duplicate names and see where and how we get the SEGFAULT? |
I didn't say that it is done in JavaScript, I said that it is done due to the JavaScript. Yes, exactly, it is done in
Yes, but the returned value from
I did it a few days before, and my previous comment was a result of the investigation. I wrote already that the segmentation fault happens when a slave is trying to push an unnamed chart to a master. My previous message was written mostly as a memo. What we need is to decide what to do with the problem. The simplest workaround for the segmentation fault is to add a check for an empty name in streaming and don't push unnamed charts, but it doesn't solve the main problem - name duplication. |
Lines 127 to 128 in 2192f26
Why only dots and alphanumeric? |
#5882 was merged. @davidmehren please test it. It should resolve the issue, though badly named charts won't be shown. |
The discussion on the main problem will continue in #5883. |
I can confirm that netdata does not crash anymore. Thanks everyone for the quick help! |
@davidmehren thank you for your report and assistance! |
Bug report summary
When the postgres plugin is enabled, netdata segfaults. When running the postgres plugin in standalone mode using
sudo -u netdata /usr/libexec/netdata/plugins.d/python.d.plugin postgres
it works fine.I have captured a stacktrace:
OS / Environment
Ubuntu 18.04.2 in an LXC container on a Proxmox host
Netdata version (output of
netdata -V
)netdata bee48fd3
Component Name
Not sure,
collectors
maybe?Steps To Reproduce
Configure postgres credentials.
Enable the postgres plugin.
Expected behavior
Postgres metrics get collected.
The text was updated successfully, but these errors were encountered: