Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 894670

Summary: x11-libs/cairo: trying to free unallocated object
Product: Gentoo Linux Reporter: Jocelyn Mayer <l_indien>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED UPSTREAM    
Severity: normal CC: l_indien
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://gitlab.freedesktop.org/cairo/cairo/-/issues/645
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/465
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log for x11-libs/cairo-1.17.6 without patch
Patch to avoid freeing non allocated object

Description Jocelyn Mayer 2023-02-16 03:51:55 UTC
while compiling x11-libs/cairo, currently version 1.17.6, one would get the following "warning" from the compiler:
cairo-1.17.6/src/cairo-recording-surface.c:259:5:
warning: ‘free’ called on pointer ‘surface_168(D)’ with nonzero offset 432 [-Wfree-nonheap-object]

This would happen only in case of an error in the _cairo_recording_surface_create_bbtree function but seems trivial to fix.

Reproducible: Always

Steps to Reproduce:
1. Build x11-libs/cairo
2. Check the logs for warnings
3.
Actual Results:  
there is a free called on a non allocated object

Expected Results:  
no such a warning !

As the issue seems to be present in the trunk code, a ticket has been opened at the cairo repository with the same proposed patch as the one following:
https://gitlab.freedesktop.org/cairo/cairo/-/issues/645
Comment 1 Jocelyn Mayer 2023-02-16 03:54:39 UTC
Created attachment 851500 [details]
build log for x11-libs/cairo-1.17.6 without patch
Comment 2 Jocelyn Mayer 2023-02-16 03:55:07 UTC
Created attachment 851502 [details, diff]
Patch to avoid freeing non allocated object
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-04 05:14:32 UTC
In next release.