Running "rpm -qa" usually works, but not always. Running "rpm -Va" appears to always segfault.. with an error similar to: S.5..... /lib/libm-2.12.so S.5..... /lib/libnsl-2.12.so S.5..... /lib/libpthread-2.12.so S.5..... /lib/libresolv-2.12.so S.5..... /lib/librt-2.12.so S.5..... /lib/libutil-2.12.so error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) Segmentation fault Note, the exactly behvior prior to the segfault seems to change at times...
Note, segfault also occurs on arm: root@qemuarm:~# rpm -Va S.5..... /lib/libgcc_s.so.1 error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) *** glibc detected *** rpm: munmap_chunk(): invalid pointer: 0x0003d440 *** Aborted
Segfault also occurs on PPC: S.5..... /lib/ld-2.12.so S.5..... /lib/libc-2.12.so S.5..... /lib/libcrypt-2.12.so S.5..... /lib/libdl-2.12.so S.5..... /lib/libm-2.12.so S.5..... /lib/libnsl-2.12.so S.5..... /lib/libpthread-2.12.so S.5..... /lib/libresolv-2.12.so S.5..... /lib/librt-2.12.so S.5..... /lib/libutil-2.12.so *** glibc detected *** rpm: corrupted double-linked list: 0x10030938 *** ======= Backtrace: ========= /lib/libc.so.6[0xfebd1a4] /lib/libc.so.6[0xfec02ac] /lib/libc.so.6(__libc_malloc+0x80)[0xfec1d00] /lib/libc.so.6[0xfefca78] /lib/libc.so.6[0xff0a248] /lib/libc.so.6(regcomp+0xcc)[0xff0b590] /usr/lib/librpmio-5.0.so(mireRegcomp+0x140)[0xfaa3c80] /usr/lib/librpmdb-5.0.so(rpmEVRparse+0x284)[0xf83ba3c] /usr/lib/librpm-5.0.so(rpmdsCompare+0x244)[0xf7b098c] /usr/lib/librpm-5.0.so(rpmdsAnyMatchesDep+0x104)[0xf7b1370] /usr/lib/librpm-5.0.so[0xf790f44] /usr/lib/librpm-5.0.so[0xf7920c0] /usr/lib/librpm-5.0.so(rpmtsCheck+0x1d0)[0xf79620c] /usr/lib/librpm-5.0.so[0xf7ccccc] /usr/lib/librpm-5.0.so(showVerifyPackage+0x21c)[0xf7cd194] /usr/lib/librpm-5.0.so[0xf7a4ab0] /usr/lib/librpm-5.0.so(rpmQueryVerify+0x244)[0xf7a5930] /usr/lib/librpm-5.0.so(rpmcliArgIter+0x330)[0xf7a6568] /usr/lib/librpm-5.0.so(rpmcliVerify+0xdc)[0xf7cd2fc] rpm[0x10003ac0] /lib/libc.so.6[0xfe5f844] /lib/libc.so.6[0xfe5f9f4] ======= Memory map: ======== 00100000-00103000 r-xp 00000000 00:00 0 [vdso] 0f740000-0f761000 r-xp 00000000 03:00 4075 /usr/lib/librpmbuild-5.0.so 0f761000-0f770000 ---p 00021000 03:00 4075 /usr/lib/librpmbuild-5.0.so 0f770000-0f773000 rwxp 00020000 03:00 4075 /usr/lib/librpmbuild-5.0.so 0f773000-0f77d000 rwxp 00000000 00:00 0 0f780000-0f7d8000 r-xp 00000000 03:00 7054 /usr/lib/librpm-5.0.so 0f7d8000-0f7e7000 ---p 00058000 03:00 7054 /usr/lib/librpm-5.0.so 0f7e7000-0f7ee000 rwxp 00057000 03:00 7054 /usr/lib/librpm-5.0.so 0f7ee000-0f800000 rwxp 00000000 00:00 0 0f810000-0f84b000 r-xp 00000000 03:00 88 /usr/lib/librpmdb-5.0.so 0f84b000-0f85a000 ---p 0003b000 03:00 88 /usr/lib/librpmdb-5.0.so 0f85a000-0f85f000 rwxp 0003a000 03:00 88 /usr/lib/librpmdb-5.0.so 0f85f000-0f87f000 rwxp 00000000 00:00 0 0f890000-0f8ae000 r-xp 00000000 03:00 95 /usr/lib/libpcre.so.0.0.1 0f8ae000-0f8be000 ---p 0001e000 03:00 95 /usr/lib/libpcre.so.0.0.1 0f8be000-0f8bf000 rwxp 0001e000 03:00 95 /usr/lib/libpcre.so.0.0.1 0f8d0000-0fa0d000 r-xp 00000000 03:00 1085 /usr/lib/librpmmisc-5.0.so 0fa0d000-0fa1d000 ---p 0013d000 03:00 1085 /usr/lib/librpmmisc-5.0.so 0fa1d000-0fa22000 rwxp 0013d000 03:00 1085 /usr/lib/librpmmisc-5.0.so 0fa30000-0fa64000 r-xp 00000000 03:00 4062 /usr/lib/libbeecrypt.so.6.4.0 0fa64000-0fa74000 ---p 00034000 03:00 4062 /usr/lib/libbeecrypt.so.6.4.0 0fa74000-0fa76000 rwxp 00034000 03:00 4062 /usr/lib/libbeecrypt.so.6.4.0 0fa80000-0fad1000 r-xp 00000000 03:00 8041 /usr/lib/librpmio-5.0.so 0fad1000-0fae1000 ---p 00051000 03:00 8041 /usr/lib/librpmio-5.0.so 0fae1000-0fae5000 rwxp 00051000 03:00 8041 /usr/lib/librpmio-5.0.so 0fae5000-0fb09000 rwxp 00000000 00:00 0 0fb10000-0fb12000 r-xp 00000000 03:00 10029 /usr/lib/libpcreposix.so.0.0.0 0fb12000-0fb21000 ---p 00002000 03:00 10029 /usr/lib/libpcreposix.so.0.0.0 0fb21000-0fb22000 rwxp 00001000 03:00 10029 /usr/lib/libpcreposix.so.0.0.0 0fb30000-0fb3b000 r-xp 00000000 03:00 4073 /usr/lib/libpopt.so.0.0.0 0fb3b000-0fb4a000 ---p 0000b000 03:00 4073 /usr/lib/libpopt.so.0.0.0 0fb4a000-0fb4b000 rwxp 0000a000 03:00 4073 /usr/lib/libpopt.so.0.0.0 0fb50000-0fc4a000 r-xp 00000000 03:00 2077 /usr/lib/libstdc++.so.6.0.14 0fc4a000-0fc59000 ---p 000fa000 03:00 2077 /usr/lib/libstdc++.so.6.0.14 0fc59000-0fc5e000 r--p 000f9000 03:00 2077 /usr/lib/libstdc++.so.6.0.14 0fc5e000-0fc61000 rwxp 000fe000 03:00 2077 /usr/lib/libstdc++.so.6.0.14 0fc61000-0fc67000 rwxp 00000000 00:00 0 0fc70000-0fc79000 r-xp 00000000 03:00 18 /lib/librt-2.12.so 0fc79000-0fc88000 ---p 00009000 03:00 18 /lib/librt-2.12.so 0fc88000-0fc89000 r--p 00008000 03:00 18 /lib/librt-2.12.so 0fc89000-0fc8a000 rwxp 00009000 03:00 18 /lib/librt-2.12.so 0fc8a000-0fc95000 rwxp 00000000 00:00 0 0fca0000-0fd45000 r-xp 00000000 03:00 1020 /lib/libm-2.12.so 0fd45000-0fd54000 ---p 000a5000 03:00 1020 /lib/libm-2.12.so 0fd54000-0fd55000 r--p 000a4000 03:00 1020 /lib/libm-2.12.so 0fd55000-0fd58000 rwxp 000a5000 03:00 1020 /lib/libm-2.12.so 0fd58000-0fd59000 rwxp 00000000 00:00 0 0fd60000-0fd74000 r-xp 00000000 03:00 3005 /lib/libgcc_s.so.1 0fd74000-0fd84000 ---p 00014000 03:00 3005 /lib/libgcc_s.so.1 0fd84000-0fd85000 rwxp 00014000 03:00 3005 /lib/libgcc_s.so.1 0fd90000-0fda5000 r-xp 00000000 03:00 4067 /usr/lib/libelf-0.148.so 0fda5000-0fdb4000 ---p 00015000 03:00 4067 /usr/lib/libelf-0.148.so 0fdb4000-0fdb5000 r--p 00014000 03:00 4067 /usr/lib/libelf-0.148.so 0fdb5000-0fdb6000 rwxp 00015000 03:00 4067 /usr/lib/libelf-0.148.so 0fdc0000-0fdc2000 r-xp 00000000 03:00 3993 /lib/libdl-2.12.so 0fdc2000-0fdd2000 ---p 00002000 03:00 3993 /lib/libdl-2.12.so 0fdd2000-0fdd3000 r--p 00002000 03:00 3993 /lib/libdl-2.12.so 0fdd3000-0fdd4000 rwxp 00003000 03:00 3993 /lib/libdl-2.12.so 0fde0000-0fdf4000 r-xp 00000000 03:00 94 /usr/lib/libz.so.1.2.5 0fdf4000-0fe03000 ---p 00014000 03:00 94 /usr/lib/libz.so.1.2.5 0fe03000-0fe04000 rwxp 00013000 03:00 94 /usr/lib/libz.so.1.2.5 0fe10000-0fe27000 r-xp 00000000 03:00 4985 /lib/libpthread-2.12.so 0fe27000-0fe36000 ---p 00017000 03:00 4985 /lib/libpthread-2.12.so 0fe36000-0fe37000 r--p 00016000 03:00 4985 /lib/libpthread-2.12.so 0fe37000-0fe38000 rwxp 00017000 03:00 4985 /lib/libpthread-2.12.so 0fe38000-0fe3a000 rwxp 00000000 00:00 0 0fe40000-0ff9b000 r-xp 00000000 03:00 5978 /lib/libc-2.12.so 0ff9b000-0ffab000 ---p 0015b000 03:00 5978 /lib/libc-2.12.so 0ffab000-0ffad000 r--p 0015b000 03:00 5978 /lib/libc-2.12.so 0ffad000-0ffb0000 rwxp 0015d000 03:00 5978 /lib/libc-2.12.so 0ffb0000-0ffb3000 rwxp 00000000 00:00 0 0ffc0000-0ffdf000 r-xp 00000000 03:00 1017 /lib/ld-2.12.so 0ffee000-0ffef000 r--p 0001e000 03:00 1017 /lib/ld-2.12.so 0ffef000-0fff1000 rwxp 0001f000 03:00 1017 /lib/ld-2.12.so 10000000-10005000 r-xp 00000000 03:00 3058 /usr/bin/rpm 10015000-10018000 rwxp 00005000 03:00 3058 /usr/bin/rpm 10018000-10059000 rwxp 00000000 00:00 0 [heap] 48000000-48008000 rw-p 00000000 00:00 0 48008000-4800e000 rw-s 00000000 03:00 4096 /var/lib/rpm/__db.001 4800e000-48038000 rw-s 00000000 03:00 4097 /var/lib/rpm/__db.002 48038000-4817a000 rw-s 00000000 03:00 4098 /var/lib/rpm/__db.003 4817a000-481f4000 rw-s 00000000 03:00 4099 /var/lib/rpm/__db.004 481f8000-481fa000 rw-p 00000000 00:00 0 481fc000-481fd000 rw-p 00000000 00:00 0 481fe000-481ff000 rw-p 00000000 00:00 0 48213000-48217000 rw-p 00000000 00:00 0 48219000-4821d000 rw-p 00000000 00:00 0 48300000-48321000 rw-p 00000000 00:00 0 48321000-48400000 ---p 00000000 00:00 0 bf801000-bf866000 rw-p 00000000 00:00 0 [stack] Aborted
x86 fails as well: root@qemux86:~# rpm -Va S.5..... /lib/libgcc_s.so.1 *** glibc detected *** rpm: corrupted double-linked list: 0x08074d88 *** Aborted -- Changing description to indicate a generic issue!
I also met similar issue when installing RPM package with 20101011 build. Following error does not hurt the RPM function. Installation can work. root@qemux86:~# rpm -ivh curl-7.21.0-r0.i586.rpm error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) Preparing... ########################################### [100%] 1:curl ########################################### [100%] *** glibc detected *** rpm: free(): invalid next size (fast): 0x0806b2f8 *** Aborted
(In reply to comment #0) > Running "rpm -qa" usually works, but not always. > > Running "rpm -Va" appears to always segfault.. with an error similar to: > > > S.5..... /lib/libm-2.12.so > S.5..... /lib/libnsl-2.12.so > S.5..... /lib/libpthread-2.12.so > S.5..... /lib/libresolv-2.12.so > S.5..... /lib/librt-2.12.so > S.5..... /lib/libutil-2.12.so > error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No > match(1) > error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No > match(1) > Segmentation fault > > > Note, the exactly behvior prior to the segfault seems to change at times... This similar problem arise with qemumips+sato. root@qemumips:~# rpm -qa rpmdb: unable to join the environment error: db4 error(11) from dbenv->open: Resource temporarily unavailable error: cannot open Packages(0) index using db3 - Resource temporarily unavailable (11) error: cannot open Packages database in /var/lib/rpm
Further investigation has shown this may be a problem with eglibc. I changed from eglibc back to glibc within the environment and the issues on x86 appeared to have gone away. The problem, when looking at things via valgrind, appears to indicate a problem within glibc using the regexec and related functions from libpcre. I'm not sure what libpcre functions use within libc, but on glibc they appear to work without fail, eglibc they appear to cause double free's and failed regex calls. I'll continue to explore this, but we may need to do additional research into this and see if we've uncovered a libc problem.
Switching to 'glibc' from eglibc on ARM also makes the segfaults disappear.
Instructions for reproducing. Run "rpm -V <package>" or "rpm -Va" (for all packages). This will results in a number of messages similar to: error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) and/or glibc double free error messages... and eventually a segfault. If you change to using glibc, these messages all go away and there is no more segfaulting. You can use valgrind (on a supported target, x86_64 is one) to run rpm in. This will show you where the failures, bad memory access and/or double frees are located. If you add INHIBIT_PACKAGE_STRIP=1 to the rpm, glibc and eglibc packages, valgrind will give you more information as to what is happening.
The similar issue was found with latest milestone build(10/14) with qemuarm: root@qemuarm:~# rpm -ivh mc-4.7.3-r0.armv5te.rpm error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) error: Failed dependencies: ncurses-terminfo is needed by mc-4.7.3-r0.armv5te *** glibc detected *** rpm: corrupted double-linked list: 0x0003b528 *** Aborted
I am seeing same issue also with glibc. Earlier I tried copying glibc binary files, and also installing glibc package in the image. THis time I built the whole image from scratch with POKYLIBC="glibc" configuration, and it is also failing for rpm -V same as it was failing for eglibc. Nitin
While debugging I made some other changes, which I thought I backed out before doing the final testing. Below are the changes, perhaps one of these triggered the success and I didn't realize it? (abbreviated patch below) --- a/meta/recipes-core/eglibc/eglibc.inc +++ b/meta/recipes-core/eglibc/eglibc.inc @@ -1,3 +1,4 @@ +INHIBIT_PACKAGE_STRIP=1 --- a/meta/recipes-devtools/rpm/rpm_5.1.10.bb +++ b/meta/recipes-devtools/rpm/rpm_5.1.10.bb @@ -1,3 +1,4 @@ +INHIBIT_PACKAGE_STRIP=1 DESCRIPTION = "The RPM Package Manager - relaunched" DESCRIPTION_rpm-build = "The RPM Package Manager rpmbuild and related commands." HOMEPAGE = "http://rpm5.org/" @@ -34,7 +35,7 @@ EXTRA_OECONF = "--with-python=${PYTHON_BASEVERSION} \ --without-dmalloc \ --without-efence \ --without-neon \ - --with-pcre=${libdir} \ + --with-pcre=internal \ --with-path-macros=${rpm_macros} \ --with-bugreport=http://bugzilla.pokylinux.org"
Additional information: I tested both the LSB and Minimal images generated from the Autobuilder (for qemuarm). I ran the rpm -Va command on both of these images. For the Minimal image, the command did not fail, but for LSB it did. I am building a local basic image to continue to test this theory.
So I tested Mark's changes, and the best bet is the --with-pcre=internal will fix it. I ran through the various permutations.
I'm not sure whether Qing has sent out his investigation. Based on my talk with him last Friday, rpm was observed still using bash regexp instead of pcre. We don't know whether bash regexp or pcre should be preferred here, but if '--with-pcre=internal' does work we may use it as the workaround for now and then solve bash regexp error post-0.9
It's odd, I thought I had tested the pcre=internal with eglibc and was receiving the same errors. I'm not sure why it was set the way it was before, but typically RPM installs do use the internal version... Could the problem be that either the external one is broken or unavailable? I agree though, in this case it appears the correct fix is to switch to internal pcre and we go from there and verify it resolves the issues we were seeing.
The warning message is produced by libc, not pcre: --- error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) --- This is the call to regexec (together with regcomp, comes from libc), the pcre version is pcre_exec and the error message will look like "pcre_exec failed: return ...". Should pcre be used here (mireRegexec)? I did see a big switch(), where mire->mode can be either RPMMIRE_REGEX (uses regexec) and RPMMIRE_PCRE (uses pcre), but not sure about the intended behavior.
Tried some debug prints, for package installation (rpm -ivh) First time run doesn't produce any error (when the package has not been installed), second run shows: # rpm -ivh curl-dev-7.21.0-r0.i586.rpm regexec: try to match 7.21.0-r0 # debug print: the target string error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) regexec: try to match 7.21.0-r0 error: ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$: regexec failed: No match(1) ...
http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=ef670167cdf9e31588932a27b22974c908a54dd7
I tested on x86 targets with 20101018 build, there is no such issue now.