Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1995208

Summary: false positive static code analyzer report with linked list and loop allocating entries
Product: Red Hat Enterprise Linux 9 Reporter: Karol Herbst <kherbst>
Component: gccAssignee: Dave Malcolm <dmalcolm>
gcc sub component: system-version QA Contact: qe-baseos-tools-bugs
Status: CLOSED UPSTREAM Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ahajkova, dmalcolm, fweimer, jakub, mpolacek, ohudlick
Version: unspecifiedKeywords: Bugfix, Triaged
Target Milestone: betaFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-09 17:53:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
c file hitting the issue
none
gcc output none

Description Karol Herbst 2021-08-18 16:08:26 UTC
Created attachment 1815272 [details]
c file hitting the issue

Description of problem:
When creating a linked list within a loop and allocating two objects, after various checks the analyzer things we leak the objects. I tried to reproduce a little different issue, but this is good enough.

Version-Release number of selected component (if applicable):
gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-2)

How reproducible:
always

Steps to Reproduce:
1. gcc -fanalyzer attachment.c

Actual results:
see second attachment

Expected results:
no error

Additional info:
valgrind also doesn't find any leaks when running application

Comment 1 Karol Herbst 2021-08-18 16:09:08 UTC
Created attachment 1815273 [details]
gcc output

Comment 7 Dave Malcolm 2021-08-19 15:50:09 UTC
Filed upstream as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101983

Comment 11 Marek Polacek 2022-02-09 17:53:44 UTC
No progress in the upstream so far.  Let's track it in PR101983.