Bug 1573018 - dnf segfault at 0 ip 00007ff9ce3864c4 sp 00007ffda6117c18 error 4 in librpmio.so.8.0.1[7ff9ce36a000+2c000]
Summary: dnf segfault at 0 ip 00007ff9ce3864c4 sp 00007ffda6117c18 error 4 in librpmio...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-29 20:09 UTC by Marcel Wysocki
Modified: 2018-08-10 13:03 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-10 12:49:15 UTC
Type: Bug


Attachments (Terms of Use)

Description Marcel Wysocki 2018-04-29 20:09:50 UTC
Description of problem:
dnf segfaults when trying to update systemd packages

Version-Release number of selected component (if applicable):

[root@t470s ~]# rpm -qa|grep dnf
dnf-conf-2.7.5-12.fc28.noarch
dnf-yum-2.7.5-12.fc28.noarch
dnf-2.7.5-12.fc28.noarch
libdnf-0.11.1-3.fc28.x86_64
dnf-plugins-core-2.1.5-4.fc28.noarch
python2-dnf-2.7.5-12.fc28.noarch
python3-dnf-plugins-core-2.1.5-4.fc28.noarch
python3-dnf-2.7.5-12.fc28.noarch
[root@t470s ~]# rpm -qa|grep rpm
fpc-srpm-macros-1.1-4.fc28.noarch
rpm-ostree-libs-2018.4-1.fc28.x86_64
rpmfusion-free-appstream-data-28-2.fc28.noarch
go-srpm-macros-2-16.fc28.noarch
rpmdevtools-8.10-4.fc28.noarch
rpm-debugsource-4.14.1-7.fc28.x86_64
rpm-libs-4.14.1-7.fc28.x86_64
openblas-srpm-macros-2-2.fc27.noarch
rpmfusion-free-release-28-1.noarch
qt5-srpm-macros-5.10.1-1.fc28.noarch
nim-srpm-macros-1-1.fc28.noarch
rpm-build-4.14.1-7.fc28.x86_64
rpm-4.14.1-7.fc28.x86_64
perl-srpm-macros-1-25.fc28.noarch
python3-rpm-4.14.1-7.fc28.x86_64
rpmfusion-nonfree-release-28-1.noarch
rpmfusion-nonfree-appstream-data-28-2.fc28.noarch
gnat-srpm-macros-4-5.fc28.noarch
rpm-libs-debuginfo-4.14.1-7.fc28.x86_64
deltarpm-3.6-25.fc28.x86_64
ocaml-srpm-macros-5-2.fc27.noarch
rust-srpm-macros-5-2.fc28.noarch
python-srpm-macros-3-28.fc28.noarch
rpm-build-libs-4.14.1-7.fc28.x86_64
rpmlint-1.10-11.fc28.noarch
drpm-0.3.0-13.fc28.x86_64
redhat-rpm-config-106-1.fc28.noarch
python2-rpm-4.14.1-7.fc28.x86_64
rpm-plugin-selinux-4.14.1-7.fc28.x86_64
ghc-srpm-macros-1.4.2-7.fc28.noarch
rpm-debuginfo-4.14.1-7.fc28.x86_64
rpm-plugin-systemd-inhibit-4.14.1-7.fc28.x86_64
[root@t470s ~]# rpm -qa|grep systemd
libreport-plugin-systemd-journal-2.9.4-1.fc28.x86_64
systemd-container-238-7.fc28.x86_64
systemd-pam-238-7.fc28.x86_64
python-systemd-doc-234-5.fc28.x86_64
oci-systemd-hook-0.1.15-1.git2d0b8a3.fc28.x86_64
systemd-udev-238-7.fc28.x86_64
systemd-libs-238-7.fc28.x86_64
systemd-238-7.fc28.x86_64
python3-systemd-234-5.fc28.x86_64
systemd-bootchart-233-1.fc28.x86_64
rpm-plugin-systemd-inhibit-4.14.1-7.fc28.x86_64
[root@t470s ~]# cat /etc/system-release
Fedora release 28 (Twenty Eight)
[root@t470s ~]# cat /etc/os-release 
NAME=Fedora
VERSION="28 (Workstation Edition)"
ID=fedora
VERSION_ID=28
PLATFORM_ID="platform:f28"
PRETTY_NAME="Fedora 28 (Workstation Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:28"
HOME_URL="https://fedoraproject.org/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=28
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=28
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
[root@t470s ~]# 





Steps to Reproduce:
1. dnf -y upgrade systemd\*

Actual results:


Expected results:


Additional info:

(gdb) run /usr/bin/dnf upgrade -y
Starting program: /usr/bin/python /usr/bin/dnf upgrade -y
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
[New Thread 0x7fffd9c51700 (LWP 32316)]
[Thread 0x7fffd9c51700 (LWP 32316) exited]
[New Thread 0x7fffd9c51700 (LWP 32318)]
[Thread 0x7fffd9c51700 (LWP 32318) exited]
Last metadata expiration check: 0:00:00 ago on Sun 29 Apr 2018 01:06:31 PM PDT.
Dependencies resolved.
====================================================================================================================================================
 Package                                   Arch                           Version                              Repository                      Size
====================================================================================================================================================
Upgrading:
 systemd                                   x86_64                         238-7.fc28.1                         fedora                         3.6 M
 systemd-container                         x86_64                         238-7.fc28.1                         fedora                         459 k
 systemd-libs                              x86_64                         238-7.fc28.1                         fedora                         506 k
 systemd-pam                               x86_64                         238-7.fc28.1                         fedora                         203 k
 systemd-udev                              x86_64                         238-7.fc28.1                         fedora                         1.3 M

Transaction Summary
====================================================================================================================================================
Upgrade  5 Packages

Total size: 6.1 M
Downloading Packages:
[SKIPPED] systemd-238-7.fc28.1.x86_64.rpm: Already downloaded                                                                                      
[SKIPPED] systemd-pam-238-7.fc28.1.x86_64.rpm: Already downloaded                                                                                  
[SKIPPED] systemd-libs-238-7.fc28.1.x86_64.rpm: Already downloaded                                                                                 
[SKIPPED] systemd-udev-238-7.fc28.1.x86_64.rpm: Already downloaded                                                                                 
[SKIPPED] systemd-container-238-7.fc28.1.x86_64.rpm: Already downloaded                                                                            
Running transaction check
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
rstrhash (string=0x0) at rpmstrpool.c:97
97	    return rstrlenhash(string, NULL);
(gdb) bt
#0  rstrhash (string=0x0) at rpmstrpool.c:97
#1  0x00007fffde23dadd in depCacheKeyHash (key=0x0, ht=0x555555fb37e0) at ../lib/rpmhash.C:106
#2  rpmdbProvides (ts=ts@entry=0x555555f20f90, dcache=dcache@entry=0x555555fb37e0, dep=dep@entry=0x555555eff470, matches=matches@entry=0x0)
    at depends.c:530
#3  0x00007fffde23e15a in unsatisfiedDepend (ts=ts@entry=0x555555f20f90, dcache=dcache@entry=0x555555fb37e0, dep=dep@entry=0x555555eff470)
    at depends.c:784
#4  0x00007fffde23e664 in checkInstDeps (ts=ts@entry=0x555555f20f90, dcache=dcache@entry=0x555555fb37e0, te=te@entry=0x555556a26460, 
    depTag=depTag@entry=RPMTAG_REQUIRENAME, dep=dep@entry=0x555555f8d6e0 "systemd") at depends.c:858
#5  0x00007fffde23f079 in rpmtsCheck (ts=0x555555f20f90) at depends.c:1107
#6  0x00007fffdc08c243 in rpmts_Check () from /usr/lib64/python2.7/site-packages/rpm/_rpm.so
#7  0x00007ffff7a20607 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#8  0x00007ffff7af5fd7 in PyEval_CallObjectWithKeywords () from /lib64/libpython2.7.so.1.0
#9  0x00007ffff7acfe10 in methoddescr_call () from /lib64/libpython2.7.so.1.0
#10 0x00007ffff7a20607 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#11 0x00007ffff7af7696 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#12 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#13 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#14 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#15 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#16 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#17 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#18 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#19 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#20 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#21 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#22 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#23 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#24 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#25 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#26 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#27 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#28 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#29 0x00007ffff7afd9a9 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#30 0x00007ffff7b00298 in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#31 0x00007ffff7b0053d in PyEval_EvalCode () from /lib64/libpython2.7.so.1.0
#32 0x00007ffff7b0669f in run_mod () from /lib64/libpython2.7.so.1.0
#33 0x00007ffff7b06650 in PyRun_FileExFlags () from /lib64/libpython2.7.so.1.0
#34 0x00007ffff7b06452 in PyRun_SimpleFileExFlags () from /lib64/libpython2.7.so.1.0
#35 0x00007ffff7b0c340 in Py_Main () from /lib64/libpython2.7.so.1.0
#36 0x00007ffff6c371bb in __libc_start_main () from /lib64/libc.so.6
#37 0x000055555555484a in _start ()
(gdb)

Comment 1 Panu Matilainen 2018-05-02 07:28:10 UTC
I'd say this is rpmdb indexes fallen out of sync or something like that. Try doing 'rpmdb --rebuilddb' to see if it goes away.

Comment 2 Marcel Wysocki 2018-05-02 18:51:45 UTC
Was also able to reproduce it with rpm standalone

[root@t470s packages]# gdb rpm 
GNU gdb (GDB) Fedora 8.1-11.fc28
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from rpm...Reading symbols from /usr/lib/debug/usr/bin/rpm-4.14.1-7.fc28.x86_64.debug...done.
done.
(gdb) run -U /var/cache/dnf/fedora-f21308f6293b3270/packages/systemd-238-7.fc28.1.x86_64.rpm
Starting program: /usr/bin/rpm -U /var/cache/dnf/fedora-f21308f6293b3270/packages/systemd-238-7.fc28.1.x86_64.rpm
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /usr/lib64/rpm-plugins/selinux.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/c2/6360f0b52bcbe8b6e4bde3223d0ffa27dabc4f.debug
Missing separate debuginfo for /usr/lib64/rpm-plugins/systemd_inhibit.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/c6/2f07a82a9e0661f40b621976786e8b48d05a54.debug
warning: Loadable section ".note.gnu.property" outside of ELF segments

Program received signal SIGSEGV, Segmentation fault.
rstrhash (string=0x0) at rpmstrpool.c:97
97	    return rstrlenhash(string, NULL);
Missing separate debuginfos, use: dnf debuginfo-install systemd-libs-238-7.fc28.x86_64
(gdb) bt
#0  rstrhash (string=0x0) at rpmstrpool.c:97
#1  0x00007ffff7b87add in depCacheKeyHash (key=0x0, ht=0x5555557baeb0) at ../lib/rpmhash.C:106
#2  rpmdbProvides (ts=ts@entry=0x5555557afc70, dcache=dcache@entry=0x5555557baeb0, dep=dep@entry=0x55555584cf00, matches=matches@entry=0x0) at depends.c:530
#3  0x00007ffff7b8815a in unsatisfiedDepend (ts=ts@entry=0x5555557afc70, dcache=dcache@entry=0x5555557baeb0, dep=dep@entry=0x55555584cf00) at depends.c:784
#4  0x00007ffff7b88664 in checkInstDeps (ts=ts@entry=0x5555557afc70, dcache=dcache@entry=0x5555557baeb0, te=te@entry=0x5555557db8f0, depTag=depTag@entry=RPMTAG_REQUIRENAME, dep=dep@entry=0x5555557caa30 "systemd") at depends.c:858
#5  0x00007ffff7b89079 in rpmtsCheck (ts=0x5555557afc70) at depends.c:1107
#6  0x00007ffff7ba3598 in rpmcliTransaction (ts=ts@entry=0x5555557afc70, numPackages=1, ia=<optimized out>, ia=<optimized out>) at rpminstall.c:264
#7  0x00007ffff7ba46c1 in rpmInstall (ts=<optimized out>, ia=<optimized out>, fileArgv=<optimized out>) at rpminstall.c:622
#8  0x0000555555555c1a in main (argc=3, argv=<optimized out>) at rpmqv.c:295
(gdb) 



However, rebuilddb seems to help.
I feel like this should be caught by rpm instead of just segfaulting.

Comment 3 Igor Raits 2018-08-10 12:49:15 UTC
libdnf used to be broken... Should be fixed now.

Comment 4 Panu Matilainen 2018-08-10 13:00:04 UTC
This is a case of rpmdb indexes going out of sync due to an earlier problem (kill -9 / crash / whatever) and rpm not detecting / cleanly handling that, not a libdnf problem.

Comment 5 Panu Matilainen 2018-08-10 13:03:29 UTC
...but IIRC there is/was a specific bug for that someplace, which would be more useful than a random segfault on something, so maybe we just leave this closed.


Note You need to log in before you can comment on or make changes to this bug.