Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 633504 - qpkg -c produces a segmentation fault
Summary: qpkg -c produces a segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabian Groffen
URL: https://forums.gentoo.org/viewtopic-t...
Whiteboard:
Keywords:
Depends on: 622578
Blocks:
  Show dependency tree
 
Reported: 2017-10-04 20:23 UTC by meteora
Modified: 2019-06-18 13:31 UTC (History)
1 user (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 meteora 2017-10-04 20:23:37 UTC
As suggested by wiki I used eclean packages to free about 3 GB of diskspace. Next I issued qpkg -c but this one segfaults. It used to work, but does not anymore. I then reinstalled portage-utils and gentoolkit as these were the two packages that I could think of qpkg belonging to, but still the same. 

Link with someone confirming same problem and additionally adding a backtrace: 

https://forums.gentoo.org/viewtopic-t-1070004-highlight-.html

emerge --info: 

Portage 2.3.8 (python 2.7.12-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-5.4.0, glibc-2.23-r4, 4.12.12-gentoo x86_64)
=================================================================
System uname: Linux-4.12.12-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8500_@_3.16GHz-with-gentoo-2.4.1
KiB Swap:    9767516 total,   9767516 free
Timestamp of repository gentoo: Tue, 03 Oct 2017 20:00:01 +0000
Head commit of repository gentoo: 9897597d43c4a8e1e25c092b305a807651910aad
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.28::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.28.1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_CH.UTF-8"
LC_ALL="de_CH.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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 a52 aac acl acpi activities alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx d3d9 dbus declarative dri dri3 dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran frei0r gdbm gif glamor gnutls gpm gtk iconv icu ipv6 jpeg kde kipi kwallet lcms ldap libnotify llvm lm_sensors mad mmx mmxext mng modules mp3 mp4 mpeg mtp multilib ncurses nls nptl ocr ogg openal opencl opengl openmax openmp osmesa pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt3support qt4 qt5 readline realtime s3tc scanner sdl seccomp semantic-desktop session spell spice sse sse2 sse3 ssh ssl ssse3 staging startup-notification svg tcpd theora tiff truetype udev udisks unicode upower usb uxa vaapi vdpau vhost-net vorbis vpx webrtc-aec widgets wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="hda-intel" 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="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext smp sse sse2 sse3 sse4_1 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="evdev" KERNEL="linux" L10N="de el en fr it tr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de de_DE el en fr fr_FR it tr" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" SANE_BACKENDS="pixma" USERLAND="GNU" VIDEO_CARDS="amdgpu radeon radeonsi intel i965" XFCE_PLUGINS="clock power multiload-nandhp trash" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 meteora 2017-10-04 20:49:22 UTC
emerged gdb and re-emerged portage-utils with 

#Debug CFLAGS
CFLAGS="-march=native -O1 -pipe -ggdb -Wall -g" 

#Debug USE
app-portage/portage-utils debug

and FEATURES="nostrip" emerge portage-utils: 

Here's my backtrace: 

gdb --args qpkg
GNU gdb (Gentoo 7.12.1 vanilla) 7.12.1
Copyright (C) 2017 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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 qpkg...done.
(gdb) run -c
Starting program: /usr/bin/qpkg -c

Program received signal SIGSEGV, Segmentation fault.
eat_file_fd (fd=fd@entry=5, bufptr=bufptr@entry=0x7fffffff8dc0, bufsize=bufsize@entry=0x7fffffff7da8) at main.c:211
211     main.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  eat_file_fd (fd=fd@entry=5, bufptr=bufptr@entry=0x7fffffff8dc0, bufsize=bufsize@entry=0x7fffffff7da8) at main.c:211
#1  0x0000000000405883 in eat_file_at (dfd=<optimized out>, 
    file=file@entry=0x7fffffff7dc0 "app-accessibility/at-spi2-core-2.22.1/SLOT", bufptr=bufptr@entry=0x7fffffff8dc0, 
    bufsize=bufsize@entry=0x7fffffff7da8) at main.c:233
#2  0x000000000040dcbe in get_vdb_atoms (fullcpv=fullcpv@entry=1) at main.c:1365
#3  0x000000000041c168 in qpkg_clean (dirp=0x73a1f0 "/usr/portage/packages") at qpkg.c:113
#4  0x000000000041cf05 in qpkg_main (argc=2, argv=0x7fffffffe198) at qpkg.c:339
#5  0x0000000000414ac5 in q_main (argc=argc@entry=2, argv=argv@entry=0x7fffffffe198) at q.c:76
#6  0x000000000041500b in main (argc=2, argv=0x7fffffffe198) at main.c:1412
(gdb) quit
Comment 2 Fabian Groffen gentoo-dev 2017-10-05 07:44:37 UTC
Could you try the latest v0.64 and drop -O1 from your CFLAGS while you compile it with debug flags?  FEATURES=keepwork may also be useful to get a readable stack trace here.
Comment 3 Marco Genasci 2017-10-05 08:21:22 UTC
Version 0.64, apparently, is unaffected by this bug.

Below bt for version 0.63 compiled with env

CFLAGS="-pipe -g -ggdb"
CXXFLAGS="${CFLAGS}"
FEATURES="nostrip keepwork"

$ gdb qpkg 
GNU gdb (Gentoo 7.12.1 vanilla) 7.12.1
Copyright (C) 2017 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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 qpkg...done.
(gdb) run -c
Starting program: /usr/bin/qpkg -c

Program received signal SIGSEGV, Segmentation fault.
0x00000000004093ad in eat_file_fd (fd=5, bufptr=0x7fffffff7df0, bufsize=0x7fffffff6dc0) at main.c:230
230     main.c: No such file or directory.
(gdb) bt
#0  0x00000000004093ad in eat_file_fd (fd=5, bufptr=0x7fffffff7df0, bufsize=0x7fffffff6dc0) at main.c:230
#1  0x00000000004094ba in eat_file_at (dfd=4, file=0x7fffffff6df0 "app-accessibility/at-spi2-core-2.22.1/SLOT", bufptr=0x7fffffff7df0, bufsize=0x7fffffff6dc0)
    at main.c:252
#2  0x000000000040dce5 in get_vdb_atoms (fullcpv=1) at main.c:1385
#3  0x000000000041e2a9 in qpkg_clean (dirp=0x7440f0 "/usr/portage/packages") at qpkg.c:113
#4  0x000000000041f2fc in qpkg_main (argc=2, argv=0x7fffffffd278) at qpkg.c:339
#5  0x000000000040e2a3 in q_main (argc=2, argv=0x7fffffffd278) at q.c:76
#6  0x000000000040dfd2 in main (argc=2, argv=0x7fffffffd278) at main.c:1432
(gdb)
Comment 4 Fabian Groffen gentoo-dev 2017-10-05 08:38:37 UTC
0.64 should go stable.
Comment 5 meteora 2017-10-06 17:54:18 UTC
gdb --args qpkg
GNU gdb (Gentoo 7.12.1 vanilla) 7.12.1
Copyright (C) 2017 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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 qpkg...done.
(gdb) run -c
Starting program: /usr/bin/qpkg -c

Program received signal SIGSEGV, Segmentation fault.
eat_file_fd (fd=fd@entry=5, bufptr=bufptr@entry=0x7fffffff9de0, bufsize=bufsize@entry=0x7fffffff8dc8) at main.c:211
211             buf[0] = '\0';
(gdb) bt
#0  eat_file_fd (fd=fd@entry=5, bufptr=bufptr@entry=0x7fffffff9de0, bufsize=bufsize@entry=0x7fffffff8dc8) at main.c:211
#1  0x0000000000407dd5 in eat_file_at (dfd=<optimized out>, 
    file=file@entry=0x7fffffff8de0 "app-accessibility/at-spi2-core-2.22.1/SLOT", bufptr=bufptr@entry=0x7fffffff9de0, 
    bufsize=bufsize@entry=0x7fffffff8dc8) at main.c:233
#2  0x0000000000410c07 in get_vdb_atoms (fullcpv=fullcpv@entry=1) at main.c:1365
#3  0x000000000041ca91 in qpkg_clean (dirp=0x73b1f0 "/usr/portage/packages") at qpkg.c:113
#4  0x000000000041d99c in qpkg_main (argc=2, argv=0x7fffffffe168) at qpkg.c:339
#5  0x00000000004033ec in main (argc=2, argv=0x7fffffffe168) at main.c:1412
(gdb) quit

Version 0.64 not affected: 

gdb --args qpkg
GNU gdb (Gentoo 7.12.1 vanilla) 7.12.1
Copyright (C) 2017 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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 qpkg...done.
(gdb) run -c
Starting program: /usr/bin/qpkg -c
 * Total space that would be freed in packages directory: 0 K
[Inferior 1 (process 19546) exited normally]
(gdb) bt
No stack.
(gdb) quit
Comment 6 Fabian Groffen gentoo-dev 2019-06-18 13:31:58 UTC
0.64 and 0.74 are out