Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828580 - sys-devel/gcc-11.2.1_p20211127 - /.../sched.h: error: attempt to use poisoned calloc
Summary: sys-devel/gcc-11.2.1_p20211127 - /.../sched.h: error: attempt to use poisoned...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo musl team
URL: https://gcc.gnu.org/bugzilla/show_bug...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: gcc-11
  Show dependency tree
 
Reported: 2021-12-08 19:17 UTC by Toralf Förster
Modified: 2022-12-10 00:39 UTC (History)
2 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,14.79 KB, text/plain)
2021-12-08 19:17 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,3.03 KB, text/plain)
2021-12-08 19:17 UTC, Toralf Förster
Details
environment (environment,128.08 KB, text/plain)
2021-12-08 19:17 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,16.42 KB, application/x-bzip)
2021-12-08 19:17 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,152.95 KB, application/x-bzip)
2021-12-08 19:17 UTC, Toralf Förster
Details
sys-devel:gcc-11.2.1_p20211127:20211208-184218.log.bz2 (sys-devel:gcc-11.2.1_p20211127:20211208-184218.log.bz2,100.88 KB, application/x-bzip)
2021-12-08 19:17 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,133.44 KB, application/x-bzip)
2021-12-08 19:17 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2021-12-08 19:17:15 UTC
too long lines were shrinked:

/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./prev-gcc/xg++ -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./prev-gcc/ -B/usr/x86_64-gentoo-linux-musl/bin/ -nostdinc++ -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/prev-x86_64-gentoo-linux-musl/libstdc++-v3
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./prev-gcc/xg++ -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./prev-gcc/ -B/usr/x86_64-gentoo-linux-musl/bin/ -nostdinc++ -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/prev-x86_64-gentoo-linux-musl/libstdc++-v3
In file included from /usr/include/pthread.h:30,
                 from /var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/gcc/jit/libgccjit.c:27:
/usr/include/sched.h:84:7: error: attempt to use poisoned "calloc"
   84 | void *calloc(size_t, size_t);
      |       ^
/usr/include/sched.h:124:36: error: attempt to use poisoned "calloc"
  124 | #define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_musl-j4-20211208-192535

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-gentoo-linux-musl-11.2.0 *
Python 3.9.9
php cli:

  HEAD of ::gentoo
commit 592dbbb9b953d4b08cb4eac4e5b8fb5e15f3eac9
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Wed Dec 8 18:21:43 2021 +0000

    2021-12-08 18:21:42 UTC

emerge -qpvO sys-devel/gcc
[ebuild     U ] sys-devel/gcc-11.2.1_p20211127 [11.2.0] USE="(cxx) fortran jit* nptl openmp pch (pie) ssp (-ada) (-cet) -custom-cflags -d -debug -doc (-fixed-point) -go -graphite (-hardened) (-libssp) -lto (-multilib) (-nls) -objc -objc++ -objc-gc -pgo (-sanitize) -systemtap -test (-valgrind) -vanilla (-vtv) -zstd"
Comment 1 Toralf Förster gentoo-dev 2021-12-08 19:17:16 UTC
Created attachment 757760 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2021-12-08 19:17:17 UTC
Created attachment 757761 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2021-12-08 19:17:19 UTC
Created attachment 757762 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2021-12-08 19:17:20 UTC
Created attachment 757763 [details]
etc.portage.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2021-12-08 19:17:21 UTC
Created attachment 757764 [details]
logs.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2021-12-08 19:17:23 UTC
Created attachment 757765 [details]
sys-devel:gcc-11.2.1_p20211127:20211208-184218.log.bz2
Comment 7 Toralf Förster gentoo-dev 2021-12-08 19:17:24 UTC
Created attachment 757766 [details]
temp.tar.bz2
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-28 03:57:31 UTC
Alpine have https://git.alpinelinux.org/aports/tree/main/gcc/0039-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch which seems likely to fix this.

Can you try it, toralf?
Comment 9 Toralf Förster gentoo-dev 2021-12-28 12:35:39 UTC
(In reply to Sam James from comment #8)
> Alpine have
> https://git.alpinelinux.org/aports/tree/main/gcc/0039-Fix-attempt-to-use-
> poisoned-calloc-error-in-libgccji.patch which seems likely to fix this.
> 
> Can you try it, toralf?

yep - solved with that patch.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-14 20:31:55 UTC
Can throw the patch in for musl but would like to know why it doesn't happen on glibc first.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-07 01:59:41 UTC
I don't think we should wait on this given it's musl-only and only with USE=jit and this version fixes a bunch of regressions on current stable.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-16 06:23:36 UTC
This was discussed in #musl recently and musl is open to a change (somehow avoiding dragging in malloc and string functions in sched.h). Apparently breaks openldap too?
Comment 13 Toralf Förster gentoo-dev 2022-04-17 20:18:19 UTC
(In reply to Sam James from comment #12)
> Apparently breaks openldap too?

No, AFAICT.
Comment 14 Larry the Git Cow gentoo-dev 2022-04-25 01:00:23 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c90828f2e23881d4c4de20006740b0872461431

commit 6c90828f2e23881d4c4de20006740b0872461431
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-25 00:58:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-25 01:00:07 +0000

    sys-devel/gcc: add musl patch for USE=jit to 12
    
    Bug: https://bugs.gentoo.org/828580
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                      | 2 +-
 sys-devel/gcc/gcc-12.0.0_pre9999.ebuild     | 2 +-
 sys-devel/gcc/gcc-12.0.1_pre20220424.ebuild | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Comment 15 Larry the Git Cow gentoo-dev 2022-04-25 01:11:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3882af68d598fb126b3f40c7ef4f0ba3cd8eff9f

commit 3882af68d598fb126b3f40c7ef4f0ba3cd8eff9f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-25 01:11:08 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-25 01:11:23 +0000

    sys-devel/gcc: update musl calloc patch for 12
    
    Bug: https://bugs.gentoo.org/828580
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                      | 2 +-
 sys-devel/gcc/gcc-12.0.0_pre9999.ebuild     | 2 +-
 sys-devel/gcc/gcc-12.0.1_pre20220424.ebuild | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Comment 16 Larry the Git Cow gentoo-dev 2022-04-25 01:12:13 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e1b2fe74f2926ecc663804531227937a90315a80

commit e1b2fe74f2926ecc663804531227937a90315a80
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-25 01:10:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-25 01:12:06 +0000

    12.0.0: update calloc patch (again)
    
    Bug: https://bugs.gentoo.org/828580
    Signed-off-by: Sam James <sam@gentoo.org>

 12.0.0/musl/50_all_calloc_libgccjit.patch | 12 ++++++------
 12.0.0/musl/README.history                |  8 ++++++++
 2 files changed, 14 insertions(+), 6 deletions(-)

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e5cf99cfba2cb9de2d80a2823220b256445d033d

commit e5cf99cfba2cb9de2d80a2823220b256445d033d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-25 00:51:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-25 01:12:06 +0000

    12.0.0: add musl calloc patch
    
    Bug: https://bugs.gentoo.org/828580
    Signed-off-by: Sam James <sam@gentoo.org>

 12.0.0/musl/50_all_calloc_libgccjit.patch | 68 +++++++++++++++++++++++++++++++
 12.0.0/musl/README.history                | 14 +++++++
 2 files changed, 82 insertions(+)
Comment 17 Larry the Git Cow gentoo-dev 2022-04-25 02:37:22 UTC
The bug has been referenced in the following commit(s):

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

commit c2d1d12d07647cd5ce511c60d8446a9cec41ec86
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-25 02:36:53 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-25 02:36:53 +0000

    sys-devel/gcc: update calloc patch (again again)
    
    Bug: https://bugs.gentoo.org/828580
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                      | 2 +-
 sys-devel/gcc/gcc-12.0.0_pre9999.ebuild     | 2 +-
 sys-devel/gcc/gcc-12.0.1_pre20220424.ebuild | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Comment 18 Larry the Git Cow gentoo-dev 2022-04-25 02:41:20 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e0567416b1eb9ca23636be56d9b017e671881269

commit e0567416b1eb9ca23636be56d9b017e671881269
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-25 02:35:02 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-25 02:35:02 +0000

    12.0.0: update calloc patch (again again)
    
    Bug: https://bugs.gentoo.org/828580
    Signed-off-by: Sam James <sam@gentoo.org>

 12.0.0/musl/50_all_calloc_libgccjit.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Comment 19 Larry the Git Cow gentoo-dev 2022-08-11 09:00:48 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=db34375a2a99b865f51349eba2c8c0293f12b953

commit db34375a2a99b865f51349eba2c8c0293f12b953
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-08-11 08:59:45 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-08-11 09:00:41 +0000

    11.4.0: add 50_all_calloc_libgccjit
    
    I could've sworn we added this for 11.x too,
    but apparently I never did for 12.x.
    
    Bug: https://bugs.gentoo.org/828580
    Bug: https://bugs.gentoo.org/851555
    Signed-off-by: Sam James <sam@gentoo.org>

 11.4.0/musl/50_all_calloc_libgccjit.patch | 72 +++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)