Bug 736006
Summary: | Defects revealed by the Coverity scan | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Michal Luscon <mluscon> |
Component: | papi | Assignee: | William Cohen <wcohen> |
Status: | CLOSED ERRATA | QA Contact: | qe-baseos-tools-bugs |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2 | CC: | kdudka, mnowak, pmuller, praiskup |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | papi-4.1.0-3.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-12-06 18:56:09 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 743047 |
Description
Michal Luscon
2011-09-06 11:54:58 UTC
The array is zero'ed out before use in papi_pfm_events.c. Seems that static analysis tool is not following the man page that is a no-op. According to "man 3 free": free() frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Other- wise, or if free(ptr) has already been called before, undefined behav- ior occurs. If ptr is NULL, no operation is performed. The remaining two things flagged by the static analysis tool are in the test routines and do not end up in the binary rpms. Patches have been sent to the upstream papi developers to fix /src/ctests/do_loops.c and /src/ctests/test_utils.c However, it seems of limited utility to fix this particular set of issues in the RHEL rpm. (In reply to comment #2) > The array is zero'ed out before use in papi_pfm_events.c. Seems that static > analysis tool is not following the man page that is a no-op. According to "man > 3 free": The tool does not care about man pages. It checks the code. Unless I am mistaken, the code is wrong. If load_preset_table() returns non-zero, you pass the NULL pointer to free_notes(), which is _not_ no-op. Please explain how exactly is the situation above handled by the code. You are correct. Have patches to address the problems found in the scans. The patch /src/ctests/do_loops.c and /src/ctests/test_utils.c has been accepted upstream. The upstream has signficantly changed for papi_pfm_events.c, so that patch won't be applicable to papi upstream. Built papi-4.1.3-3 with patches to fix the problems identified by coverity in this bz. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1755.html |