Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 894670 - x11-libs/cairo: trying to free unallocated object
Summary: x11-libs/cairo: trying to free unallocated object
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-02-16 03:51 UTC by Jocelyn Mayer
Modified: 2023-03-04 05:14 UTC (History)
1 user (show)

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


Attachments
build log for x11-libs/cairo-1.17.6 without patch (cairo-1.17.6:20230205-145751.log,271.79 KB, text/x-log)
2023-02-16 03:54 UTC, Jocelyn Mayer
Details
Patch to avoid freeing non allocated object (cairo-1.17.6-invalid_free.patch,372 bytes, patch)
2023-02-16 03:55 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 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.