Bug 580547 - rpminfo probe fails self test
Summary: rpminfo probe fails self test
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: openscap
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-08 13:56 UTC by Steve Grubb
Modified: 2011-05-16 11:56 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 693594 (view as bug list)
Environment:
Last Closed: 2011-05-16 11:56:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Steve Grubb 2010-04-08 13:56:49 UTC
Description of problem:
If I download git repo to RHEL5 machine and run "make check" after building the library, the rpminfo probe test fails.

Version-Release number of selected component (if applicable):
git repo on 08-Apr-10

Actual results:
+ test_probes_rpminfo                     [ FAIL ]

Comment 2 Steve Grubb 2010-04-10 14:35:22 UTC
Checked out git and built a distribution tarball. Unpacked it on RHEL5 and ran make check. It still fails. Not sure if this is helpful or not...I ran:

export OVAL_PROBE_DIR="$(pwd)/src/OVAL/probes/"
strace ./tests/test_probes tests/test_probes_rpminfo.xml /tmp/test_probes_rpminfo.xml.res

and got the following:

socketpair(PF_FILE, SOCK_STREAM, 0, [3, 4]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2b6befc828d0) = 17952
close(4)                                = 0
writev(3, [{"(#d8:seap.msg#d3::id#d0((#d14:sy"..., 67}], 1) = 67
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
read(3, "(#d8:seap.msg#d3::id#d0#d9::repl"..., 16384) = 638
times({tms_utime=0, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 429607549
futex(0x63b980, FUTEX_WAKE_PRIVATE, 2147483647) = 0
socketpair(PF_FILE, SOCK_STREAM, 0, [4, 5]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2b6befc828d0) = 17968
--- SIGCHLD (Child exited) @ 0 (0) ---
close(5)                                = 0
writev(4, [{"(#d8:seap.msg#d3::id#d0((#d14:rp"..., 131}], 1) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
+++ killed by SIGPIPE +++

The .res file is empty.

Comment 3 Daniel Kopeček 2010-04-12 16:09:31 UTC
I've tested this on RHEL 5.4. Are you using a different minor release? What is the version of the rpm library installed on your system? Here are results from my testing environment for comparison:

$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
$ rpmquery rpm-libs
rpm-libs-4.4.2.3-18.el5
$ make check
...
...
--------------------------------------------------
+ test_probes_setup                       [ PASS ]
+ test_probes_sysinfo                     [ PASS ]
+ test_probes_family                      [ PASS ]
+ test_probes_uname                       [ PASS ]
+ test_probes_file                        [ PASS ]
+ test_probes_rpminfo                     [ PASS ]
+ test_probes_runlevel_A                  [ PASS ]
+ test_probes_runlevel_B                  [ PASS ]
+ test_probes_password_A                  [ PASS ]
+ test_probes_shadow_A                    [ SKIP ]
+ test_probes_textfilecontent54           [ PASS ]
+ test_crapi_digest                       [ PASS ]
+ test_probes_cleanup                     [ PASS ]
--------------------------------------------------
See test_probes.log (in tests dir)
PASS: OVAL/probes/test_probes.sh
==================
All 3 tests passed
==================

The probe probably still segfaults on your system. Please try to run it directly (i.e. without using ./test_probes) via gdb or valgrind and with rpm-debuginfo installed. The input for the probe can be something like the following:

(seap.msg :id 0 ((rpminfo_object :id "oval:1:obj:1") ((name :operation 1 :var_check "all") "acl")))

You can substitute acl with some other package name. Path to the probe is...

$ ./src/OVAL/probes/probe_file

...assuming you are in $(top_srcdir)

Comment 4 Daniel Kopeček 2010-04-12 16:14:21 UTC
Ok, you can't use ./src/OVAL/probes/probe_file if you are going to use gdb or valgrind. Please use the following path instead:

./src/OVAL/probes/.libs/lt-probe_file

and set the LD_LIBRARY_PATH environment variable to "$(pwd)/src/.libs". Here is the complete command for the sake of clarity:

$ LD_LIBRARY_PATH="$(pwd)/src/.libs" gdb ./src/OVAL/probes/.libs/lt-probe_file

You could use `set follow-fork-mode child' or --trace-children=yes in case of valgrind, but the "raw" way is more reliable, I think. Thanks.

Comment 5 Steve Grubb 2010-04-12 16:22:15 UTC
I think I'm on 5.3 which uses rpm-4.4.2.3-9.el5.

Starting program: /home/sgrubb/working/BUILD/openscap-0.5.8/src/OVAL/probes/.libs/lt-probe_file 
[Thread debugging using libthread_db enabled]
(seap.msg :id 0 ((rpminfo_object :id "oval:1:obj:1") ((name :operation 1
:var_check "all") "acl")))
[New Thread 0x2ac385471e80 (LWP 3262)]
[New Thread 0x422a2940 (LWP 3265)]
(#d8:seap.err#d8::orig_id#d0#d5::type#d1#d2)[Thread 0x422a2940 (LWP 3265) exited]
bt

Program exited with code 026.
Does this help any?

Comment 6 Steve Grubb 2010-04-12 16:38:46 UTC
Went back and checked ./configure's output:

checking for gcry_check_version in -lgcrypt... yes
checking for library containing rpmdbOpen... no
configure: RPM missing rpmtsCreate compatibility.  RPM probes will not be enabled.

Installing rpm-devel fixes the probes:

+ test_probes_rpminfo                     [ PASS ]

So, I guess that if a probe is not built, its corresponding test should also not be run.

Comment 7 Bug Zapper 2010-07-30 11:16:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.