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: beta   
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.