Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 563052 - >=x11-libs/gdk-pixbuf-2.32.1: uses implementation specific __libc_malloc() and friends
Summary: >=x11-libs/gdk-pixbuf-2.32.1: uses implementation specific __libc_malloc() an...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords:
Depends on:
Blocks: CVE-2015-7674 CVE-2015-7673
  Show dependency tree
 
Reported: 2015-10-14 11:37 UTC by Anthony Basile
Modified: 2019-10-28 00:31 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2015-10-14 11:37:05 UTC
tests/pixbuf-lowmem.c makes calls to __libc_malloc() __libc_realloc() and __libc_free().  These are glibc specific functions and should never be used.  Since this is in tests, one solution is to just edit the top level Makefile.am and remove SUBDIRS = tests.  A better solution would be to shield the tests subdir in an if driven by AC_ARG_ENABLE([tests],...).  The best solution would be to replace __libc_malloc() and friends with their proper POSIX versions.

I'll take care of this upstream, but its causing me lots of problems with uclibc and musl right now, and since 2.30.8-r2 will probably be dropped as soon as the current version is stabilized on all arches, I'd like to get a solution in the tree soon even if its just ~arch.  I'll get the proper fix upstream.

Reproducible: Always
Comment 2 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-14 12:30:57 UTC
If so, please feel free to add the patch to the ebuild.

(And __libc_malloc() and friends cannot be replaced with their posix versions since the purpose of the test is to override the malloc symbol with custom code to test that gdk-pixbuf correctly handles out-of-memory situations.)
Comment 3 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-14 12:47:43 UTC
Patch added.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91c97a5dae6ab5ca1fead8aacba2c5e058f38212

commit 91c97a5dae6ab5ca1fead8aacba2c5e058f38212
Author: Alexandre Rostovtsev <tetromino@gentoo.org>
Date:   Wed Oct 14 08:39:32 2015 -0400

    x11-libs/gdk-pixbuf: run glibc-specific test only on glibc
    
    Gentoo-Bug: 563052
    Reported-by: Anthony Basile
Comment 4 Anthony Basile gentoo-dev 2015-10-14 15:40:38 UTC
(In reply to Alexandre Rostovtsev from comment #3)
> Patch added.
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=91c97a5dae6ab5ca1fead8aacba2c5e058f38212
> 
> commit 91c97a5dae6ab5ca1fead8aacba2c5e058f38212
> Author: Alexandre Rostovtsev <tetromino@gentoo.org>
> Date:   Wed Oct 14 08:39:32 2015 -0400
> 
>     x11-libs/gdk-pixbuf: run glibc-specific test only on glibc
>     
>     Gentoo-Bug: 563052
>     Reported-by: Anthony Basile

this should work for musl but not uclibc because uclibc defines __GLIBC__.  The line

#ifdef __GLIBC__

should be

#if defined(__GLIBC__) && !defined(__UCLIBC__)

Let me test first and then I'll make the fix if its okay with you.
Comment 5 Anthony Basile gentoo-dev 2015-10-14 20:02:28 UTC
(In reply to Anthony Basile from comment #4)
> (In reply to Alexandre Rostovtsev from comment #3)
> > Patch added.
> > 
> > https://gitweb.gentoo.org/repo/gentoo.git/commit/
> > ?id=91c97a5dae6ab5ca1fead8aacba2c5e058f38212
> > 
> > commit 91c97a5dae6ab5ca1fead8aacba2c5e058f38212
> > Author: Alexandre Rostovtsev <tetromino@gentoo.org>
> > Date:   Wed Oct 14 08:39:32 2015 -0400
> > 
> >     x11-libs/gdk-pixbuf: run glibc-specific test only on glibc
> >     
> >     Gentoo-Bug: 563052
> >     Reported-by: Anthony Basile
> 
> this should work for musl but not uclibc because uclibc defines __GLIBC__. 
> The line
> 
> #ifdef __GLIBC__
> 
> should be
> 
> #if defined(__GLIBC__) && !defined(__UCLIBC__)
> 
> Let me test first and then I'll make the fix if its okay with you.

Okay I edited Nathan Copa's patch as above, tested, and it now works on glibc, uclibc and musl.  Copa is the lead for Alpine Linux which uses musl.  It used to use uclibc, so I'm surprised he didn't add that to his patch, but I guess these days he's only concerned with musl.  I'll get that full fix upstream.
Comment 6 Anthony Basile gentoo-dev 2015-10-14 20:34:39 UTC
(In reply to Anthony Basile from comment #5)
> (In reply to Anthony Basile from comment #4)
> > (In reply to Alexandre Rostovtsev from comment #3)
> > > Patch added.
> > > 
> > > https://gitweb.gentoo.org/repo/gentoo.git/commit/
> > > ?id=91c97a5dae6ab5ca1fead8aacba2c5e058f38212
> > > 
> > > commit 91c97a5dae6ab5ca1fead8aacba2c5e058f38212
> > > Author: Alexandre Rostovtsev <tetromino@gentoo.org>
> > > Date:   Wed Oct 14 08:39:32 2015 -0400
> > > 
> > >     x11-libs/gdk-pixbuf: run glibc-specific test only on glibc
> > >     
> > >     Gentoo-Bug: 563052
> > >     Reported-by: Anthony Basile
> > 
> > this should work for musl but not uclibc because uclibc defines __GLIBC__. 
> > The line
> > 
> > #ifdef __GLIBC__
> > 
> > should be
> > 
> > #if defined(__GLIBC__) && !defined(__UCLIBC__)
> > 
> > Let me test first and then I'll make the fix if its okay with you.
> 
> Okay I edited Nathan Copa's patch as above, tested, and it now works on
> glibc, uclibc and musl.  Copa is the lead for Alpine Linux which uses musl. 
> It used to use uclibc, so I'm surprised he didn't add that to his patch, but
> I guess these days he's only concerned with musl.  I'll get that full fix
> upstream.

For the records, the expanded fix to includ both musl and uClibc is upstream now:  https://bugzilla.gnome.org/show_bug.cgi?id=756590
Comment 7 Anthony Basile gentoo-dev 2016-02-25 12:34:58 UTC
gdk-pixbuf was bumped, but gdk-pixbuf-2.32.1-lowmem-test-glibc.patch was not forward ported.  Upstream has not yet applied that patch which introduces some very non-posix functions.  I don't think they care (or fully understand) why they shouldn't use __libc_malloc() and friends.

With 2.32.3 being stabilized this is no breaking on all musl and uclibc systems.  Can we get keep this patch going forward why I try to get upstream to change their minds :)
Comment 8 Anthony Basile gentoo-dev 2016-02-26 00:22:25 UTC
(In reply to Anthony Basile from comment #7)
> gdk-pixbuf was bumped, but gdk-pixbuf-2.32.1-lowmem-test-glibc.patch was not
> forward ported.  Upstream has not yet applied that patch which introduces
> some very non-posix functions.  I don't think they care (or fully
> understand) why they shouldn't use __libc_malloc() and friends.
> 
> With 2.32.3 being stabilized this is no breaking on all musl and uclibc
> systems.  Can we get keep this patch going forward why I try to get upstream
> to change their minds :)


wait, i take that back.  upstream did apply my patch but they made a small change which is incorrect.  i'll prepare a proper fix and push it upstream and add it to 2.32.3.
Comment 9 Pacho Ramos gentoo-dev 2016-02-26 21:34:05 UTC
Thanks for all the investigation :)
Comment 10 Pacho Ramos gentoo-dev 2016-06-25 13:59:07 UTC
Did you finally pushed the updated fix? Thanks
Comment 11 Matt Turner gentoo-dev 2019-10-28 00:31:33 UTC
Won't fix without a patch from someone who cares about uclibc.