| Summary: | [zypper] zypper can not search any packages after installed package by rpm on qemuarm | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Yi Zhao <yi.zhao> |
| Component: | core | Assignee: | Qing He <qing.he> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | High | CC: | jessica.zhang, jiajun.xu, kunwei.tian, liang.li2, liangliang.wang, meta.mr.watcher, meta.watcher, sgw, yi.zhao |
| Version: | 1.0 | ||
| Target Milestone: | 1.1 | ||
| Hardware: | Other | ||
| OS: | arm | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
| Bug Depends on: | 938 | ||
| Bug Blocks: | |||
|
Description
Yi Zhao
2011-03-08 23:37:07 UTC
problem was found that .armv5te.rpm don't appear in "zypper search avahi". If change "arch = qemuarm" to "arch = armv5te" in zypp.conf, these files will be shown. With the 20110318 build image, when I install package by zypper, there is a similar issue: There are 3 arch directories in qemuarm repository: all, armv5te, qemuarm. After I add this repo in target. Running command "zypper pa", it only list the packages which from qemuarm arch directory : ################### root@qemuarm:~# zypper pa Loading repository data... Reading installed packages... S | Repository | Name | Version | Arch --+------------+----------------+------------+-------- i | rpmrepo | base-files | 3.0.14-r67 | qemuarm | rpmrepo | base-files-dbg | 3.0.14-r67 | qemuarm i | rpmrepo | base-files-dev | 3.0.14-r67 | qemuarm | rpmrepo | base-files-doc | 3.0.14-r67 | qemuarm i | rpmrepo | formfactor | 0.0-r19 | qemuarm | rpmrepo | formfactor-dbg | 0.0-r19 | qemuarm i | rpmrepo | formfactor-dev | 0.0-r19 | qemuarm root@qemuarm:~# #################### And I can install/remove packages list above. If I want to install a package from armv5te directory, e.g man-1.6f-r0.armv5te.rpm, I can not search or install it. ############### root@qemuarm:~# zypper in man Loading repository data... Reading installed packages... 'man' not found in package names. Trying capabilities. No provider of 'man' found. Resolving package dependencies... Nothing to do. root@qemuarm:~# ############### If I change "arch = qemuarm" to "arch = armv5te" in zypp.conf, only packages from armv5te can be shown: ############### root@qemuarm:/etc/zypp# zypper pa Loading repository data... Reading installed packages... S | Repository | Name | Version | Arch --+------------+----------+-----------+-------- | rpmrepo | curl | 7.21.2-r1 | armv5te | rpmrepo | curl-doc | 7.21.2-r1 | armv5te root@qemuarm:~# ############### And I can not install packages from qemuarm arch directory. On qemumips, running command "zypper pa" can list all packages from 3 arch directories: ############## root@qemumips:~# zypper pa Loading repository data... Reading installed packages... S | Repository | Name | Version | Arch --+------------+----------------+--------------+--------- v | mipsrepo | base-files | 3.0.14-r65 | qemumips | mipsrepo | base-files-dbg | 3.0.14-r65 | qemumips v | mipsrepo | base-files-dev | 3.0.14-r65 | qemumips | mipsrepo | base-files-doc | 3.0.14-r65 | qemumips | mipsrepo | encodings | 1:1.0.4-r1.0 | all | mipsrepo | encodings-dbg | 1:1.0.4-r1.0 | all | mipsrepo | encodings-dev | 1:1.0.4-r1.0 | all | mipsrepo | man | 1.6f-r0 | mips | mipsrepo | man-dbg | 1.6f-r0 | mips | mipsrepo | man-dev | 1.6f-r0 | mips | mipsrepo | man-pages | 3.32-r1 | mips | mipsrepo | man-pages-dbg | 3.32-r1 | mips | mipsrepo | man-pages-dev | 3.32-r1 | mips root@qemumips:~# ################### This matches my observation, and currently arm is the only known arch to have this problem. The short answer is that there's some dependency between static global
intializations across several compilation unit that causes some undefined
behavior.
The exact spot is at zypp/Repository.cc:32, following is the run path
that actually initializes it:
const Repository Repository::noRepository;
-> zypp::Repository::Repository();
-> zypp::RepoInfo::RepoInfo();
-> zypp::RepoInfo::Impl::Impl();
-> zypp::repo::RepoVariablesUrlReplacer::RepoVariablesUrlReplacer();
-> zypp::repo::RepoVariablesStringReplacer::RepoVariablesStringReplacer();
The definition of the final node on the chain is at
zypp/repo/RepoVariables.cc:26
---
RepoVariablesStringReplacer::RepoVariablesStringReplacer()
{
sysarch = Arch_empty;
basearch = Arch_empty;
}
--
Where Arch_empty is defined in zypp/Arch.cc:
--
const Arch Arch_empty ( IdString::Empty );
--
At this point, the initialization order of zypp::Repository::noRepository
and zypp::Arch_empty is undefined (which is also referred to as the
"static initialization order fiasco"), since they belong to different
compilation units (read, .cc file).
On x86, we are fortunate that Arch_empty is init'ed before noRepository, but
on arm the order is reversed. When the constructor of RepoVariablesStringReplacer
runs, Arch_empty is not constructed yet, and it immediately leads to
undefined behavior. On g++ 4.5.0, this will result in default
constructor of Arch, i.e. Arch::Arch() being called, and then
ArchCompatSet::instance(), which leads to the pre-mature construction of
the compatibility table. That's why zypper on arm fails.
Verify the bug with 20110404 build, it is fixed. The commit number is f897723207b00b4c9dcdb43107891b7b82ce22f3 Verify the bug with 20110404 build, it is fixed. The commit number is f897723207b00b4c9dcdb43107891b7b82ce22f3 |