Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 887245 - media-libs/netpbm-10.86.34: invalid free on non-allocated object
Summary: media-libs/netpbm-10.86.34: invalid free on non-allocated object
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Viorel Munteanu
URL:
Whiteboard:
Keywords: PullRequest, UPSTREAM
Depends on:
Blocks:
 
Reported: 2022-12-19 17:01 UTC by Jocelyn Mayer
Modified: 2022-12-24 09:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output from emerge --info =media-libs/netpbm-10.86.34 (emerge-infos-netpbm-10.86.34,23.77 KB, text/plain)
2022-12-19 17:03 UTC, Jocelyn Mayer
Details
Ebuild patch proposal to comment the invalid free call (media-libs_netpbm_netpbm-10.86.34.ebuild.patch,482 bytes, patch)
2022-12-19 17:04 UTC, Jocelyn Mayer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2022-12-19 17:01:38 UTC
while merging netpbm, one can see the following warning:
frame.c:845:5: warning: ‘free’ called on unallocated object ‘tempFrame’ [-Wfree-nonheap-object]
  845 |     free(mf);
which is absolutely relevant as mf comes from a static pool declared at the top of the same file.
An easy patch is to comment this line, which can be done with a sed call during src_prepare

Reproducible: Always

Steps to Reproduce:
1. Emerge netpbm
2. Look for 'free' warning

Actual Results:  
One can see an attempt to free an uncallocated object which is clearly a bug

Expected Results:  
No such warning
Comment 1 Jocelyn Mayer 2022-12-19 17:03:50 UTC
Created attachment 843865 [details]
output from emerge --info =media-libs/netpbm-10.86.34
Comment 2 Jocelyn Mayer 2022-12-19 17:04:45 UTC
Created attachment 843867 [details, diff]
Ebuild patch proposal to comment the invalid free call
Comment 3 Viorel Munteanu gentoo-dev 2022-12-21 07:33:07 UTC
Thank you for the report, I'll look into this.  But why are you compiling 10.86.34?  It has been dropped from the tree on Dec 3rd
Comment 4 Jocelyn Mayer 2022-12-21 08:22:42 UTC
Ooops... Sorry, I do update my server once a month, apart from GLSA, and I always do the portage synchronization on the 1, thus 2 days before this update...
But as I get a daily updated rsync local mirror, I can do more checks with recent versions without actually do the merge (thanks to ebuild tool !)

I can then see the bug still appears with the 10.86.35-r1 version.
I did not check on unstable version (11.0.2-r1)
Comment 5 Viorel Munteanu gentoo-dev 2022-12-21 08:23:57 UTC
I don't upstream fixed it, no changes in that part.  I was just curious.

Thanks!
Comment 6 Larry the Git Cow gentoo-dev 2022-12-24 09:06:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3504e46d15b5aeb1c467debad40ff8f920d6a00f

commit 3504e46d15b5aeb1c467debad40ff8f920d6a00f
Author:     Viorel Munteanu <ceamac@gentoo.org>
AuthorDate: 2022-12-24 08:12:56 +0000
Commit:     Viorel Munteanu <ceamac@gentoo.org>
CommitDate: 2022-12-24 09:03:02 +0000

    media-libs/netpbm: add 11.0.3
    
    Closes: https://bugs.gentoo.org/887245
    Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>

 media-libs/netpbm/Manifest             |   1 +
 media-libs/netpbm/netpbm-11.0.3.ebuild | 262 +++++++++++++++++++++++++++++++++
 2 files changed, 263 insertions(+)