Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 887223 - dev-ruby/psych-5.0.1: undefined method `_native_parse' when remerging
Summary: dev-ruby/psych-5.0.1: undefined method `_native_parse' when remerging
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-19 15:30 UTC by Ethan Steinbrecher
Modified: 2023-07-10 03:42 UTC (History)
2 users (show)

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


Attachments
Build log (build.log,5.29 KB, text/plain)
2022-12-19 15:30 UTC, Ethan Steinbrecher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ethan Steinbrecher 2022-12-19 15:30:17 UTC
Created attachment 843835 [details]
Build log

Portage 3.0.41 (python 3.10.9-final-0, default/linux/amd64/17.1, gcc-12, glibc-2.36-r6, 6.1.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-4700MQ_CPU_@_2.40GHz-with-glibc2.36
KiB Mem:    16250828 total,   9874728 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Mon, 19 Dec 2022 14:15:01 +0000
Head commit of repository gentoo: 1df248184eeae4fa1c8b3557176b540069e91e97
Timestamp of repository guru: Mon, 19 Dec 2022 11:02:08 +0000
Head commit of repository guru: 5d6950084e0a02e64117d69658cc2e74d0470103

Head commit of repository librewolf: 237624eb6f60c604b4f4a552ba0e377fc16851bb

Head commit of repository rockford-overlay: e54f58ad46f56e498f0b8623248871e3d8d314da

Head commit of repository tlp: 4ba9fce0927a4bc87a4df54eb352a163a439810e

sh bash 5.2_p15
ld GNU ld (Gentoo 2.39 p5) 2.39.0
distcc 3.4 x86_64-pc-linux-gnu [disabled]
ccache version 4.7.4 [enabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.2_p15::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.10.9::gentoo, 3.11.1::gentoo
dev-lang/rust:             1.65.0::gentoo
dev-util/ccache:           4.7.4::gentoo
dev-util/cmake:            3.25.1::gentoo
dev-util/meson:            0.64.1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/openrc:           0.45.2-r2::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           15.0.6::gentoo
sys-devel/gcc:             12.2.1_p20221210::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.6::gentoo
sys-devel/llvm:            15.0.6::gentoo
sys-devel/make:            4.4::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync11.us.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

librewolf
    location: /var/db/repos/librewolf
    sync-type: git
    sync-uri: https://gitlab.com/librewolf-community/browser/gentoo.git
    masters: gentoo

rockford-overlay
    location: /var/db/repos/rockford-overlay
    sync-type: git
    sync-uri: https://github.com/RockfordRoe/rockford-overlay.git
    masters: gentoo

tlp
    location: /var/db/repos/tlp
    sync-type: git
    sync-uri: https://github.com/dywisor/tlp-portage
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64 ~x86"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=haswell"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=haswell"
DISTDIR="/var/cache/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 XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -march=haswell"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live ccache 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 -pipe -march=haswell"
GENTOO_MIRRORS="http://mirrors.rit.edu/gentoo/     http://www.gtlib.gatech.edu/pub/gentoo     https://mirrors.rit.edu/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j9"
PKGDIR="/var/cache/binpkgs"
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"
SHELL="/bin/bash"
USE="X acl alsa amd64 av1 bluetooth bzip2 cli crypt cue cups cxx dbus dri egl elogind evdev exif ffmpeg flac fortran fuse gdbm gif gstreamer gtk gtk2 gtk3 gtk4 iconv icu introspection ipv6 iwd jack jpeg kde libglvnd libtirpc libusb libxml2 lv2 lzma matroska mp3 mtp multilib ncurses networkmanager nls nptl ogg openal opengl openh264 openmp openssl opus pam pcre pipewire png policykit polkit pulseaudio python qml qt qt5 readline samba sdl seccomp split-usr ssl static-libs svg test-rust theora tiff tk truetype udev udisks unicode upower usb v4l vaapi vala vorbis vpx vulkan wayland webp x264 x265 xattr zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" 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 rdrand 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" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="luajit" LUA_TARGETS="luajit" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby31" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

dev-ruby/psych-5.0.1::gentoo was built with the following:
USE="test -doc" ABI_X86="(64)" RUBY_TARGETS="ruby31 -ruby27 -ruby30"
Comment 1 Ivan J. 2022-12-28 11:55:47 UTC
Can confirm this also happens to me with ruby31.
Comment 2 Ivan J. 2022-12-28 12:01:49 UTC
Also breaks compilation of (at least):

dev-ruby/bundler-2.4.1
dev-ruby/did_you_mean-1.6.3
net-libs/webkit-gtk-2.38.3-r500
net-libs/webkit-gtk-2.38.3
Comment 3 Ethan Steinbrecher 2023-01-08 01:38:45 UTC
Downgrading to 4.0.6 seems to fix this issue as a workaround. Maybe flag =dev-ruby/psych-5.0.1?
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-08 01:44:54 UTC
Huh, is it using the system version of psych and mixing it at install-time?
Comment 5 Ethan Steinbrecher 2023-01-08 02:31:00 UTC
(In reply to Sam James from comment #4)
> Huh, is it using the system version of psych and mixing it at install-time?

It seems so. I also had issues downgrading it with it throwing that error. I uninstalled it completely, and installed 4.0.6, and nothing gives me that error anymore.
Comment 6 Hans de Graaff gentoo-dev Security 2023-01-08 11:04:14 UTC
I can't seem to reproduce this so we'll need to figure out what additional conditions are needed to reproduce it.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-25 07:58:03 UTC
Someone hit this on the forums too at https://forums.gentoo.org/viewtopic-t-1162395.html.

I think it's definitely related to bug 835405.
Comment 8 OKUMURA N. Shin-ya 2023-03-26 05:18:49 UTC
I have met a similar incident, with;
=dev-lang/ruby-3.1.3
=dev-lang/ruby-3.2.1
=dev-ruby/psych-5.1.0
=dev-ruby/bundler-2.4.6

I found a workaround (but unknown reason) as follows;

1. make.conf :
  RUBY_TARGETS="ruby32" (only, without any other version)
  USE=-doc
2. and successfully emerged
dev-lang/ruby-3.2.1
dev-ruby/bundler-2.4.6
dev-ruby/date-3.3.3
dev-ruby/debug-1.7.1
dev-ruby/did_you_mean-1.6.3
dev-ruby/forwardable-1.3.3
dev-ruby/json-2.6.3
dev-ruby/kpeg-1.3.3
dev-ruby/matrix-0.4.2
dev-ruby/minitest-5.18.0
dev-ruby/net-ftp-0.2.0
dev-ruby/net-imap-0.3.4
dev-ruby/net-pop-0.1.2
dev-ruby/net-protocol-0.2.1
dev-ruby/net-smtp-0.3.3
dev-ruby/power_assert-2.0.3
dev-ruby/prime-0.1.2-r1
dev-ruby/psych-5.1.0
dev-ruby/racc-1.6.2
dev-ruby/rake-13.0.6-r1
dev-ruby/rbs-3.0.4
dev-ruby/rdoc-6.5.0
dev-ruby/rexml-3.2.5-r1
dev-ruby/rss-0.2.9-r1
dev-ruby/rubygems-3.4.6
dev-ruby/singleton-0.1.1
dev-ruby/stringio-3.0.5
dev-ruby/test-unit-3.5.7
dev-ruby/time-0.2.1
dev-ruby/timeout-0.3.2
dev-ruby/typeprof-0.21.7
virtual/ruby-ssl-13
virtual/rubygems-18
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-02 03:44:23 UTC
(In reply to Sam James from comment #7)
> Someone hit this on the forums too at
> https://forums.gentoo.org/viewtopic-t-1162395.html.
> 
> I think it's definitely related to bug 835405.

I suspect this was fixed by https://bugs.gentoo.org/835405#c5.
Comment 10 Willem Jan Palenstijn 2023-07-09 19:32:34 UTC
I still get this with current ruby 3.1.4-r3, psych-5.1.0.

It's not just re-emerging psych that's failing; even just using psych from ruby doesn't work. E.g., this small ruby script fails with the same error message:

gem 'psych'
require 'psych'
Psych.safe_load('--- foo')


After doing some digging into what's happening at runtime on my system, it seems the problem is that libruby31.so contains the visible symbol Init_psych_parser. This is part of the built-in psych 4.0.4 in ruby 3.1.4.

The init function Init_psych of the extension module for psych-5.1.0 ends up calling the Init_psych_parser from libruby31 instead of the function Init_psych_parser from psych-5.1.0's psych.so. This mixing of symbols for psych 4.0.4 and psych 5.1.0 is clearly unintended and this means specifically the class Psych::Parser isn't initialized properly, which in turn causes this undefined method _native_parse.

For comparison I've looked at the ruby:31 docker image. The libruby.so there doesn't have these conflicting symbols. As far as I can tell the difference is due to gentoo configuring ruby with --with-static-linked-ext when the static-libs USE flag is enabled (which it is on my system).

Disabling static-libs for dev-lang/ruby works around the problem.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-10 03:42:35 UTC
(In reply to Willem Jan Palenstijn from comment #10)
> I still get this with current ruby 3.1.4-r3, psych-5.1.0.
>
> [...]

Thank you for the analysis! See also bug 891367.