FS#53904 - segmentation fault while synchronizing package database

Attached to Project: Pacman
Opened by Dharmesh Pandav (mrpandav) - Monday, 01 May 2017, 16:29 GMT
Last edited by Allan McRae (Allan) - Monday, 08 May 2017, 09:01 GMT
Task Type Bug Report
Category General
Status Unconfirmed
Assigned To No-one
Architecture x86_64
Severity Medium
Priority Normal
Reported Version 5.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Summary and Info:
Since last un-attended system upgrade and shutdown
I am getting "segmentation fault" when I try to sync or install new package

:: Synchronizing package databases...
debug: url: http://archlinux.cu.be/core/os/x86_64/core.db
debug: maxsize: 26214400
debug: using time condition: 1493493824
debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)

error: segmentation fault


Steps to Reproduce:
sudo pacman -Syu --debug
debug: pacman v5.0.1 - libalpm v10.0.1
debug: config: attempting to read file /etc/pacman.conf
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: arch: x86_64
debug: config: SigLevel: Never
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 78: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 81: including /etc/pacman.d/mirrorlist
debug: config: new section 'community'
debug: config file /etc/pacman.conf, line 87: including /etc/pacman.d/mirrorlist
debug: config: new section 'multilib'
debug: config file /etc/pacman.conf, line 96: including /etc/pacman.d/mirrorlist
debug: config: new section 'archlinuxfr'
debug: config: SigLevel: Never
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': http://archlinux.cu.be/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.metalgamer.eu/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirrors.neusoft.edu.cn/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.de.leaseweb.net/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://run.hit.edu.cn/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://mirror.bytemark.co.uk/archlinux/core/os/x86_64
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': http://archlinux.cu.be/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.metalgamer.eu/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirrors.neusoft.edu.cn/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.de.leaseweb.net/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://run.hit.edu.cn/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://mirror.bytemark.co.uk/archlinux/extra/os/x86_64
debug: registering sync database 'community'
debug: database path for tree community set to /var/lib/pacman/sync/community.db
debug: setting usage of 15 for community repository
debug: adding new server URL to database 'community': http://archlinux.cu.be/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.metalgamer.eu/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirrors.neusoft.edu.cn/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.de.leaseweb.net/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://run.hit.edu.cn/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': http://mirror.bytemark.co.uk/archlinux/community/os/x86_64
debug: registering sync database 'multilib'
debug: database path for tree multilib set to /var/lib/pacman/sync/multilib.db
debug: setting usage of 15 for multilib repository
debug: adding new server URL to database 'multilib': http://archlinux.cu.be/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://mirror.metalgamer.eu/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://mirrors.neusoft.edu.cn/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://mirror.de.leaseweb.net/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://run.hit.edu.cn/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://mirror.bytemark.co.uk/archlinux/multilib/os/x86_64
debug: registering sync database 'archlinuxfr'
debug: database path for tree archlinuxfr set to /var/lib/pacman/sync/archlinuxfr.db
debug: setting usage of 15 for archlinuxfr repository
debug: adding new server URL to database 'archlinuxfr': http://repo.archlinux.fr/x86_64
:: Synchronizing package databases...
debug: url: http://archlinux.cu.be/core/os/x86_64/core.db
debug: maxsize: 26214400
debug: using time condition: 1493493824
debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)

error: segmentation fault
Please submit a full bug report with --debug if appropriate.
This task depends upon

Comment by Allan McRae (Allan) - Monday, 01 May 2017, 21:36 GMT
What curl version do you have installed.
Comment by Dharmesh Pandav (mrpandav) - Tuesday, 02 May 2017, 09:57 GMT
curl 7.54.0-2 from core/
Comment by Allan McRae (Allan) - Tuesday, 02 May 2017, 11:30 GMT
Try deleting /var/lib/pacman/sync/core.db.part
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 05:45 GMT
same result,
tried commenting out core.db from pacman.conf

next the error was for extra
Comment by Allan McRae (Allan) - Wednesday, 03 May 2017, 06:03 GMT
Do you have gdb installed? Can I get a backtrace?
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 06:27 GMT
No I do not have it installed

tried installing it

: Retrieving packages...
debug: url: http://archlinux.cu.be/extra/os/x86_64/guile2.0-2.0.14-1-x86_64.pkg.tar.xz
debug: maxsize: 2390844
debug: tempfile found, attempting continuation from 0 bytes
debug: opened tempfile for download: /var/cache/pacman/pkg/guile2.0-2.0.14-1-x86_64.pkg.tar.xz.part (ab)

error: segmentation fault
Please submit a full bug report with --debug if appropriate.
Comment by Allan McRae (Allan) - Wednesday, 03 May 2017, 06:39 GMT
Can you write to /var/cache/pacman/pkg/? Try uncommenting a XferCommand value in your pacman.conf to see if that helps.
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 07:10 GMT
there were two option to Xfer one using curl other with wget
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u

I have un-commented one with curl

after that, I tried
sudo pacman -Syu

error:

Dharmesh Pandav [12:42]
sudo pacman -Syu
:: Synchronizing package databases...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 186 100 186 0 0 431 0 --:--:-- --:--:-- --:--:-- 431
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 186 100 186 0 0 428 0 --:--:-- --:--:-- --:--:-- 428
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 186 100 186 0 0 428 0 --:--:-- --:--:-- --:--:-- 428
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 186 100 186 0 0 231 0 --:--:-- --:--:-- --:--:-- 231
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15303 100 15303 0 0 16474 0 --:--:-- --:--:-- --:--:-- 16472
:: Starting full system upgrade...
error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/community.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/community.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/core.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/core.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/extra.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/community.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/community.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format
error: could not open file /var/lib/pacman/sync/multilib.db: Unrecognized archive format
there is nothing to do
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 07:11 GMT
I have created a file with sudo in /var/cache/pacman/pkg/ dir and was able to save it
Comment by Allan McRae (Allan) - Wednesday, 03 May 2017, 07:17 GMT
can you run "file /var/lib/pacman/sync/extra.db"?
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 07:23 GMT
# /var/lib/pacman/sync/extra.db: HTML document, ASCII text, with CRLF line terminators
Comment by Allan McRae (Allan) - Wednesday, 03 May 2017, 07:27 GMT
Can you please attach that file?
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 07:39 GMT
please find attached the extra.db file




   extra.db (0.2 KiB)
Comment by Allan McRae (Allan) - Wednesday, 03 May 2017, 07:45 GMT
If you look in the file, it is a 301 page. Not sure why you are getting that - using that mirror here handles the redirect fine. Just change mirror for a workaround.
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 08:16 GMT
I have copied mirrolist from my other working ArchLinux system

after that did a pacman -Syu and it seem to be running, will update here
Comment by Dharmesh Pandav (mrpandav) - Wednesday, 03 May 2017, 09:10 GMT
it did work but throws error after downloading all the packaged

File xxx is corrupted ( invalid or corrupted package (checksum)),
Do you want to delete it? [Y/n]
Comment by Allan McRae (Allan) - Wednesday, 03 May 2017, 10:28 GMT
Any packages that were downloaded while you were having an issue with that mirror will need deleted.
Comment by Dharmesh Pandav (mrpandav) - Thursday, 04 May 2017, 08:48 GMT
yes, it did work ( creating a new mirrorlist file)


had to clean package cache -Sc and -SCC

and than pacman -Syu <--- worked !
Comment by Allan McRae (Allan) - Monday, 08 May 2017, 09:01 GMT
I am not closing this because we should not segfault when this happens.

Loading...