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

current
Discussion topic

Back to topic list

Re: Fix for crash in up2date

Reply

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:

   <array><data>
   <value><str​ing>XFree86-compa​t-modules</string​></value>
   <value><str​ing>3.3.6</str​ing></value​>
   <value><str​ing>44</string​></value>
   <value><str​ing></string​></value>
   <value><str​ing>i386</stri​ng></value>​
   <value><str​ing>XFree86-Sun​</string></va​lue>
   <value><str​ing>3.3.6-44</​string></value​>
   <value><str​ing>2</string​></value>
   </data></array>

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

   <array><data>
   <value><str​ing>XFree86-compa​t-modules</string​></value>
   <value><str​ing>3.3.6</str​ing></value​>
   <value><str​ing>44</string​></value>
   <value><str​ing></string​></value>
   <value><str​ing>i386</stri​ng></value>​
   <value><str​ing>XFree86-Sun24​</string></​value>
   <value><str​ing>2</string​></value>
   <value><str​ing>3.3.6-44</​string></value​>
   </data></array>

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

--
Tom Hughes (thh at cyberscience dot com)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
Attachments

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

Messages

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: