Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: Fix for crash in up2date

Project highlights: Stable Version: 1.6.1, Development Version: 1.7.6

Discussion topic

2020-04-07: This site is going to be decommissioned and shut down on 2020-07-01. Please copy and archive any data you wish to keep before that date.

Back to topic list

Re: Fix for crash in up2date


Author Tom Hughes <thh at cyberscience dot com>
Full name Tom Hughes <thh at cyberscience dot com>
Date 2003-06-28 05:03:57 PDT
Message I've just seen the thread on the list reporting the crash in up2date
when it attempts to find obsoleteing packages. As it happens I ran into
this last night and I believe I've tracked down the cause.

I'm running 1.5.5rc1 and the problem appears to be that current is
return the version and flags (aka sense) fields the wrong way round
in the getObsoletes response. Consider this entry from the obsoletes
file on a 7.3 box, as fetched from the RHN server:


Now compare it to the same entry as fetched from my current server:


Notice that the last two fields are the opposite way around. If we
look at src/current/db/postg​res/postgres.py, we can see that it is
executing this query:

   select package.pkgname, package.version,
   package.release, package.epoch, rpm.arch,
   rpmobsolete.name, rpmobsolete.flags, rpmobsolete.vers
   from package, rpmobsolete, rpm
   inner join channel on (rpm.active_channel_id = channel.channel_id)
   where channel.label = '%s'
   and package.package_id = rpm.package_id
   and rpm.rpm_id = rpmobsolete.rpm_id
   order by package.pkgname

So in that query, the flags are returned before the version, but in
the client source we see this:

  obsName, obsVersion, obsSense = obs[5:]

Which is extracting the last three fields from the message and expects
the version to come before the flags (called sense in the client) and
this is why the client then crashes because the sense value is not valid.

Attached is a patch against 1.5.5rc1 to reverse the fields in the
select statement, which seems to have fixed the problem for me.


Tom Hughes (thh at cyberscience dot com)
Software Engineer, Cyberscience Corporation

« Previous message in topic | 1 of 1 | Next message in topic »


Show all messages in topic

Re: Fix for crash in up2date Tom Hughes <thh at cyberscience dot com> Tom Hughes <thh at cyberscience dot com> 2003-06-28 05:03:57 PDT
Messages per page: