tools/build/Makefile.build dir=./arch/x86 obj=objtool awk -f ../arch/x86/tools/gen-insn-attr-x86.awk ../arch/x86/lib/x86-opcode-map.txt > ..../build/kernbuild/tools/objtool/arch/x86/lib/inat-tables.c free(): double free detected in tcache 2 awk -f arch/x86/tools/gen-insn-attr-x86.awk arch/x86/lib/x86-opcode-map.txt /* x86 opcode map generated from x86-opcode-map.txt */ /* Do not change this code. */ /* Table: one byte opcode */ free(): double free detected in tcache 2 Aborted (core dumped) Works fine with gawk-5.1.1-r2.ebuild
Please paste emerge --info and the full build.log (compressed if too big) and reopen.
Thanks to OP, from $ /var/tmp/portage/sys-apps/gawk-5.2.0/work/gawk-5.2.0/gawk -f /usr/src/linux-5.18.19-gentoo-r1/arch/x86/tools/gen-insn-attr-x86.awk /usr/src/linux-5.18.19-gentoo-r1/arch/x86/lib/x86-opcode-map.txt /* x86 opcode map generated from x86-opcode-map.txt */ /* Do not change this code. */ /* Table: one byte opcode */ free(): double free detected in tcache 2 Aborted (core dumped) ...I've reduced it to the following: $ awk 'function add_flags(old) { if (old) return 0 if (!old) return 1 } BEGIN { a[0]=add_flags(a[0]) }' free(): double free detected in tcache 2 Aborted (core dumped) ... executing: 'bt -full -frame-info source-and-location -past-entry on -entry-values both -frame-arguments all -past-main on' ... #9 0x000059ea61562f86 in unref (r=<optimized out>) at /var/tmp/portage/sys-apps/gawk-5.2.0/work/gawk-5.2.0/awk.h:1986 0x59ea61562f86 is in r_interpret (/var/tmp/portage/sys-apps/gawk-5.2.0/work/gawk-5.2.0/awk.h:1986). 1981 static inline void 1982 unref(NODE *r) 1983 { 1984 assert(r == NULL || r->valref > 0); 1985 if (r != NULL && --r->valref <= 0) 1986 r_unref(r); // THIS LINE 1987 } 1988 1989 /* force_number --- force a node to have a numeric value */ 1990 #10 r_interpret (code=<optimized out>) at /var/tmp/portage/sys-apps/gawk-5.2.0/work/gawk-5.2.0/interpret.h:865 //0x59ea61562f86 is in r_interpret (/var/tmp/portage/sys-apps/gawk-5.2.0/work/gawk-5.2.0/awk.h:1986). //1981 static inline void //1982 unref(NODE *r) //1983 { //1984 assert(r == NULL || r->valref > 0); //1985 if (r != NULL && --r->valref <= 0) //1986 r_unref(r); //1987 } //1988 //1989 /* force_number --- force a node to have a numeric value */ //1990 ^ that is bad gdb, it's this instead (interpret.h:865): case Op_assign: lhs = POP_ADDRESS(); r = TOP_SCALAR(); unref(*lhs); //THIS LINE is interpret.h:865 if (r->type == Node_elem_new) { DEREF(r); r = dupnode(Nnull_string); } UPREF(r); #11 0x000059ea61525533 in main (argc=<optimized out>, argv=<optimized out>) at main.c:552 0x59ea61525533 is in main (main.c:552). 547 if (do_debug) 548 debug_prog(code_block); 549 else if (do_pretty_print && ! do_profile) 550 ; /* run pretty printer only. */ 551 else 552 interpret(code_block); // THIS LINE 553 554 if (do_pretty_print) { 555 set_current_namespace(awk_namespace); 556 dump_prog(code_block);
*** Bug 868597 has been marked as a duplicate of this bug. ***
Please include emerge --info for completeness
reported upstream (sort of): https://lists.gnu.org/archive/html/bug-gawk/2022-09/msg00006.html As requested: $ emerge --info Portage 3.0.35 (python 3.10.6-final-0, default/linux/amd64/17.1, gcc-12.2.0, glibc-2.35-r8, 5.18.16-gentoo-x86_64 x86_64) ================================================================= System uname: Linux-5.18.16-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i7-8700K_CPU_@_3.70GHz-with-glibc2.35 KiB Mem: 64057152 total, 31107176 free KiB Swap: 100663292 total, 100663292 free Timestamp of repository gentoo: Mon, 05 Sep 2022 10:30:01 +0000 Head commit of repository gentoo: 037b54872972f77b1ee67a826b333742e38d365e sh bash 9999 ld GNU ld (Gentoo 2.38 p4) 2.38 ccache version 4.6.3 [enabled] app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 9999::localrepo dev-lang/perl: 5.36.0::gentoo dev-lang/python: 3.9.13_p6::gentoo, 3.10.6_p4::gentoo, 3.11.0_rc1_p2::gentoo dev-lang/rust: 1.62.1::localrepo dev-util/ccache: 4.6.3::gentoo dev-util/cmake: 3.24.1::gentoo dev-util/meson: 0.63.2::gentoo sys-apps/baselayout: 2.8-r2::gentoo sys-apps/openrc: 0.45.2::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.13-r2::gentoo, 2.71-r1::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.38-r2::gentoo, 2.39-r1::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/clang: 14.0.6-r1::gentoo sys-devel/gcc: 12.2.0::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/lld: 14.0.6::gentoo sys-devel/llvm: 14.0.6-r2::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.19::gentoo (virtual/os-headers) sys-libs/glibc: 2.35-r8::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: 5000 sync-rsync-extra-opts: sync-rsync-verify-max-age: 2 sync-rsync-verify-metamanifest: yes sync-rsync-vcs-ignore: false sync-rsync-verify-jobs: 0 localrepo location: /var/db/repos/localrepo masters: gentoo priority: 6000 Binary Repositories: var-cache-binpkgs--local-binhost priority: 5000 sync-uri: file:///var/cache/binpkgs ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE android" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=skylake -mtune=skylake -mprefer-vector-width=128 -O2 -pipe -frecord-gcc-switches -ggdb -fvar-tracking-assignments -fno-omit-frame-pointer -ftrack-macro-expansion=2 -fstack-protector-all -Wno-trigraphs -fno-schedule-insns2 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -rdynamic -flifetime-dse=1" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=skylake -mtune=skylake -mprefer-vector-width=128 -O2 -pipe -frecord-gcc-switches -ggdb -fvar-tracking-assignments -fno-omit-frame-pointer -ftrack-macro-expansion=2 -fstack-protector-all -Wno-trigraphs -fno-schedule-insns2 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -rdynamic -flifetime-dse=1" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS=" --jobs=4 --load-average=4 --keep-going=n --usepkg=y --ask --ask-enter-invalid --autounmask-use=y --binpkg-changed-deps=y --tree --deep --nospinner --backtrack=300 --with-bdeps=y --forceWKDupdate n --jobs=12 --load-average=12" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-march=skylake -mtune=skylake -mprefer-vector-width=128 -O2 -pipe -frecord-gcc-switches -ggdb -fvar-tracking-assignments -fno-omit-frame-pointer -ftrack-macro-expansion=2 -fstack-protector-all -Wno-trigraphs -fno-schedule-insns2 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -rdynamic -flifetime-dse=1" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live buildsyspkg ccache cgroup config-protect-if-modified distlocks downgrade-backup ebuild-locks fakeroot fixlafiles force-mirror getbinpkg installsources ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox prelink-checksums preserve-libs qa-unresolved-soname-deps sandbox sfperms skiprocheck split-elog split-log splitdebug strict suidctl unknown-features-warn unmerge-logs userpriv usersandbox" FFLAGS="-march=skylake -mtune=skylake -mprefer-vector-width=128 -O2 -pipe -frecord-gcc-switches -ggdb -fvar-tracking-assignments -fno-omit-frame-pointer -ftrack-macro-expansion=2 -fstack-protector-all -Wno-trigraphs -fno-schedule-insns2 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -rdynamic -flifetime-dse=1" GENTOO_MIRRORS="https://mirror.dkm.cz/gentoo/ https://ftp.fau.de/gentoo https://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ https://gentoo.wheel.sk/ https://gentoo.osuosl.org/ https://mirror.ps.kz/gentoo/pub/ https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ https://ftp.halifax.rwth-aachen.de/gentoo/ https://ftp.halifax.rwth-aachen.de/gentoo/distfiles/ https://distfiles.gentoo.org" INSTALL_MASK="/lib/systemd /lib32/systemd /lib64/systemd /usr/lib/systemd /usr/lib32/systemd /usr/lib64/systemd /etc/systemd" LANG="en_US.utf8" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro" MAKEOPTS="--no-keep-going --output-sync=target -j18" PKGDIR="/var/cache/binpkgs" PORTAGE_BINHOST="" PORTAGE_COMPRESS="" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" RUSTFLAGS="-C target-cpu=skylake " SHELL="/bin/bash" USE="X acl aes amd64 avx avx2 bindist btrfs bzip2 ccache cli cscope dbus dri elogind extensions f16c ffmpeg fma3 gdbm git gpg gpm gtk3 iconv jpeg libglvnd libtirpc lm_sensors lock mmx mmxext mosh-hardening multilib ncurses nptl ogg openmp opus pam pclmul pcre pie png policykit popcnt pulseaudio qt5 readline rsync-verify seccomp session smp source-highlight split-usr sse sse2 sse3 sse4_1 sse4_2 ssl ssp ssse3 startup-notification strong-security unicode verify-sig xcomposite zlib" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10 python3_9" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Thanks. Downgrading gawk fixed it for me too.
sys-kernel/gentoo-kernel and sys-kernel/vanilla-kernel do fail too with this gawk
*** Bug 868627 has been marked as a duplicate of this bug. ***
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=233094e62dbb2068cfc54b6e7ab55b59aba77601 commit 233094e62dbb2068cfc54b6e7ab55b59aba77601 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2022-09-05 20:26:37 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2022-09-05 20:27:36 +0000 profiles: mask sys-apps/gawk-5.2.0 Bug: https://bugs.gentoo.org/868567 Signed-off-by: Mike Gilbert <floppym@gentoo.org> profiles/package.mask | 5 +++++ 1 file changed, 5 insertions(+)
Created attachment 803497 [details, diff] UPREF patch for double free detected in tcache 2 Wouldn't it be better to apply this small patch instead of masking it? Source of the patch: https://mail.gnu.org/archive/html/bug-gawk/2022-09/msg00011.html cheers.
(In reply to zappel from comment #10) > Created attachment 803497 [details, diff] [details, diff] > UPREF patch for double free detected in tcache 2 > > Wouldn't it be better to apply this small patch instead of masking it? > For such a critical piece of software, I'd like to see upstream comment on the patch first. The downside of masking it is pretty much nonexistent anyway.
(In reply to Sam James from comment #11) > (In reply to zappel from comment #10) > > Created attachment 803497 [details, diff] [details, diff] [details, diff] > > UPREF patch for double free detected in tcache 2 > > > > Wouldn't it be better to apply this small patch instead of masking it? > > > > For such a critical piece of software, I'd like to see upstream comment on > the patch first. The downside of masking it is pretty much nonexistent > anyway. Well, you're right. Thanks for clarification/explanation.
No worries and it was a fair question :)
After trying the patch for perf (see #868522) I decided to also try a kernel build. This was successful: I just built the "all" target (vmlinux, modules, bzImage) for my BTF-enabled config without issue. Looks like the patch works.
I decided to take a peek and see what happened here in the meantime. Apparently the attached patch helped, but not completely; it was applied but later reverted: https://mail.gnu.org/archive/html/bug-gawk/2022-09/msg00056.html Commit with lots of other stuff (changelog, tests etc.): https://git.savannah.gnu.org/cgit/gawk.git/commit/?id=2848045aed5ccfd7b582808288f7fcc18d319952 That patch turned out to need another one: https://git.savannah.gnu.org/cgit/gawk.git/commit/?id=3d7178e78e523574649578593192bab2e0d08a2a Decided to put those to the test..and with the original patch removed and those two applied, gawk again fails to build perf (#868522). :-( Seems like this will stay masked for a while.
(In reply to Holger Hoffstätte from comment #15) > I decided to take a peek and see what happened here in the meantime. > > Apparently the attached patch helped, but not completely; it was applied but > later reverted: > > https://mail.gnu.org/archive/html/bug-gawk/2022-09/msg00056.html > > Commit with lots of other stuff (changelog, tests etc.): > https://git.savannah.gnu.org/cgit/gawk.git/commit/ > ?id=2848045aed5ccfd7b582808288f7fcc18d319952 > > That patch turned out to need another one: > https://git.savannah.gnu.org/cgit/gawk.git/commit/ > ?id=3d7178e78e523574649578593192bab2e0d08a2a > > Decided to put those to the test..and with the original patch removed and > those two applied, gawk again fails to build perf (#868522). :-( > > Seems like this will stay masked for a while. Thanks for the update, I've been following on the ML and was considering posting something here for the people who wonder why we don't just apply it. But I hadn't tried any of the patches... oh dear! Maybe mention it on bug-gawk?
(In reply to Holger Hoffstätte from comment #15) > Decided to put those to the test..and with the original patch removed and > those two applied, gawk again fails to build perf (#868522). :-( Apologies - this turned out to be a pilot error: both patches together seem to work and both kernel & perf build without issue. So it looks like 5.2.1 will be fine.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a4f6d6186f18d1ff2a1a7a6c508c5fb2fc4fbd1 commit 1a4f6d6186f18d1ff2a1a7a6c508c5fb2fc4fbd1 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-15 10:47:55 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-15 10:47:55 +0000 sys-apps/gawk: add 5.2.1_beta (unkeyworded) Please test and report bugs upstream to bug-gawk if you find any problems. Bug: https://bugs.gentoo.org/868567 Bug: https://bugs.gentoo.org/868522 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/gawk/Manifest | 1 + sys-apps/gawk/gawk-5.2.1_beta.ebuild | 131 +++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad0c972c895767e1432cfcc3d0d1a8d380eafbea commit ad0c972c895767e1432cfcc3d0d1a8d380eafbea Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-22 18:27:59 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-22 18:28:11 +0000 sys-apps/gawk: add 5.2.1, drop 5.2.1_beta Closes: https://bugs.gentoo.org/830705 Closes: https://bugs.gentoo.org/868522 Closes: https://bugs.gentoo.org/868567 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/gawk/Manifest | 3 ++- sys-apps/gawk/{gawk-5.2.1_beta.ebuild => gawk-5.2.1.ebuild} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)