Skip to content
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

Fixes #21164 - add missing ensure blocks #56

Merged
merged 1 commit into from
Oct 19, 2017

Conversation

lzap
Copy link
Member

@lzap lzap commented Oct 2, 2017

I have no proofs this fixes any memory leaks at all, but it is a good practice to add those ensure blocks. I have a suspicion that it might help my customer to mitigate memory leaks in Satellite 6.2 branch.

@xprazak2
Copy link
Contributor

xprazak2 commented Oct 2, 2017

👍 APJ

@lzap
Copy link
Member Author

lzap commented Oct 2, 2017

Getting SEGFAULT downstream:

/home/jenkins/.rvm/gems/ruby-2.0.0-p648@satellite6-unit-test-smart-proxy-openscap-0/gems/openscap-0.4.7/lib/openscap/xccdf/benchmark.rb:49: [BUG] Segmentation fault
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0077 p:---- s:0354 e:000353 CFUNC  :xccdf_benchmark_get_profiles
c:0076 p:0022 s:0350 e:000349 METHOD /home/jenkins/.rvm/gems/ruby-2.0.0-p648@satellite6-unit-test-smart-proxy-openscap-0/gems/openscap-0.4.7/lib/openscap/xccdf/benc
c:0075 p:0021 s:0343 e:000342 METHOD /home/jenkins/.rvm/gems/ruby-2.0.0-p648@satellite6-unit-test-smart-proxy-openscap-0/gems/openscap-0.4.7/lib/openscap/xccdf/benc
c:0074 p:0021 s:0340 e:000339 METHOD /home/jenkins/workspace/satellite6-unit-test-smart-proxy-openscap/nodes/rhel/ruby/2.0.0/lib/smart_proxy_openscap/openscap_conte
c:0073 p:0017 s:0335 e:000334 LAMBDA /home/jenkins/workspace/satellite6-unit-test-smart-proxy-openscap/nodes/rhel/ruby/2.0.0/lib/smart_proxy_openscap/openscap_api.r [FINISH]
c:0072 p:---- s:0331 e:000330 CFUNC  :call
c:0071 p:0012 s:0328 e:000327 BLOCK  /home/jenkins/.rvm/gems/ruby-2.0.0-p648@satellite6-unit-test-smart-proxy-openscap-0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611 [FINISH]

@lzap
Copy link
Member Author

lzap commented Oct 2, 2017

Okay solved downstream, I freed one extra object, this is correct in this PR.

@lzap
Copy link
Member Author

lzap commented Oct 17, 2017

Guys, we have reports from downstream that this small patch did help. Although this has been extracted into separate process, it is good idea to close resources correctly.

@ares
Copy link
Member

ares commented Oct 19, 2017

Our jenkins seems to use openscap >= 1.2.11, < 1.2.15 which contains the bug that prevents this from working. I ran tests manually and got

33 tests, 73 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

since we got ack from @xprazak2 (thanks), I'm merging it. Thanks @lzap!

@ares ares merged commit 3c84e4a into theforeman:master Oct 19, 2017
@lzap lzap deleted the ensure-destroy-21164 branch October 26, 2017 13:38
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.

4 participants