You are not logged in.

#1 2013-03-08 20:44:07

jm82
Member
Registered: 2012-12-06
Posts: 17

Error in `gpg': malloc(): memory corruption

Evening all.

I'm running Archlinux on a Shuttle box (XS35V2) with a Corsair SSD (V4-CT032V4SSD2). I recently encountered a massive number of file system errors, but after cleaning up with fsck.ext4 all the errors were resolved. This left a few corrupt packages, but pacman managed to reinstall them.

However, it seems that "gpgme" was another affected package and I'm now unable to upgrade the system:

[root@shuttlepc ~]# pacman -Su
:: Starting full system upgrade...
:: Replace khrplatform-devel with extra/mesa? [Y/n] 
:: Replace libegl with extra/mesa? [Y/n] 
:: Replace libgbm with extra/mesa? [Y/n] 
:: Replace libgl with extra/mesa-libgl? [Y/n] 
:: Replace libglapi with extra/mesa? [Y/n] 
:: Replace nss-myhostname with core/systemd? [Y/n] 
:: Replace ntfsprogs with extra/ntfs-3g? [Y/n] 
resolving dependencies...
looking for inter-conflicts...

Targets (116): acl-2.2.51-3  archlinux-keyring-20130224-1  automake-1.13.1-1  bash-4.2.042-3  binutils-2.23.1-3  bison-2.7-1  ca-certificates-20130119-1  cifs-utils-5.9-1  cloog-0.18.0-1
               coreutils-8.21-1  cracklib-2.8.22-1  cronie-1.4.9-2  cryptsetup-1.6.0-1  curl-7.29.0-2  device-mapper-2.02.98-3  dhcpcd-5.6.4-2  dialog-1.2_20121230-1  e2fsprogs-1.42.7-1
               enca-1.14-1  extundelete-0.2.4-1  ffmpeg-1:1.1.3-1  file-5.13-1  findutils-4.4.2-5  fontconfig-2.10.2-1  freetype2-2.4.11-2  fribidi-0.19.5-1  gawk-4.0.2-1  gcc-4.7.2-4
               gcc-libs-4.7.2-4  gettext-0.18.2-1  gmp-5.1.1-1  gnupg-2.0.19-6  gpgme-1.3.1-5  grep-2.14-2  groff-1.22.2-2  gzip-1.5-3  hwids-20130228-1  iproute2-3.7.0-1  iptables-1.4.16.3-1
               iputils-20121221-1  isl-0.11.1-1  iw-3.8-2  json-c-0.10-2  kbd-1.15.5-3  khrplatform-devel-9.0.1-1 [removal]  kmod-12-1  krb5-1.11-3  libass-0.10.1-1  libbluray-0.2.3-1
               libdrm-2.4.42-1  libegl-9.0.1-1 [removal]  libgbm-9.0.1-1 [removal]  libgl-9.0.1-1 [removal]  libglapi-9.0.1-1 [removal]  libidn-1.26-1  libksba-1.2.0-3  libmodplug-0.8.8.4-1
               libnl-3.2.19-1  libpng-1.5.14-1  libpulse-3.0-2  libssh2-1.4.3-1  libvdpau-0.6-1  libwbclient-3.6.12-2  libx11-1.5.0-2  libxcb-1.9-3  libxdamage-1.1.4-1  libxi-1.6.2-1
               licenses-20130203-1  linux-3.7.10-1  lvm2-2.02.98-3  man-pages-3.47-1  mdadm-3.2.6-3  mesa-9.1-2  mesa-libgl-9.1-2  mkinitcpio-0.13.0-1  mpfr-3.1.1.p2-2  ncurses-5.9-4
               nss-myhostname-0.3-3 [removal]  ntfs-3g-2013.1.13-2  ntfsprogs-2012.1.15-4 [removal]  ntp-4.2.6.p5-13  openssh-6.1p1-6  openssl-1.0.1.e-3  opus-1.0.2-1
               pacman-mirrorlist-20130203-1  pambase-20130113-1  patch-2.7.1-2  pcmciautils-018-6  perl-5.16.2-3  pinentry-0.8.2-2  pkg-config-0.28-1  python2-distribute-0.6.34-1
               python2-imaging-1.1.7-8  python2-lxml-3.1.0-1  python2-urwid-1.1.1-1  recode-3.6-7  reiserfsprogs-3.6.22-1  rfkill-0.4-7  rtmpdump-20121203-1  sed-4.2.2-2  shadow-4.1.5.1-4
               sox-14.4.1-1  speex-1.2rc1-3  sqlite-3.7.15.2-1  systemd-197-4  systemd-sysvcompat-197-4  testdisk-6.13-4  texinfo-5.0-1  tzdata-2013a-1  util-linux-2.22.2-1  v4l-utils-0.9.3-2
               wayland-1.0.5-1  which-2.20-6  wpa_supplicant-2.0-2  x264-20130206-1  xfsprogs-3.1.10-1

Total Installed Size:   607.68 MiB
Net Upgrade Size:       110.49 MiB

Proceed with installation? [Y/n] 
*** Error in `gpg': malloc(): memory corruption: 0x00000000024cf940 ***                                             [############----------------------------------------------------------]  18%

Manually trying to reinstall gpgme gets the same result:

[root@shuttlepc ~]# pacman -S gpgme
resolving dependencies...
looking for inter-conflicts...

Targets (1): gpgme-1.3.1-5

Total Installed Size:   0.84 MiB
Net Upgrade Size:       0.00 MiB

Proceed with installation? [Y/n] 
*** Error in `gpg': malloc(): memory corruption: 0x0000000001f9c940 ***                                             [----------------------------------------------------------------------]   0%

Some packages, however, upgrade ok (I just upgrade libpcap, for example).

I have absolutely no idea where to go with this, beyond re-installing the whole OS, as gpgme seems to be used by pacman to upgrade it. Can anyone suggest anything?

Last edited by jm82 (2013-03-08 20:46:21)

Offline

#2 2013-03-08 23:39:14

jm82
Member
Registered: 2012-12-06
Posts: 17

Re: Error in `gpg': malloc(): memory corruption

Just a quick update. I've tried

  • pacman -Syu

  • pacman -Suu

  • pacman -R gpgme

  • pacman-key --init

  • arch-chroot & all of the above

  • pacman -S openssl libarchive pacman (works ok)

  • fsck

...all without success. I'm unable to remove this package as it's a pacman dependency, but I can't update it. I feel the arch-chroot direction is the right way, I just have no idea what to do.

Offline

#3 2013-03-09 14:56:01

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,662

Re: Error in `gpg': malloc(): memory corruption

the error could be due to a corrupt package, try deleting gpgme from /var/cache/pacman/pkg so it needs to be re-downloaded.

I assume when you tried the chroot, you had booted from a live cd/usb ?


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2013-03-09 17:25:00

jm82
Member
Registered: 2012-12-06
Posts: 17

Re: Error in `gpg': malloc(): memory corruption

no luck I'm afraid. The package re-downloaded ok, but still fails.

[root@shuttlebox pkg]# pacman -S gpgme
resolving dependencies...
looking for inter-conflicts...

Targets (1): gpgme-1.3.1-5

Total Download Size:    0.20 MiB
Total Installed Size:   0.84 MiB
Net Upgrade Size:       0.00 MiB

Proceed with installation? [Y/n] 
:: Retrieving packages from core...
 gpgme-1.3.1-5-x86_64     207.8 KiB   705K/s 00:00 [######################] 100%
*** Error in `gpg': malloc(): memory corruption: 0x00000000021d3940 ***---]   0%

Yes, I chroot'd from the latest Arch live usb.

Offline

#5 2013-03-10 21:35:07

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 4,662

Re: Error in `gpg': malloc(): memory corruption

I get the feeling the problem is not with gpgme itself, only detected there.

A search for malloc(): memory corruption gives  a lot of results that mention glibc .
check if that package is correct.


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#6 2013-03-11 10:13:24

jm82
Member
Registered: 2012-12-06
Posts: 17

Re: Error in `gpg': malloc(): memory corruption

glibc updated successfully, but issues still present.

However, something prompted me to have another look at pacman-key tool, which I have run previously and never spotted the error Error in `gpg': free(): invalid next size (fast): 0x000000000097db50 and /usr/bin/pacman-key: line 377:  3334 Aborted                 (core dumped) "${GPG_PACMAN[@]}" --import "${KEYRING_IMPORT_DIR}/${keyring}.gpg"...

[root@shuttlepc ~]# pacman-key --populate archlinux
==> Appending keys from archlinux.gpg...
gpg: key FFF979E7: "Allan McRae (Arch Linux Master Key) <allan@master-key.archlinux.org>" not changed
gpg: key CDFD6BB0: "Dan McGee (Arch Linux Master Key) <dan@master-key.archlinux.org>" not changed
gpg: key 4C7EA887: "Ionut Biru (Arch Linux Master Key) <ionut@master-key.archlinux.org>" not changed
gpg: key 6AC6A4C2: "Pierre Schmitz (Arch Linux Master Key) <pierre@master-key.archlinux.org>" not changed
gpg: key 824B18E8: "Thomas Bächler (Arch Linux Master Key) <thomas@master-key.archlinux.org>" not changed
gpg: key 31496106: "Andrzej Giniewicz (giniu) <gginiu@gmail.com>" not changed
gpg: key EAE999BD: "Allan McRae <me@allanmcrae.com>" not changed
gpg: key 98BC6FF5: "Maxime Gauduin <alucryd@gmail.com>" not changed
gpg: key D30DB0AD: "Andrea Scarpino (Arch Linux) <andrea@archlinux.org>" not changed
gpg: key 0F2A092B: "Andreas Radke <andyrtr@archlinux.org>" not changed
gpg: key EC133BAD: "Angel Velásquez <angvp@archlinux.org>" not changed
gpg: key 5CF9C8D4: "Alexander Rødseth <rodseth@gmail.com>" not changed
gpg: key 0901C163: "Balló György <ballogyor@gmail.com>" not changed
gpg: DSA key 00F0D0F0 requires a 256 bit or larger hash
*** Error in `gpg': free(): invalid next size (fast): 0x000000000097db50 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x7ab06)[0x7f8ad2b98b06]
/usr/lib/libc.so.6(+0x7b883)[0x7f8ad2b99883]
/usr/lib/libgcrypt.so.11(+0xb0a5)[0x7f8ad32eb0a5]
/usr/lib/libgcrypt.so.11(+0x1debf)[0x7f8ad32fdebf]
gpg[0x42fb0d]
gpg[0x42febb]
gpg[0x44d56b]
gpg[0x44f2ed]
gpg[0x44fe26]
gpg[0x44ffac]
gpg[0x40aae8]
/usr/lib/libc.so.6(__libc_start_main+0xf5)[0x7f8ad2b3fa15]
gpg[0x40c5e1]
======= Memory map: ========
00400000-004ae000 r-xp 00000000 08:01 1459303                            /usr/bin/gpg2
006ad000-006ae000 r--p 000ad000 08:01 1459303                            /usr/bin/gpg2
006ae000-006b2000 rw-p 000ae000 08:01 1459303                            /usr/bin/gpg2
006b2000-006b3000 rw-p 00000000 00:00 0
00971000-009b3000 rw-p 00000000 00:00 0                                  [heap]
7f8ad26ac000-7f8ad26c1000 r-xp 00000000 08:01 1448071                    /usr/lib/libgcc_s.so.1
7f8ad26c1000-7f8ad28c0000 ---p 00015000 08:01 1448071                    /usr/lib/libgcc_s.so.1
7f8ad28c0000-7f8ad28c1000 rw-p 00014000 08:01 1448071                    /usr/lib/libgcc_s.so.1
7f8ad28c1000-7f8ad2919000 r-xp 00000000 08:01 1445390                    /usr/lib/libncursesw.so.5.9
7f8ad2919000-7f8ad2b18000 ---p 00058000 08:01 1445390                    /usr/lib/libncursesw.so.5.9
7f8ad2b18000-7f8ad2b1c000 r--p 00057000 08:01 1445390                    /usr/lib/libncursesw.so.5.9
7f8ad2b1c000-7f8ad2b1d000 rw-p 0005b000 08:01 1445390                    /usr/lib/libncursesw.so.5.9
7f8ad2b1d000-7f8ad2b1e000 rw-p 00000000 00:00 0
7f8ad2b1e000-7f8ad2cc2000 r-xp 00000000 08:01 1443925                    /usr/lib/libc-2.17.so
7f8ad2cc2000-7f8ad2ec1000 ---p 001a4000 08:01 1443925                    /usr/lib/libc-2.17.so
7f8ad2ec1000-7f8ad2ec5000 r--p 001a3000 08:01 1443925                    /usr/lib/libc-2.17.so
7f8ad2ec5000-7f8ad2ec7000 rw-p 001a7000 08:01 1443925                    /usr/lib/libc-2.17.so
7f8ad2ec7000-7f8ad2ecb000 rw-p 00000000 00:00 0
7f8ad2ecb000-7f8ad2eda000 r-xp 00000000 08:01 1459225                    /usr/lib/libassuan.so.0.3.0
7f8ad2eda000-7f8ad30d9000 ---p 0000f000 08:01 1459225                    /usr/lib/libassuan.so.0.3.0
7f8ad30d9000-7f8ad30da000 r--p 0000e000 08:01 1459225                    /usr/lib/libassuan.so.0.3.0
7f8ad30da000-7f8ad30db000 rw-p 0000f000 08:01 1459225                    /usr/lib/libassuan.so.0.3.0
7f8ad30db000-7f8ad30df000 r-xp 00000000 08:01 1459351                    /usr/lib/libgpg-error.so.0.9.0
7f8ad30df000-7f8ad32de000 ---p 00004000 08:01 1459351                    /usr/lib/libgpg-error.so.0.9.0
7f8ad32de000-7f8ad32df000 r--p 00003000 08:01 1459351                    /usr/lib/libgpg-error.so.0.9.0
7f8ad32df000-7f8ad32e0000 rw-p 00004000 08:01 1459351                    /usr/lib/libgpg-error.so.0.9.0
7f8ad32e0000-7f8ad3359000 r-xp 00000000 08:01 1449205                    /usr/lib/libgcrypt.so.11.7.0
7f8ad3359000-7f8ad3559000 ---p 00079000 08:01 1449205                    /usr/lib/libgcrypt.so.11.7.0
7f8ad3559000-7f8ad355d000 rw-p 00079000 08:01 1449205                    /usr/lib/libgcrypt.so.11.7.0
7f8ad355d000-7f8ad3599000 r-xp 00000000 08:01 1447954                    /usr/lib/libreadline.so.6.2
7f8ad3599000-7f8ad3799000 ---p 0003c000 08:01 1447954                    /usr/lib/libreadline.so.6.2
7f8ad3799000-7f8ad379b000 r--p 0003c000 08:01 1447954                    /usr/lib/libreadline.so.6.2
7f8ad379b000-7f8ad37a1000 rw-p 0003e000 08:01 1447954                    /usr/lib/libreadline.so.6.2
7f8ad37a1000-7f8ad37a3000 rw-p 00000000 00:00 0
7f8ad37a3000-7f8ad37b6000 r-xp 00000000 08:01 1443993                    /usr/lib/libresolv-2.17.so
7f8ad37b6000-7f8ad39b6000 ---p 00013000 08:01 1443993                    /usr/lib/libresolv-2.17.so
7f8ad39b6000-7f8ad39b7000 r--p 00013000 08:01 1443993                    /usr/lib/libresolv-2.17.so
7f8ad39b7000-7f8ad39b8000 rw-p 00014000 08:01 1443993                    /usr/lib/libresolv-2.17.so
7f8ad39b8000-7f8ad39ba000 rw-p 00000000 00:00 0
7f8ad39ba000-7f8ad39c9000 r-xp 00000000 08:01 1448041                    /usr/lib/libbz2.so.1.0.6
7f8ad39c9000-7f8ad3bc8000 ---p 0000f000 08:01 1448041                    /usr/lib/libbz2.so.1.0.6
7f8ad3bc8000-7f8ad3bca000 rw-p 0000e000 08:01 1448041                    /usr/lib/libbz2.so.1.0.6
7f8ad3bca000-7f8ad3bdf000 r-xp 00000000 08:01 1448119                    /usr/lib/libz.so.1.2.7
7f8ad3bdf000-7f8ad3dde000 ---p 00015000 08:01 1448119                    /usr/lib/libz.so.1.2.7
7f8ad3dde000-7f8ad3ddf000 r--p 00014000 08:01 1448119                    /usr/lib/libz.so.1.2.7
7f8ad3ddf000-7f8ad3de0000 rw-p 00015000 08:01 1448119                    /usr/lib/libz.so.1.2.7
7f8ad3de0000-7f8ad3e01000 r-xp 00000000 08:01 1443975                    /usr/lib/ld-2.17.so
7f8ad3e67000-7f8ad3ff0000 r--p 00000000 08:01 1459446                    /usr/lib/locale/locale-archive
7f8ad3ff0000-7f8ad3ff7000 rw-p 00000000 00:00 0
7f8ad3ff7000-7f8ad3ff9000 rw-p 00000000 00:00 0
7f8ad3ff9000-7f8ad4001000 rw-p 00000000 00:00 0
7f8ad4001000-7f8ad4002000 r--p 00021000 08:01 1443975                    /usr/lib/ld-2.17.so
7f8ad4002000-7f8ad4003000 rw-p 00022000 08:01 1443975                    /usr/lib/ld-2.17.so
7f8ad4003000-7f8ad4004000 rw-p 00000000 00:00 0
7fff6eb3c000-7fff6eb5d000 rw-p 00000000 00:00 0                          [stack]
7fff6ebff000-7fff6ec00000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
/usr/bin/pacman-key: line 377:  3334 Aborted                 (core dumped) "${GPG_PACMAN[@]}" --import "${KEYRING_IMPORT_DIR}/${keyring}.gpg"
==> Locally signing trusted keys in keyring...
  -> Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2...

pub  3072R/6AC6A4C2  created: 2011-11-18  expires: never       usage: SC
                     trust: marginal      validity: full
sub  1024R/86872C2F  created: 2011-11-18  expires: never       usage: E
sub  3072R/1B516B59  created: 2011-11-18  expires: never       usage: A
[  full  ] (1). Pierre Schmitz (Arch Linux Master Key) <pierre@master-key.archlinux.org>

"Pierre Schmitz (Arch Linux Master Key) <pierre@master-key.archlinux.org>" was already locally signed by key 91612948
Nothing to sign with key 91612948

Key not changed so no update needed.
  -> Locally signing key 684148BB25B49E986A4944C55184252D824B18E8...

pub  3072R/824B18E8  created: 2011-11-19  expires: never       usage: SC
                     trust: marginal      validity: full
The following key was revoked on 2011-11-19 by RSA key 824B18E8 Thomas Bächler (Arch Linux Master Key) <thomas@master-key.archlinux.org>
sub  1024R/AAE53976  created: 2011-11-19  revoked: 2011-11-19  usage: E
The following key was revoked on 2011-11-19 by RSA key 824B18E8 Thomas Bächler (Arch Linux Master Key) <thomas@master-key.archlinux.org>
sub  2048R/96A8F3F2  created: 2011-11-19  revoked: 2011-11-19  usage: A
[  full  ] (1). Thomas Bächler (Arch Linux Master Key) <thomas@master-key.archlinux.org>

"Thomas Bächler (Arch Linux Master Key) <thomas@master-key.archlinux.org>" was already locally signed by key 91612948
Nothing to sign with key 91612948

Key not changed so no update needed.
  -> Locally signing key 44D4A033AC140143927397D47EFD567D4C7EA887...

pub  3072R/4C7EA887  created: 2011-11-25  expires: never       usage: SC
                     trust: marginal      validity: full
The following key was revoked on 2011-11-25 by RSA key 4C7EA887 Ionut Biru (Arch Linux Master Key) <ionut@master-key.archlinux.org>
sub  1024R/93F91AC3  created: 2011-11-25  revoked: 2011-11-25  usage: E
The following key was revoked on 2011-11-25 by RSA key 4C7EA887 Ionut Biru (Arch Linux Master Key) <ionut@master-key.archlinux.org>
sub  3072R/B20030F3  created: 2011-11-25  revoked: 2011-11-25  usage: A
[  full  ] (1). Ionut Biru (Arch Linux Master Key) <ionut@master-key.archlinux.org>

"Ionut Biru (Arch Linux Master Key) <ionut@master-key.archlinux.org>" was already locally signed by key 91612948
Nothing to sign with key 91612948

Key not changed so no update needed.
  -> Locally signing key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0...

pub  3072R/CDFD6BB0  created: 2011-11-29  expires: never       usage: SC
                     trust: marginal      validity: full
sub  3072R/87E611F8  created: 2011-11-29  expires: never       usage: E
[  full  ] (1). Dan McGee (Arch Linux Master Key) <dan@master-key.archlinux.org>

"Dan McGee (Arch Linux Master Key) <dan@master-key.archlinux.org>" was already locally signed by key 91612948
Nothing to sign with key 91612948

Key not changed so no update needed.
  -> Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7...

pub  4096R/FFF979E7  created: 2011-11-29  expires: never       usage: SC
                     trust: marginal      validity: full
[  full  ] (1). Allan McRae (Arch Linux Master Key) <allan@master-key.archlinux.org>

"Allan McRae (Arch Linux Master Key) <allan@master-key.archlinux.org>" was already locally signed by key 91612948
Nothing to sign with key 91612948

Key not changed so no update needed.
==> Importing owner trust values...
==> Updating trust database...
gpg: no need for a trustdb check

Tried moving /etc/pacman.d/gnupg and re-initialising pacman-key but it contains an error:

[root@shuttlepc ~]# haveged -w 1024
[root@shuttlepc ~]# pacman-key --init
gpg: Generating pacman keychain master key...
gpg: -:2: invalid algorithm
gpg: Done
==> Updating trust database...
gpg: no need for a trustdb check

...so I restored the original directory. Re-running is successful.

Then I checked dependencies for pacman and wondered about archlinux-keyring, so tried to re-install that which results in the following error (extracted):

...
*** Error in `gpg: DSA key 00F0D0F0 requires a 256 bit or larger hash
usr/bin/pacman-key: line 377:  3492 Aborted                 (core dumped) "${GPG_PACMAN[@]}" --import "${KEYRING_IMPORT_DIR}/${keyring}.gpg"
...

Also tried changing the keyserver in gpg.conf to hkp://pgp.mit.edu:11371 and re-running the pacman-key commands, but that has no effect.

Offline

#7 2013-03-11 21:25:29

jm82
Member
Registered: 2012-12-06
Posts: 17

Re: Error in `gpg': malloc(): memory corruption

Tried removing signiture requirements from pacman.conf. No change. Tried all manner of things to regenerate keys. No joy.

Have now reformatted disk and currently re-installing OS. Slightly disappointed I couldn't crack it, and if anyone knows how to solve this issue and stumbles across this thread, please let me know how I could have solved it!

Cheers to Lone_Wolf for the suggestions.

Offline

Board footer

Powered by FluxBB