Bug 1995208 - false positive static code analyzer report with linked list and loop allocating entries
Summary: false positive static code analyzer report with linked list and loop allocati...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: gcc
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Dave Malcolm
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-18 16:08 UTC by Karol Herbst
Modified: 2023-07-18 14:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-09 17:53:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
c file hitting the issue (543 bytes, text/plain)
2021-08-18 16:08 UTC, Karol Herbst
no flags Details
gcc output (3.35 KB, text/plain)
2021-08-18 16:09 UTC, Karol Herbst
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 101983 0 P3 UNCONFIRMED analyzer leak false positives building singly linked list 2022-02-09 17:52:12 UTC
Red Hat Issue Tracker RHELPLAN-93962 0 None None None 2021-08-18 21:42:11 UTC

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.


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