Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge "Segmentation fault" after system crash [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ndziorlg
n00b
n00b


Joined: 04 Apr 2010
Posts: 5
Location: Wrocław, Poland

PostPosted: Sun Apr 04, 2010 10:30 am    Post subject: emerge "Segmentation fault" after system crash [SO Reply with quote

My system froze when running "emerge". After cold reset emerge results in "Segmentation fault". Some with other apps from "sys-apps/portage". Some portage connected apps seems to work fine, but most of them fails because they try to run "portageq". All other system components are OK. "revdep-rebuild" worked, but did not find any problems.

I am running AMD64 box with JFS filesystem. While crash emerge was not modifying anything ("--ask" before accepting). Is there the solution any other then "reinstall system"?


Last edited by ndziorlg on Sun Apr 04, 2010 8:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Apr 04, 2010 12:50 pm    Post subject: Reply with quote

Did you check your filesystem for corruption.
Back to top
View user's profile Send private message
ndziorlg
n00b
n00b


Joined: 04 Apr 2010
Posts: 5
Location: Wrocław, Poland

PostPosted: Sun Apr 04, 2010 2:33 pm    Post subject: Reply with quote

Jaglover wrote:
Did you check your filesystem for corruption.

I run following command on read-only mounted filesystem:
Code:
jfs_fsck -v -f /dev/sda5

and it did not report any problems.

I have no idea what can be wrong. "q" apps from "app-portage/portage-utils" are working so, database of installed packages should be fine. If there is a problem with some particular package, I think I can get binary package from other system with the same CHOST, copy files manually and "emerge -1" afterwards to remove possible conflicts. But which package? I already tried "sys-apps/portage".
Back to top
View user's profile Send private message
Nerevar
l33t
l33t


Joined: 31 May 2008
Posts: 720

PostPosted: Sun Apr 04, 2010 3:55 pm    Post subject: Reply with quote

Is /dev/sda5 where /var lives (you should fsck all filesystems after a crash)? It may be that your pkg db has become corrupted (/var/db/pkg).
If your /var partition fsck's ok, look in /var/db/pkg for the package you were compiling when the system crashed. It might just have junk files that are messing up portageq (which is not part of portage-utils but portage itself).
Back to top
View user's profile Send private message
ndziorlg
n00b
n00b


Joined: 04 Apr 2010
Posts: 5
Location: Wrocław, Poland

PostPosted: Sun Apr 04, 2010 5:46 pm    Post subject: Reply with quote

Thanks for the answer.
Nerevar wrote:
Is /dev/sda5 where /var lives (you should fsck all filesystems after a crash)? It may be that your pkg db has become corrupted (/var/db/pkg).

Yes, I checked partition where the "/var" is. I have root filesystem "/" (including /lib, /usr and /var) and separate for "/root" and "/home".

Nerevar wrote:
If your /var partition fsck's ok, look in /var/db/pkg for the package you were compiling when the system crashed. It might just have junk files that are messing up portageq (which is not part of portage-utils but portage itself).

"/var/db/pkg" seems to contain three king of files (I am not Gentoo developer I had no idea how does it look inside before): compressed enviroment.bz2 and ebuild for each package and text files with variable values. I tested the compressed with:
Code:
find /var/db/pkg/ -name '*.bz2' -exec bzip2 -t \{\} \;

Ebuild files are also OK, I compared them to ebuilds in portage tree:
Code:
find /var/db/pkg/ -name '*.ebuild' | while read EB; do diff "$EB" `echo "$EB" | sed 's|^/var/db/pkg/\([^/]*/[^/]*\)-[0-9].*/\(.*\)|/usr/portage/\1/\2|'`; done | less

...still nothing.
Finally I switched "/var/db/pkg" to the one found in stage3 and I am still getting "Segmentation fault" :(
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21639

PostPosted: Sun Apr 04, 2010 6:01 pm    Post subject: Reply with quote

If you run python --version, does it work? What about emerge --info?
Back to top
View user's profile Send private message
ndziorlg
n00b
n00b


Joined: 04 Apr 2010
Posts: 5
Location: Wrocław, Poland

PostPosted: Sun Apr 04, 2010 6:12 pm    Post subject: Reply with quote

Hu wrote:
If you run python --version, does it work? What about emerge --info?

Code:
MSq-HP ~ # python --version
Python 2.6.4
MSq-HP ~ # emerge --info
Segmentation fault


When trying to run python-updater, I get:
Code:
MSq-HP ~ # python-updater
 * Unable to proceed. Can not find PORTDIR. Make sure the command:
 * 
 *   portageq portdir
 * returns a value. If it doesn't, make sure you have updated to
 * latest portage version.
 * 
 * Report bugs to http://bugs.gentoo.org/

and portageq portdir results in:
Code:
MSq-HP ~ # portageq portdir
/usr/portage
Segmentation fault


I made a sys-apps/portage binary package in other host with the same CHOST and manually copied files to my system. Pythons' version is the same on both systems, and I am still getting "Segmentation fault".
Back to top
View user's profile Send private message
Nerevar
l33t
l33t


Joined: 31 May 2008
Posts: 720

PostPosted: Sun Apr 04, 2010 7:05 pm    Post subject: Reply with quote

Do you have strace installed? If so, try "strace portageq portdir".
Also, what do you get from "eselect python list"?
Back to top
View user's profile Send private message
ndziorlg
n00b
n00b


Joined: 04 Apr 2010
Posts: 5
Location: Wrocław, Poland

PostPosted: Sun Apr 04, 2010 7:56 pm    Post subject: Reply with quote

Nerevar wrote:
Do you have strace installed? If so, try "strace portageq portdir".

I did not have strace, but I compiled it, and the tail of what I got:
Code:
[...]
open("/var/cache/edb/mtimedb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2653, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=2653, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f069507e000
read(3, "0, 0, 0\n0, 0, 0\n0, 0, 0\n0, 0, 0\n"..., 4096) = 2653
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault

I got rid of the folder which was last accessed:
Code:
mv /var/cache/edb /var/cache/edb-old

...and it worked!! "/var/cache/edb" is recreated and emerge is working perfectly fine like it did before.
Thank you all for your help :D
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1559
Location: Adelaide/Australia

PostPosted: Fri Dec 08, 2017 12:35 am    Post subject: Reply with quote

Had this happen to me with profile 17 switch.
Also worked for me :)
Edit: whoops, spoke to soon, emerge did the profile updates but then core dumped again.
Switched back to profile 3, problem persists, unfortunately, I don't have strace installed.
I also don't have gdb installed and the entire system (except for a select few) is built using clang/llvm, rather than gcc, as this is an experimental system, specifically built to test building without gcc, although gcc is installed and up to date for ~amd64, as a few packages require it.

emerge --sync works

As soon as Verifying ebuild manifests is shown, the core is generated.

No filesystems are full or missing.

emerge --info works
Code:
Portage 2.3.13 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop, gcc-7.2.0, glibc-2.25-r9, 4.12.12-gentoo x86_64)
=================================================================
System uname: Linux-4.12.12-gentoo-x86_64-Intel-R-_Core-TM-_i7-7700_CPU_@_3.60GHz-with-gentoo-2.4.1
KiB Mem:    10216148 total,   9450000 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of repository gentoo: Thu, 07 Dec 2017 23:45:02 +0000
Head commit of repository gentoo: 6ef22505bc25ef8a68bef36e38832c7207d7aa68
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.10.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.9::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            7.2.0::gentoo
sys-devel/gcc-config:     1.8-r1::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.25-r9::gentoo
Repositories:

local_repo
    location: /portage/local
    masters: gentoo
    priority: 0

gentoo
    location: /portage/gentoo
    sync-type: rsync
    sync-uri: rsync://mirror.internode.on.net/gentoo-portage
    priority: 1
    sync-rsync-extra-opts:

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-O2 -mtune=native -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /lib/udev/rules.d /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/sabnzbd/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuil
d /etc/sandbox.d /etc/terminfo"
CXX="clang++"
CXXFLAGS="-O2 -mtune=native -march=native -pipe"
DISTDIR="/portage/gentoo/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect 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://mirror.internode.on.net/pub/gentoo ftp://mirror.pacific.net.au/linux/Gentoo http://mymirror.asiaosc.org/gentoo/ http://www.zentek-international.com/mirrors/gentoo/ http://open-systems.ufl.edu/mirrors/gentoo http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_AU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/portage/gentoo/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 alsa amd64 berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emacs emboss encode exif fam firefox flac fortran gd gdbm gif glamor gpm iconv ipv6 jpeg lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support qt5 readline sdl seccomp session spell sse sse2 sse3 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="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="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir disk_cache dumpio env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so 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 sse sse2 sse3 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" GRUB_PLATFORMS="efi-64 pc emu" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="virtualbox" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

_________________
...Lyall
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum