Bug 721 - [zypper] zypper segfault in qemux86-64 sdk image
Summary: [zypper] zypper segfault in qemux86-64 sdk image
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.0
Hardware: x86 x86_64
: Medium normal
Target Milestone: 1.0 M4
Assignee: Qing He
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2011-02-14 17:54 UTC by Jiajun Xu
Modified: 2011-03-08 18:22 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
valgrind output for qemux86-64 (26.40 KB, text/plain)
2011-03-01 03:27 UTC, Paul Eggleton
no flags Details
valgrind output for qemux86 (24.55 KB, text/plain)
2011-03-01 03:28 UTC, Paul Eggleton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiajun Xu 2011-02-14 17:54:20 UTC
Testing Env:    
Host: Ubuntu 10.04 LTS
Kernel: 2.6.32-21-generic-pae
image location: http://autobuilder.pokylinux.org/nightly/20110212-1/
commit information: b9a97e07b48b20b00feff5b8c7196c3a3b7762b6

In latest nightly build, running zypper commands in qemux86-64 sdk image, these commands would meet segfault. For example, running "zypper search" or "zypper licenses".

########
zypper[1715] general protection ip:7fcd8a63b570 sp:7fffc454dc90 error:0 in libzypp.so.810.1.0[7fcd8a045000+7d9000]
zypper[1724]: segfault at 20 ip 00000000004f9103 sp 00007fff2d779fe0 error 4 in zypper[400000+15d000]
zypper[1731]: segfault at 20 ip 00000000004f9103 sp 00007fff80e7a780 error 4 in zypper[400000+15d000]
########
Comment 1 Liang Wang 2011-02-14 19:01:51 UTC
I also met "Segmentation fault" on qemumips sato and sdk images when running "zypper search" or "zypper licenses".

image location: http://autobuilder.pokylinux.org/nightly/20110212-1/


root@qemumips:~# zypper search avahi
Loading repository data...
Reading installed packages...

S | Name              | Summary                                        | Type   
--+-------------------+------------------------------------------------+--------
i | avahi             | Avahi IPv4LL network address configuration d-> | package
i | avahi-daemon      | Avahi IPv4LL network address configuration d-> | package
i | avahi-dev         | Avahi IPv4LL network address configuration d-> | package
i | libavahi-client3  | Avahi IPv4LL network address configuration d-> | package
i | libavahi-common3  | Avahi IPv4LL network address configuration d-> | package
i | libavahi-core7    | Avahi IPv4LL network address configuration d-> | package
i | libavahi-glib1    | Avahi IPv4LL network address configuration d-> | package
i | libavahi-gobject0 | Avahi IPv4LL network address configuration d-> | package
*** glibc detected *** zypper: munmap_chunk(): invalid pointer: 0x005d9550 ***
Aborted
root@qemumips:~#
Comment 2 Qing He 2011-02-24 01:53:43 UTC
had a look at the segfault point, it happened in the global destructor (at_exit), it's something like:

std::map<str::string, zypp::RWCOW_pointer<zypp::url::UrlBase,...>> :: ~map()

in libzypp.so

Tried libzypp-dbg packages but got no good, for 1) analyzing core dump with debug symbol will make gdb crash (system memory raised to 512M), interactive debugging simply hangs.  So there is no filename and number information.

Since it's in global destructor, the object we are looking for comes probably from a static initialization, skimming through the code, the best guest may be one of the following three:

static std::map<std::string,ServiceType::Type> _table;
static std::map<std::string,ResourceType::Type> _table;
static std::map<std::string,RepoType::Type> _table;
Comment 3 Paul Eggleton 2011-03-01 03:27:35 UTC
Created attachment 99 [details]
valgrind output for qemux86-64

Not sure if this is of use but here's the valgrind output for "zypper search" on qemux86-64.
Comment 4 Paul Eggleton 2011-03-01 03:28:34 UTC
Created attachment 100 [details]
valgrind output for qemux86

For comparison here's the valgrind output for "zypper search" on qemux86, where for me it doesn't crash.
Comment 5 Paul Eggleton 2011-03-01 08:01:52 UTC
Have tracked this down to librpmio (rpmio/mire.c line 361) - the allocated size for the struct is too small and thus nasty stuff happens when it is passed to regcomp. At Mark's suggestion I am sending a question to rpm-devel about this.
Comment 6 Paul Eggleton 2011-03-02 02:33:02 UTC
See also Mark's comment on bug #722.
Comment 7 Qing He 2011-03-03 01:40:26 UTC
(In reply to comment #3)
> Created attachment 99 [details]
> valgrind output for qemux86-64
> Not sure if this is of use but here's the valgrind output for "zypper search"
> on qemux86-64.

there is exactly the same call trace in the qemuppc -sdk image case, see Bug 722
Comment 9 Jiajun Xu 2011-03-03 23:42:32 UTC
With "zypper addrepo", such segfault will also happen on qemux86-64.
Comment 10 Liang Wang 2011-03-07 21:57:03 UTC
The segfault still occurs on qemumips sato/sdk with 'zypper search avahi'.
Image location:
http://autobuilder.yoctoproject.org/nightly/20110305-4/machines/qemu/qemumips/

commit c192fefd868be53c20dfd8bc44e3e815cf53a10a
Comment 11 Qing He 2011-03-08 00:45:36 UTC
(In reply to comment #10)
> The segfault still occurs on qemumips sato/sdk with 'zypper search avahi'.
> Image location:
> http://autobuilder.yoctoproject.org/nightly/20110305-4/machines/qemu/qemumips/
> commit c192fefd868be53c20dfd8bc44e3e815cf53a10a

hi Wang Liang,
    Can you post the error message on qemumips images?

btw, zypper as current state does not support mips in its architecture table
Comment 12 Liang Wang 2011-03-08 17:34:46 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > The segfault still occurs on qemumips sato/sdk with 'zypper search avahi'.
> > Image location:
> > http://autobuilder.yoctoproject.org/nightly/20110305-4/machines/qemu/qemumips/
> > commit c192fefd868be53c20dfd8bc44e3e815cf53a10a
> 
> hi Wang Liang,
>     Can you post the error message on qemumips images?
> 
> btw, zypper as current state does not support mips in its architecture table

Please see below for the error message on qemumips.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
root@qemumips:~# zypper search avahi
Loading repository data...
Reading installed packages...

S | Name              | Summary                                                               | Type   
--+-------------------+-----------------------------------------------------------------------+--------
i | avahi             | Avahi IPv4LL network address configuration daemon                     | package
i | avahi-daemon      | Avahi IPv4LL network address configuration daemon                     | package
i | avahi-dev         | Avahi IPv4LL network address configuration daemon - Development files | package
i | libavahi-client3  | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-common3  | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-core7    | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-glib1    | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-gobject0 | Avahi IPv4LL network address configuration daemon                     | package
Segmentation fault
root@qemumips:~# zypper search avahi
Loading repository data...
Reading installed packages...

S | Name              | Summary                                                               | Type   
--+-------------------+-----------------------------------------------------------------------+--------
i | avahi             | Avahi IPv4LL network address configuration daemon                     | package
i | avahi-daemon      | Avahi IPv4LL network address configuration daemon                     | package
i | avahi-dev         | Avahi IPv4LL network address configuration daemon - Development files | package
i | libavahi-client3  | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-common3  | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-core7    | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-glib1    | Avahi IPv4LL network address configuration daemon                     | package
i | libavahi-gobject0 | Avahi IPv4LL network address configuration daemon                     | package
*** glibc detected *** zypper: corrupted double-linked list: 0x005d78b0 ***
Aborted
root@qemumips:~#
Comment 13 Jiajun Xu 2011-03-08 18:22:10 UTC
Hi Liang,
Since the original failure I reported on qemux86-64 is fixed by Qing and your failure seems another bug, could you open a new bug for qemumips failure?

I will verify the bug as FIXED becasue I never met segfault on qemux86-64 now.