smart fails on rpm with empty Provides:

Bug #302345 reported by Anders F Björklund
2
Affects Status Importance Assigned to Milestone
Smart Package Manager
Fix Released
Undecided
Gustavo Niemeyer
smart (Fedora)
Fix Released
High

Bug Description

Traceback (most recent call last):
  File "/usr/bin/smart", line 195, in <module>
    main(sys.argv[1:])
  File "/usr/bin/smart", line 168, in main
    exitcode = iface.run(opts.command, opts.argv)
  File "/usr/lib/python2.5/site-packages/smart/interface.py", line 53, in run
    result = _command.main(self._ctrl, opts)
  File "/usr/lib/python2.5/site-packages/smart/commands/nothing.py", line 36, in main
    ctrl.reloadChannels()
  File "/usr/lib/python2.5/site-packages/smart/control.py", line 378, in reloadChannels
    self._cache.load()
  File "/usr/lib/python2.5/site-packages/smart/backends/rpm/header.py", line 300, in load
    prvargs, reqargs, upgargs, cnfargs)
  File "/usr/lib/python2.5/site-packages/smart/backends/rpm/base.py", line 108, in equals
    fk([x for x in self.provides if x.name[0] != "/"]) !=
IndexError: string index out of range

http://download.fedora.redhat.com/pub/fedora/linux/releases/10/Fedora/i386/os/Packages/opal-3.4.2-1.fc10.i386.rpm
  ...
  <rpmTag name="Providename">
 <string/>
 <string>g726</string>
 <string>gsm0610</string>
 ...
  <rpmTag name="Rpmversion">
 <string>4.6.0-rc1</string>
  </rpmTag>
  ...

Related branches

Revision history for this message
Anders F Björklund (afb) wrote :

Workaround, show warning instead of traceback

Revision history for this message
Anders F Björklund (afb) wrote :

Allowing this package in later caused cdistance.so to segfault when comparing against it... :-(

Revision history for this message
In , William (william-redhat-bugs) wrote :

Created attachment 324832
terminal log showing the problem

Description of problem:

When fedora.channel is added and channels are updated, a python error "IndexError: string index out of range" occurs. See attachment for log of commands leading up to this.

Version-Release number of selected component (if applicable):

smart-1.1 in Fedora f10

How reproducible:

always

Steps to Reproduce:

1. Install smart, start with one channel in /etc/smart/channels(e.g. fedora-updates)
2. smart update
   (all goes well, cache is updated)
3. add (standard version) fedora.channel to /etc/smart/channels
4. smart update
   repo data is read successfully; after cache update begins, trouble

Actual results:

smart crashes with a python "string" error

Expected results:

cache update should complete successfully

Revision history for this message
Anders F Björklund (afb) wrote :
Changed in smart:
milestone: none → 1.2
Changed in smart:
status: Unknown → Confirmed
Revision history for this message
In , William (william-redhat-bugs) wrote :

I have confirmed that this does not occur on x86_64 (f10). Since it looks likely that this bug is triggered by data from the download site, I added in a little debug code to base.py at line 101, viz:
        try:
         if (len(self.upgrades) != len(other.upgrades) or
            len(self.conflicts) != len(other.conflicts) or
            fk(self.upgrades) != fk(other.upgrades) or
            fk(self.conflicts) != fk(other.conflicts) or
            fk([x for x in self.provides if x.name[0] != "/"]) !=
            fk([x for x in other.provides if x.name[0] != "/"])):
            return False
        except:
         print
         print "Name: ", self.name
         print "Version: ", self.version
         print "Upgrades: ", self.upgrades
         print "Conflicts:", self.conflicts
         print other.provides
         print self.provides
         raise

resulting in the following output:
Loading cache...
Updating cache... ################ ( 39%)
Name: opal
Version: 3.4.2-1.fc10@i386
Upgrades: [opal < 3.4.2-1.fc10@i386, openh323]
Conflicts: [openh323]
[lpc10, opal = 3.4.2-1.fc10@i386, h261-vic, libopal.so.3.4.2, gsm0610, g726, , opal(x86-32) = 3.4.2-1.fc10, ima_adpcm, theora, vpb, gsmamrcodec, speexcodec, h263-ffmpeg]
[lpc10, opal = 3.4.2-1.fc10@i386, h261-vic, libopal.so.3.4.2, gsm0610, g726, opal(x86-32) = 3.4.2-1.fc10, ima_adpcm, theora, vpb, gsmamrcodec, speexcodec, h263-ffmpeg]
Traceback (most recent call last):
(remainder of traceback as previously shown)

I guess this shows that the extra empty element following 'g726' is the culprit. Unfortunately, that has reached the outer limits of my knowledge, since I have absolutely no idea what all this represents, much less whether it is right or wrong :-).

Let me know if I can help in any way.

Revision history for this message
In , Kelvin (kelvin-redhat-bugs) wrote :

I can confirm that this also happens if you make a local archive of the Everything packages and repo and use that instead.

If you then rebuild a new repo using createrepo, the same thing also happens. Basically, there is something in smart that is not handling the rpm-md data.

Revision history for this message
In , Axel (axel-redhat-bugs) wrote :

(In reply to comment #1)
> print other.provides

> [lpc10, opal = 3.4.2-1.fc10@i386, h261-vic, libopal.so.3.4.2, gsm0610, g726, ,
> opal(x86-32) = 3.4.2-1.fc10, ima_adpcm, theora, vpb, gsmamrcodec, speexcodec,
> h263-ffmpeg]

> I guess this shows that the extra empty element following 'g726' is the
> culprit. Unfortunately, that has reached the outer limits of my knowledge,
> since I have absolutely no idea what all this represents, much less whether it
> is right or wrong :-).
>
> Let me know if I can help in any way.

Great debugging! This seems to be the empty Provides: bug that is submitted here:

https://bugs.launchpad.net/smart/+bug/302345

Actually the report there mentions the same package, so it's rather 100% the same bug, and the better news is that there is a fix there available as well.

New build are underway and will close this bug once they hit the update repo.

Thanks for reporting and analysis!

Revision history for this message
In , Axel (axel-redhat-bugs) wrote :

Changing to the upstream bug summary.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/smart-1.1-58.fc9

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/smart-1.1-58.fc8

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/smart-1.1-58.fc10

Revision history for this message
In , Anders (anders-redhat-bugs) wrote :

The broken "opal" package was reported as Bug #473084

Changed in smart:
status: Confirmed → In Progress
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , William (william-redhat-bugs) wrote :

After upgrading to smart-1.1-58.fc10, I find that the version of base.py included in the package does NOT smart-emptyprov.diff from https://bugs.launchpad.net/smart/+bug/302345, hence the problem persists.
[root@bbsuper rpm]# pwd
/usr/lib/python2.5/site-packages/smart/backends/rpm
[root@bbsuper rpm]# ls -l base.py
-rw-r--r-- 1 root root 10446 2008-09-09 04:28 base.py
[root@bbsuper rpm]# rpm -qf base.py
smart-1.1-58.fc10.i386

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.0.1.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/smart-1.1-58.0.1.fc10

Revision history for this message
In , Axel (axel-redhat-bugs) wrote :

(In reply to comment #13)
> After upgrading to smart-1.1-58.fc10, I find that the version of base.py
> included in the package does NOT smart-emptyprov.diff from
> https://bugs.launchpad.net/smart/+bug/302345, hence the problem persists.

For some reason the patch with the bugfixes was empty for F10. I resubmitted a build and update for F10.

Revision history for this message
In , Axel (axel-redhat-bugs) wrote :

*** Bug 475779 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

smart-1.1-58.0.1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.

Changed in smart:
status: In Progress → Fix Released
Revision history for this message
In , William (william-redhat-bugs) wrote :

Confirmed, problem is fixed with this latest update. Thanks!

Changed in smart:
milestone: 1.2 → 1.1.2
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Patch applied in trunk, with additional testing.

Changed in smart:
assignee: nobody → niemeyer
status: New → Fix Committed
Revision history for this message
Anders F Björklund (afb) wrote :

Released, 2009-03-04

Changed in smart:
status: Fix Committed → Fix Released
Changed in smart (Fedora):
importance: Unknown → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.