Patch 9.22_24-bit-color-f45025a.patch which was added in r4 ebuild version causes segfaults Reproducible: Always Steps to Reproduce: Execute something with colors Actual Results: Segfault Expected Results: Draw colors
gdb backtrace please with emerge --info
(gdb) r Starting program: /usr/bin/urxvt [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [Detaching after fork from child process 267326] Program received signal SIGSEGV, Segmentation fault. rxvt_term::lookup_color(unsigned int, rxvt_color*) [clone .part.0] () at screen.C:656 656 if (scr_colors[color] == NULL) { (gdb) bt #0 rxvt_term::lookup_color(unsigned int, rxvt_color*) [clone .part.0] () at screen.C:656 #1 0x0000555555584367 in rxvt_font::clear_rect (this=0x55555db2b3e0, d=..., x=0, y=0, w=8, h=18, color=33554428) at rxvtfont.C:256 #2 0x0000555555584686 in rxvt_font_default::draw (this=0x55555d6b92d0, d=..., x=1567331704, y=0, text=0x7ffff67f5520, len=1, fg=0, bg=73400329) at rxvtfont.C:343 #3 0x0000555555582fd0 in rxvt_term::scr_refresh (this=0x1) at screen.C:2459 #4 0x0000555555586538 in rxvt_term::flush (this=0x55555d6b92d0) at command.C:1006 #5 0x000055555559b78b in ev_invoke_pending () at ./../libev/ev.c:3288 #6 0x00005555555a01b0 in ev_run (flags=0) at ./../libev/ev.c:3688 #7 0x000055555557f3d9 in main (argc=1, argv=0x7fffffffd608) at rxvt.C:38 (gdb) Portage 3.0.9 (python 3.7.9-final-0, default/linux/amd64/17.0/systemd, gcc-10.2.0, glibc-2.32-r2, 5.9.0 x86_64) ================================================================= System uname: Linux-5.9.0-x86_64-Intel-R-_Core-TM-_i7-8565U_CPU_@_1.80GHz-with-debian-bullseye-sid KiB Mem: 16068496 total, 7900804 free KiB Swap: 33554428 total, 33553404 free Timestamp of repository gentoo: Fri, 06 Nov 2020 09:30:01 +0000 Head commit of repository gentoo: 2e7b3fd27db63a931de7e6726d112a646cb91c46 Head commit of repository flatpak-overlay: 85b574e89510f6422e0e5177de99f8893eec6608 sh bash 5.0_p18 ld GNU ld (Gentoo 2.34 p6) 2.34.0 app-shells/bash: 5.0_p18::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.30.3-r1::gentoo dev-lang/python: 2.7.18-r4::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0_rc2::gentoo dev-util/cmake: 3.18.4::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.16.2::gentoo sys-devel/binutils: 2.34-r2::gentoo, 2.35.1::gentoo sys-devel/gcc: 9.3.0-r1::gentoo, 10.2.0-r2::gentoo sys-devel/gcc-config: 2.3.2::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers) sys-libs/glibc: 2.32-r2::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: local location: /usr/portage/local masters: gentoo priority: 0 pentoo location: /var/lib/layman/pentoo masters: gentoo priority: 30 vmware location: /var/lib/layman/vmware masters: gentoo priority: 30 dotnet location: /var/lib/layman/dotnet masters: gentoo priority: 40 go-overlay location: /var/lib/layman/go-overlay masters: gentoo priority: 40 flatpak-overlay location: /var/lib/layman/flatpak-overlay sync-type: git sync-uri: https://github.com/fosero/flatpak-overlay.git masters: gentoo priority: 50 gnuradio location: /var/lib/layman/gnuradio sync-type: laymansync sync-uri: https://github.com/hololeap/gentoo-gnuradio masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE openssl" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -pipe -ftree-vectorize -flto -fuse-linker-plugin -mfpmath=sse" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -pipe -ftree-vectorize -flto -fuse-linker-plugin -mfpmath=sse" DISTDIR="/usr/portage/distfiles" 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="-O2 -march=native -pipe -ftree-vectorize -flto -fuse-linker-plugin -mfpmath=sse" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -march=native -pipe -ftree-vectorize -flto -fuse-linker-plugin -mfpmath=sse" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--sort-common -flto -fuse-linker-plugin" LINGUAS="ru uk ua en" PKGDIR="/usr/portage/packages" 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="/tmp" USE="X aac acl alsa amd64 apparmor bash-completion berkdb blas bluetooth bortli bzip2 caps cli client crypt dbus device-mapper dri drm dts egl emacs expat ffmpeg flac fontconfig fortran gdbm gles gnome-keyring gpg gssapi gstreamer gtk hardened http2 hwaccel iconv inotify introspection iproute2 ipv6 jit jpeg kdenlive kerberos lapack libass libdrm libglvnd libnotify libproxy libsecret libtirpc lto lz4 lzma lzo matroska mp3 multilib ncurses networkmanager nls nptl ogg opengl openmp opus pam pch pcre pgo pic pie plugin-ifdemo png policykit pulseaudio python qt5 readline samba sasl seccomp socks5 split-usr sqlite srt ssl svg system-llvm systemd tcpd theora threads tools truetype udev unicode upnp user-session v4l vaapi vorbis x264 x265 xattr xcb xft xinerama xkb xml xscreensaver zeroconf zlib zsh-completion zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="gpsclock nmea0183 nmea2000 aivdm" INPUT_DEVICES="keyboard libinput" KERNEL="linux" L10N="ru uk ua en en-GB en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF X86 ARM WebAssembly" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" QEMU_SOFTMMU_TARGETS="arm aarch64 x86_64" QEMU_USER_TARGETS="arm aarch64 x86_64" RUBY_TARGETS="ruby26 runy27" USERLAND="GNU" VIDEO_CARDS="intel i965 iris" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
1. Could you provide a minimal example that triggers the segfault? 2. Have you actually enabled USE=24-bit-color or not? Come to think of it, please show us your whole 'equery u x11-terms/rxvt-unicode'
1. #!/bin/sh xxd -r -p << __EOF__ 1b5b303b33383b353b3235323b34306d5b1b5b303b33383b353b34363b34 306d4e1b5b303b34306d1b5b303b33383b353b3235323b34306d5d1b5b30 3b34306d201b5b303b33383b353b3235323b34306d616363742d67726f75 701b5b303b33383b353b3235323b34306d2f1b5b303b313b33383b353b32 35333b34306d616272741b5b303b34306d201b5b303b33383b353b323532 3b34306d281b5b303b34306d1b5b303b33383b353b34363b34306d301b5b 303b34306d1b5b303b33383b353b3235323b34306d293a20412067726f75 7020666f7220746865206175746f6d617469632062756720646574656374 696f6e20616e64207265706f7274696e6720746f6f6c1b5b303b34306d1b 5b306d0a __EOF__ 2. It doesn't matter - crashes in any case [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for x11-terms/rxvt-unicode-9.22-r4: U I + + 24-bit-color : Enable 24-bit color support. Note that this feature is unofficial, may cause visual glitches due to the fact there is no termcap/terminfo definition for rxvt-unicode-24bit yet so it is necessary to use the one for 256 colours, visibly increases memory usage, and might slow urxvt down dramatically when more than six fonts are in use in a terminal instance. + + 256-color : Enable 256 color support - - blink : Enable blinking text - - fading-colors : Enable colors fading when off focus + + font-styles : Enable support for bold and italic fonts - - gdk-pixbuf : Enable transparency support using x11-libs/gdk-pixbuf - - iso14755 : Enable ISO-14755 support + + mousewheel : Enable scrolling via mouse wheel or buttons 4 and 5 + + perl : Enable perl script support. You can still disable this at runtime with -pe "" - - startup-notification : Enable application startup event feedback mechanism + + unicode3 : Use 21 instead of 16 bits to represent unicode characters + + utmp : Enable utmp support + + wtmp : Enable wtmp support + + xft : Build with support for XFT font renderer (x11-libs/libXft) It's very clear something is not okay with that "-= TOTAL_COLORS". What is that TOTAL_COLORS about? Anyway..
Could you try again with -r5, please? Both with and without USE=24-bit-color, turns out there was a bug in the patch used by -r4 which caused 24-colour to be enabled even when configure is called with --disable-24-bit-color.
Tried with both cases (with and without USE flag). Works for me.
Excellent, thanks for having reported this and your help with debugging!