Bug 4456 - scan-build reports numerous memory errors and logic errors
Summary: scan-build reports numerous memory errors and logic errors
Status: RESOLVED PATCHESWELCOME
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.18.0
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2021-03-05 09:01 UTC by Avinash Sonawane
Modified: 2021-09-03 15:27 UTC (History)
0 users

See Also:


Attachments

Description Avinash Sonawane 2021-03-05 09:01:44 UTC
Hello!

On latest master, scan-build[0] reports numerous memory errors and logic errors besides other issues.

Here is the scan-build report: https://rootkea.gitlab.io/claws/scan-build/

And this is the .gitlab-ci.yml which generated this report: https://gitlab.com/rootkea/claws/-/blob/gitlab-scan-build/.gitlab-ci.yml

[0] https://clang-analyzer.llvm.org/scan-build.html

Regards,
Avinash Sonawane (rootKea)
PICT Pune
Comment 1 Paul 2021-03-05 09:50:09 UTC
Patches also welcome.
Comment 2 Paul 2021-03-05 13:58:17 UTC
There are some, perhaps many, false positives in your report.
I'll close this until a more nuanced approach to finding errors is peformed.

In the meantime, if you want to explore the list, please feel free to submit patches.
Comment 3 Avinash Sonawane 2021-09-03 15:27:52 UTC
> There are some, perhaps many, false positives in your report.

May be.

But there are many genuine bugs.

I just picked this random bug found by scan-build[0]: https://rootkea.gitlab.io/claws/scan-build/report-addritem.c-addritem_copy_item_folder-6-1.html#EndPath which is clearly a memory leak.

There are many (37 memory leaks, 58 use-after-free etc.) like these in the scan-build report[1]. One can select by type of bugs if they want.

I don't think marking this bug report as "Resolved" is apt.

Thanks!

[0] https://clang-analyzer.llvm.org/scan-build.html
[1] https://rootkea.gitlab.io/claws/scan-build/

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