8000 CPU Percentage: after realloc the pointer becomes invalid; by dothebart · Pull Request #639 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

CPU Percentage: after realloc the pointer becomes invalid; #639

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

Merged
merged 1 commit into from
Jul 24, 2014

Conversation

dothebart
Copy link
Contributor

need to work on new pointer else we will crash.

fixes https://gist.github.com/toni-moreno/a2f80021535f87202de7

@toni-moreno
Copy link
Contributor

hi @dothebart, thanks a lot by this fix.

It is easy to reproduce the crash in, #587 we need only restarting several times. So I've been building a little testing set which does a big loop restart with different configurations ( adding a plugin on each loop iteration) and counting crashes.

I will test with my current binaries ( compiled on a RHEL 5.5 kernel 2.6.18-194.el5) and after I will patch with this fix.

I will send you the results in a few days.

Thank you very much!

@toni-moreno
Copy link
Contributor

hi @dothebart I'm still working on some kind of test to validate your fix, I agree that it seems a clear bug in the realloc pointer.

The crashed where detected on 69187b7, compiled over RHEL 5.6 on a server exact like a production server.

When I did the loop of 500 restarts adding a plugin on each iteration , the number of crashes with this binaries were:

1.-plugin_graphite.conf:0
2.-plugin_memory.conf:0
3.-plugin_swap.conf:2
4.-plugin_df.conf:3
5.-plugin_disk.conf:2
6.-plugin_processes.conf:1
7.-plugin_interface.conf:1
8.-plugin_cpu.conf:159
9.-plugin_ping.conf:481

As you can see after added the cpu plugin the crashes grow exponentially

After I did the same test changing the plugin order with the following results:

0.-plugin_graphite.conf:0
1.-plugin_cpu.conf:209
2.-plugin_memory.conf:183
3.-plugin_swap.conf :195
4.-plugin_df.conf:610
5.-plugin_disk.conf:192
6.-plugin_processes.conf:415
7.-plugin_interface.conf:158
8.-plugin_ping.conf:204

As you can see again after cpu plugin loads the crash number grow exponentially.

Then I tried to recompile it and I choose the last commit d76d251 ( since no significant changes found) .

But now I can not reproduce it on a testing machine after recompiling with other hardware and compiled over RHEL 5.9.

I'm sure this bug is responsible for most of crashes but I can not reproduce it.

I will try to patch on next days directly on the machines where are still crashing and I will report results to you

Thank you very match!

pyr added a commit that referenced this pull request Jul 24, 2014
CPU Percentage: after realloc the pointer becomes invalid;
@pyr pyr merged commit fff2e10 into collectd:master Jul 24, 2014
@pyr
Copy link
Member
pyr commented Jul 24, 2014

thanks @dothebart

@pyr
Copy link
Member
pyr commented Jul 24, 2014

@toni-moreno thanks for the helpful pointers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0