<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>827</bug_id>
          
          <creation_ts>2011-03-08 23:37:07 +0000</creation_ts>
          <short_desc>[zypper] zypper can not search any packages after installed package by rpm on qemuarm</short_desc>
          <delta_ts>2011-04-06 23:57:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>1.1</target_milestone>
          <dependson>938</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yi Zhao">yi.zhao</reporter>
          <assigned_to name="Qing He">qing.he</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>jiajun.xu</cc>
    
    <cc>kunwei.tian</cc>
    
    <cc>liang.li2</cc>
    
    <cc>liangliang.wang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12399</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2011-03-08 23:37:07 +0000</bug_when>
    <thetext>Testing Env:    
Host: Ubuntu 10.10 x86_64
Kernel: 2.6.35-27-generic

Image location:
http://autobuilder.yoctoproject.org/nightly/20110305-4/
Commit information: c192fefd868be53c20dfd8bc44e3e815cf53a10a

With RC2 qemuarm images, after I installed man-1.6f-r0.armv5te.rpm with RPM command, zypper can not search any packages.

##############
root@qemuarm:~# zypper search man
Loading repository data...
Reading installed packages...

S | Name                     | Summary                                                            | Type   
--+--------------------------+--------------------------------------------------------------------+--------
i | connman                  | A daemon for managing internet connections within embedded devices | package
i | connman-gnome            | connman-gnome version 0.5-r4                                       | package
i | connman-plugin-bluetooth | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-dnsproxy  | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-ethernet  | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-loopback  | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-wifi      | A daemon for managing internet connections within embedded devices | package
i | libpixman-1-0            | Pixman: Pixel Manipulation library                                 | package
i | pcmanfm                  | pcmanfm version 0.9.8-r0                                           | package
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# ls
man-1.6f-r0.armv5te.rpm      man-dev-1.6f-r0.armv5te.rpm
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# rpm -ivh man-1.6f-r0.armv5te.rpm 
Preparing...                ########################################### [100%]
   1:man                    ########################################### [100%]
root@qemuarm:~# 
root@qemuarm:~# man
What manual page do you want?
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# zypper search man
Loading repository data...
Reading installed packages...
No packages found.
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# zypper search kernel
Loading repository data...
Reading installed packages...
No packages found.
root@qemuarm:~# 
#######################

After I installed man-dev-1.6f-r0.armv5te.rpm with RPM command, zypper search package can work again! And the &apos;man&apos; and &apos;man-dev&apos; packages can be recognized by zypper

######################
root@qemuarm:~# 
root@qemuarm:~# rpm -ivh man-dev-1.6f-r0.armv5te.rpm 
Preparing...                ########################################### [100%]
   1:man-dev                ########################################### [100%]
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# zypper search man
Loading repository data...
Reading installed packages...

S | Name                     | Summary                                                            | Type   
--+--------------------------+--------------------------------------------------------------------+--------
i | connman                  | A daemon for managing internet connections within embedded devices | package
i | connman-gnome            | connman-gnome version 0.5-r4                                       | package
i | connman-plugin-bluetooth | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-dnsproxy  | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-ethernet  | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-loopback  | A daemon for managing internet connections within embedded devices | package
i | connman-plugin-wifi      | A daemon for managing internet connections within embedded devices | package
i | libpixman-1-0            | Pixman: Pixel Manipulation library                                 | package
i | man                      | Online documentation tools                                         | package
i | man-dev                  | Online documentation tools - Development files                     | package
i | pcmanfm                  | pcmanfm version 0.9.8-r0                                           | package
root@qemuarm:~# 
root@qemuarm:~# 
########################

And I can remove man-dev package by zypper:
########################
root@qemuarm:~# zypper rm man-dev
Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be REMOVED:
  man-dev 

1 package to remove.
No additional space will be used or freed after the operation.
Continue? [y/n/?] (y): y
Removing man-dev-1.6f-r0 [done]
Additional rpm output:
error: cannot create %_repackage_dir /var/spool/repackage/1299357873


root@qemuarm:~# 
root@qemuarm:~#
###########################

However, after I removed &apos;man-dev&apos; package, zypper search package can not work again! So I can not removed &apos;man&apos; package by zypper.

##########################
root@qemuarm:~# zypper search man
Loading repository data...
Reading installed packages...
No packages found.
root@qemuarm:~# 
root@qemuarm:~#
root@qemuarm:~# rpm -qa|grep man
connman-plugin-loopback-0.65-r0.armv5te
connman-plugin-dnsproxy-0.65-r0.armv5te
connman-plugin-bluetooth-0.65-r0.armv5te
connman-plugin-wifi-0.65-r0.armv5te
connman-plugin-ethernet-0.65-r0.armv5te
libpixman-1-0-0.20.2-r0.armv5te
pcmanfm-0.9.8-r0.armv5te
connman-0.65-r0.armv5te
connman-gnome-0.5-r4.armv5te
man-1.6f-r0.armv5te
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# man
What manual page do you want?
root@qemuarm:~# 
root@qemuarm:~# 
root@qemuarm:~# zypper rm man
Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
Loading repository data...
Reading installed packages...
&apos;man&apos; not found in package names. Trying capabilities.
No provider of &apos;man&apos; found.
Resolving package dependencies...

Problem: This request will break your system!
  nothing provides requested glibc
Have you enabled all requested repositories?
 Solution 1: ignore the warning of a broken system (requires:glibc)

Choose the above solution using &apos;1&apos; or cancel using &apos;c&apos; [1/c] (c): 1
Resolving dependencies...
Resolving package dependencies...

Problem: This request will break your system!
  nothing provides requested glibc
Have you enabled all requested repositories?
 Solution 1: ignore the warning of a broken system (requires:glibc)

Choose the above solution using &apos;1&apos; or cancel using &apos;c&apos; [1/c] (c): c
root@qemuarm:~#
#######################

I did not add any repositories to zypper when I do these.

Reproduce Steps:
1. bootup target with qemuarm sato/sdk image. 
2. zypper search man and check the output.
3. download man-1.6f-r0.armv5te.rpm and man-dev-1.6f-r0.armv5te.rpm from http://autobuilder.yoctoproject.org/nightly/20110305-4/rpm/armv5te/, and copy them to target.
4. install man-1.6f-r0.armv5te.rpm with rpm command
4. zypper search man and check the output.
5. install man-dev-1.6f-r0.armv5te.rpm with rpm command.
6. zypper search man and check the output.
7. zypper rm man-dev and check the output.
8. zypper search man and check the output.
9. zypper rm man and check the output.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12759</commentid>
    <comment_count>1</comment_count>
    <who name="Qing He">qing.he</who>
    <bug_when>2011-03-17 06:23:13 +0000</bug_when>
    <thetext>problem was found that .armv5te.rpm don&apos;t appear in &quot;zypper search avahi&quot;.

If change &quot;arch = qemuarm&quot; to &quot;arch = armv5te&quot; in zypp.conf, these files will be shown.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12901</commentid>
    <comment_count>2</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2011-03-22 02:17:26 +0000</bug_when>
    <thetext>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  &quot;zypper pa&quot;, 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...
&apos;man&apos; not found in package names. Trying capabilities.
No provider of &apos;man&apos; found.
Resolving package dependencies...

Nothing to do.
root@qemuarm:~#
###############

If I change &quot;arch = qemuarm&quot; to &quot;arch = armv5te&quot; 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 &quot;zypper pa&quot; 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:~#
###################</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12914</commentid>
    <comment_count>3</comment_count>
    <who name="Qing He">qing.he</who>
    <bug_when>2011-03-22 19:03:37 +0000</bug_when>
    <thetext>This matches my observation, and currently arm is the only known arch to have this problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13062</commentid>
    <comment_count>4</comment_count>
    <who name="Qing He">qing.he</who>
    <bug_when>2011-03-31 03:37:34 +0000</bug_when>
    <thetext>The short answer is that there&apos;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;
-&gt;  zypp::Repository::Repository();
-&gt;  zypp::RepoInfo::RepoInfo();
-&gt;  zypp::RepoInfo::Impl::Impl();
-&gt;  zypp::repo::RepoVariablesUrlReplacer::RepoVariablesUrlReplacer();
-&gt;  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
&quot;static initialization order fiasco&quot;), since they belong to different
compilation units (read, .cc file).

On x86, we are fortunate that Arch_empty is init&apos;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&apos;s why zypper on arm fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13098</commentid>
    <comment_count>5</comment_count>
    <who name="Qing He">qing.he</who>
    <bug_when>2011-04-01 19:15:26 +0000</bug_when>
    <thetext>The original issue is fixed together with bug 490.
The new issue is now move to bug 938.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13158</commentid>
    <comment_count>6</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2011-04-06 23:56:09 +0000</bug_when>
    <thetext>Verify the bug with 20110404 build, it is fixed.

The commit number is f897723207b00b4c9dcdb43107891b7b82ce22f3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13159</commentid>
    <comment_count>7</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2011-04-06 23:57:23 +0000</bug_when>
    <thetext>Verify the bug with 20110404 build, it is fixed.

The commit number is f897723207b00b4c9dcdb43107891b7b82ce22f3</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>