Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670450 - sys-kernel/dracut-048-r1 triggers SEGV when performing dracut-install -m ohci-hcd
Summary: sys-kernel/dracut-048-r1 triggers SEGV when performing dracut-install -m ohci...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Patrick McLean
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-11-06 01:07 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2019-01-21 14:25 UTC (History)
3 users (show)

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 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2018-11-06 01:07:11 UTC
I spotted this in my last dracut build and went investigating:

dracut: *** Including module: kernel-modules ***
/usr/lib/dracut/dracut-init.sh: line 969:  4938 Segmentation fault      $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} ${_optional:+-o} ${_silent:+--silent} -m "$@"
dracut: FAILED:  /usr/lib/dracut/dracut-install -D /var/tmp/dracut.Or2S3w/initramfs --kerneldir /lib/modules/4.19.0-gentoo/ -o -m sr_mod sd_mod scsi_dh ata_piix hid_generic unix ehci-hcd ehci-pci ehci-platform ohci-hcd ohci-pci uhci-hcd xhci-hcd xhci-pci xhci-plat-hcd pinctrl-cherryview

After a bit of whacking, I managed to build a simple reproduction with:

DRACUT_FIRMWARE_PATH="/tmp/testy/firmware" /usr/lib/dracut/dracut-install --verbose --debug -D /tmp/testy --kerneldir /lib/modules/4.19.0-gentoo/ -o -m  ohci-pci

The output of which is:

dracut-install: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
dracut-install: Handle module 'ohci-pci'
dracut-install: dracut_install '/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-pci.ko' '/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-pci.ko'
dracut-install: dracut_install('/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-pci.ko', '/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-pci.ko')
dracut-install: dest dir '/tmp/testy/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host' does not exist
dracut-install: dracut_install('/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host', '/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host')
dracut-install: dest dir '/tmp/testy/lib/modules/4.19.0-gentoo//kernel/drivers/usb' does not exist
dracut-install: dracut_install('/lib/modules/4.19.0-gentoo//kernel/drivers/usb', '/lib/modules/4.19.0-gentoo//kernel/drivers/usb')
dracut-install: dest dir '/tmp/testy/lib/modules/4.19.0-gentoo//kernel/drivers' does not exist
dracut-install: dracut_install('/lib/modules/4.19.0-gentoo//kernel/drivers', '/lib/modules/4.19.0-gentoo//kernel/drivers')
dracut-install: dest dir '/tmp/testy/lib/modules/4.19.0-gentoo//kernel' does not exist
dracut-install: dracut_install('/lib/modules/4.19.0-gentoo//kernel', '/lib/modules/4.19.0-gentoo//kernel')
dracut-install: dest dir '/tmp/testy/lib/modules/4.19.0-gentoo' does not exist
dracut-install: dracut_install('/lib/modules/4.19.0-gentoo', '/lib/modules/4.19.0-gentoo')
dracut-install: dest dir '/tmp/testy/lib/modules' does not exist
dracut-install: dracut_install('/lib/modules', '/lib/modules')
dracut-install: dest dir '/tmp/testy/lib' does not exist
dracut-install: dracut_install('/lib', '/lib')
dracut-install: dracut_install('/lib64', '/lib64')
dracut-install: '/tmp/testy/lib64' already exists
dracut-install: ln -s 'lib64' '/tmp/testy/lib'
dracut-install: mkdir '/tmp/testy/lib/modules'
dracut-install: ERROR: failed to create directory '/tmp/testy/lib/modules'
dracut-install: ERROR: failed to create directory '/tmp/testy/lib/modules/4.19.0-gentoo'
dracut-install: ERROR: failed to create directory '/tmp/testy/lib/modules/4.19.0-gentoo//kernel'
dracut-install: ERROR: failed to create directory '/tmp/testy/lib/modules/4.19.0-gentoo//kernel/drivers'
dracut-install: ERROR: failed to create directory '/tmp/testy/lib/modules/4.19.0-gentoo//kernel/drivers/usb'
dracut-install: ERROR: failed to create directory '/tmp/testy/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host'
dracut-install: dracut_install('/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-hcd.ko', '/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-hcd.ko')
dracut-install: '/tmp/testy/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-hcd.ko' already exists
dracut-install: dracut_install '/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-hcd.ko' '/lib/modules/4.19.0-gentoo//kernel/drivers/usb/host/ohci-hcd.ko' OK
dracut-install: dracut_install('(null)', '(null)')

I can't get a real backtrace yet because I can't figure out how to get dracut to compile with real symbols, CFLAGS get hosed.

This is obviously not useful:

Thread 1 (Thread 0x7ffff7fa7100 (LWP 13789)):
#0  0x000055555555c1d0 in ?? ()
No symbol table info available.
#1  0x000055555555c5e6 in ?? ()
No symbol table info available.
#2  0x0000555555558c99 in ?? ()
No symbol table info available.
#3  0x0000555555559125 in ?? ()
No symbol table info available.
#4  0x000055555555aa4e in ?? ()
No symbol table info available.
#5  0x000055555555acc8 in ?? ()
No symbol table info available.
#6  0x000055555555b2ee in ?? ()
No symbol table info available.
#7  0x0000555555557cf1 in ?? ()
No symbol table info available.
#8  0x00007ffff781940b in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#9  0x0000555555557faa in ?? ()
No symbol table info available.


I suspect the issue is dracut_install calling with null strings .... but I can't begin to explain what causes that.

Portage 2.3.51 (python 3.5.5-final-0, default/linux/amd64/17.0, gcc-8.2.0, glibc-2.27-r6, 4.17.14-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.17.14-gentoo-x86_64-Intel-R-_Core-TM-_i5-2410M_CPU_@_2.30GHz-with-gentoo-2.6
KiB Mem:     8006004 total,    251516 free
KiB Swap:   20478972 total,  18579680 free
Timestamp of repository gentoo: Sun, 04 Nov 2018 15:00:01 +0000
Head commit of repository gentoo: 8881c7c5a9273ffd83d7f2e7276097d6ba1b1ae5
sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p3) 2.31.1
ccache version 3.4.3 [disabled]
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.4.8-r1::gentoo, 3.5.5-r1::gentoo, 3.6.6::gentoo
dev-util/ccache:          3.4.3::gentoo
dev-util/cmake:           3.12.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r1::gentoo
sys-devel/gcc:            6.4.0-r4::gentoo, 8.2.0-r3::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.17::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo


~~

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/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 -pipe -mtune=native -march=native"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--alert y --changed-deps y --changed-use --complete-graph=n --with-bdeps=n --deep --dynamic-deps n --keep-going y --newuse --verbose-conflicts --unordered-display --autounmask n --backtrack=0 --autounmask-write n"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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 -pipe"
FEATURES="assume-digests binpkg-logs cgroup clean-logs compress-build-logs compressdebug config-protect-if-modified distlocks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms sign split-elog split-log splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ember./ http://distfiles.gentoo.org/ "
INSTALL_MASK="/usr/lib/debug/.build-id/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS=" -j3 --load-average=4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS=" --no-compress --delete-delay --delay-updates --fuzzy --temp-dir=/var/tmp/rsync/"
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"
USE="X acl amd64 avx berkdb bzip2 cli crypt cxx dbus dri fortran gdbm iconv ipv6 jpeg jpeg2k libtirpc mmx multilib ncurses netlink2 nls nptl opengl openmp pam pcre png qml qt4 readline seccomp sse sse2 sse4_1 sse4_2 ssl ssse3 tcpd tiff unicode vim-syntax xattr xinerama zlib" ABI_X86="32 64" 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 plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF NVPTX" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" RUBY_TARGETS="ruby23 ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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, LANG, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

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

sys-kernel/dracut-048-r1::gentoo was built with the following:
USE="debug (-selinux)" ABI_X86="(64)"
CFLAGS="-O2 -pipe -mtune=native -march=native -ggdb3"
CXXFLAGS="-O2 -pipe -mtune=native -march=native -ggdb3"
Comment 1 Tiziano Müller (RETIRED) gentoo-dev 2018-11-13 07:23:42 UTC
confirmed and fixed at upstream, v049 contains the fix https://git.kernel.org/pub/scm/boot/dracut/dracut.git/commit/?id=e331e06a3910ef3fe6837f3e93a48123a7cc822b
Comment 2 Akos Szalkai 2019-01-11 14:09:07 UTC
I can confirm that applying this patch only over 048-r1 fixes the issue.  So can at least a 048-r2 be released, if not 049?
Comment 3 Larry the Git Cow gentoo-dev 2019-01-21 14:23:46 UTC
The bug has been referenced in the following commit(s):

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

commit 3a5005c33678f26a1477a49e791f89a8480c523a
Author:     Alexander Tsoy <alexander@tsoy.me>
AuthorDate: 2019-01-11 18:40:03 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2019-01-21 14:23:15 +0000

    sys-kernel/dracut: version bump to 049
    
    Bug: https://bugs.gentoo.org/602122
    Bug: https://bugs.gentoo.org/670450
    Closes: https://github.com/gentoo/gentoo/pull/10808
    Package-Manager: Portage-2.3.51, Repoman-2.3.11
    Signed-off-by: Alexander Tsoy <alexander@tsoy.me>
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-kernel/dracut/Manifest                         |   1 +
 sys-kernel/dracut/dracut-049.ebuild                | 158 +++++++++++++++++++++
 ...etwork-Don-t-include-40network-by-default.patch |  34 +++++
 ...49-remove-bashism-in-various-boot-scripts.patch |  89 ++++++++++++
 4 files changed, 282 insertions(+)