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

Remove unused code #1196

Merged
merged 21 commits into from
Oct 3, 2018
Merged

Remove unused code #1196

merged 21 commits into from
Oct 3, 2018

Conversation

jan-cerny
Copy link
Member

This PR removes some unused functions, unimplemented functions and unused header files.

These changes have been split out from #1150 .

@jan-cerny jan-cerny added this to the 1.3.0_alpha3 milestone Sep 27, 2018
@jan-cerny
Copy link
Member Author

I cannot reproduce the CI fail.

@jan-cerny
Copy link
Member Author

@openscap-ci test this please

@yuumasato
Copy link
Member

@jan-cerny I was able to reproduce it on a freshly installed Fedora 28 VM.

XCCDF Results are exported correctly.
Stderr file = /tmp/test_remediation_subs_plain_text_empty.out.Ofu6Ae
Result file = /tmp/test_remediation_subs_plain_text_empty.out.1E9Nx6
Title   Ensure that file exists and it is not executable
Rule    xccdf_moc.elpmaxe.www_rule_1
/root/openscap/tests/API/XCCDF/unittests/test_remediation_subs_plain_text_empty.sh: line 34: 11618 Aborted                 (core dumped) $OSCAP xccdf eval --remediate --results $result $srcdir/${name}.xccdf.xml 2> $stderr
…
The following tests FAILED:
	 29 - API/XCCDF/unittests/all.sh (Failed)

@jan-cerny
Copy link
Member Author

@ I'm going to investigate further.

@jan-cerny
Copy link
Member Author

It happens randomly on my Fedora 28 VM, each time in a different test.
I managed to get a backtrace:

#0  0x00007fc5fa57aeab in raise () at /lib64/libc.so.6
#1  0x00007fc5fa5655b9 in abort () at /lib64/libc.so.6
#2  0x00007fc5fa565491 in _nl_load_domain.cold.0 () at /lib64/libc.so.6
#3  0x00007fc5fa573612 in  () at /lib64/libc.so.6                                                                 
#4  0x00007fc5fc35ccbe in  () at /lib64/libpthread.so.0     
#5  0x00007fc5fd30f5b1 in SEAP_desc_unlock (m=0x7fc5e80025a8) at /home/user/openscap/src/OVAL/probes/SEAP/seap-descriptor.h:118                                                                                   
#6  0x00007fc5fd311870 in SEAP_packet_send (ctx=0x7fc5e8000b50, sd=32, packet=0x7fc5d4002da0) at /home/user/openscap/src/OVAL/probes/SEAP/seap-packet.c:878                                                       
#7  0x00007fc5fd312a34 in SEAP_sendmsg (ctx=0x7fc5e8000b50, sd=32, seap_msg=0x7fc5d4002ce0) at /home/user/openscap/src/OVAL/probes/SEAP/seap.c:419                                                                
#8  0x00007fc5fd312c9b in SEAP_reply (ctx=0x7fc5e8000b50, sd=32, rep_msg=0x7fc5d4002ce0, req_msg=0xa9ea40) at /home/user/openscap/src/OVAL/probes/SEAP/seap.c:477                                                 
#9  0x00007fc5fd3072e1 in probe_worker_runfn (arg=0x9d4a60) at /home/user/openscap/src/OVAL/probes/probe/worker.c:126                                                                                             
#10 0x00007fc5fc351594 in start_thread () at /lib64/libpthread.so.0
#11 0x00007fc5fa63de6f in clone () at /lib64/libc.so.6       

@jan-cerny
Copy link
Member Author

jan-cerny commented Oct 1, 2018

The issue is reproducible on current upstream master (as of head 2e25017.)
I have opened an issue #1199 where you can find a traceback.
Therefore this problem is not related to the patches proposed in this PR.

@jan-cerny
Copy link
Member Author

@openscap-ci test this please

2 similar comments
@jan-cerny
Copy link
Member Author

@openscap-ci test this please

@jan-cerny
Copy link
Member Author

@openscap-ci test this please

@codecov
Copy link

codecov bot commented Oct 2, 2018

Codecov Report

Merging #1196 into master will increase coverage by 0.19%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1196      +/-   ##
==========================================
+ Coverage   61.83%   62.02%   +0.19%     
==========================================
  Files         275      273       -2     
  Lines       45203    45064     -139     
==========================================
  Hits        27950    27950              
+ Misses      17253    17114     -139
Impacted Files Coverage Δ
src/OVAL/probes/SEAP/sexp-ID.c 76.66% <ø> (+10.95%) ⬆️
src/OVAL/probes/SEAP/seap-command.c 48.2% <ø> (+0.38%) ⬆️
src/OVAL/probes/SEAP/seap-descriptor.h 54.54% <ø> (ø) ⬆️
src/OVAL/probes/SEAP/generic/strbuf.c 0% <ø> (ø) ⬆️
src/OVAL/probes/SEAP/seap-message.c 98.27% <ø> (+26.12%) ⬆️
src/OVAL/probes/SEAP/sexp-manip_r.c 78.67% <0%> (-0.95%) ⬇️
src/OVAL/probes/probe/worker.c 68.23% <0%> (+0.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1171255...dea91f1. Read the comment docs.

@matejak matejak self-assigned this Oct 3, 2018
@matejak
Copy link
Contributor

matejak commented Oct 3, 2018

Those functions are indeed not used. In case that need for them arises, they are still reachable in git history.
Good job @jan-cerny for finding those orphans!
This PR is good to merge after merge of #1221 and subsequent rebase .

This function is never used and does not do anything useful.
This function is never called.
SEAP_msgattr_set is already defined in
src/OVAL/probes/SEAP/public/seap-message.h
This function is never called.
These functions are already defined in src/OVAL/probes/SEAP/public/seap-message.h
The only typedef was moved to seap-descriptor.h,
where it is used.
Functions strbuf_add0 and strbuf_add0f are not used at all.
This module is not used anywhere.
This backend is not used anywhere.
@jan-cerny
Copy link
Member Author

I have rebased it on master.

@matejak matejak merged commit 1f611cb into OpenSCAP:master Oct 3, 2018
@jan-cerny jan-cerny deleted the unused_removal branch October 3, 2018 13:59
@jan-cerny jan-cerny modified the milestones: 1.3.0_alpha3, 1.3.0 Oct 8, 2018
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