[Apt-Rpm] apt-rpm bug fixes

Ryan Burns rburns at mvista.com
Thu Jan 10 12:56:24 PST 2008


Hi Panu, 

Don't worry about the late response, it took me a quite a while get around
to submitting those patches :) Thanks for applying them. 

On the arm alignment issues, I corrected the md5 patch to follow what was
done in sha1.h and verified that it still fixes the issue. 

And for the bool alignment, I completely agree with you that having to align a
bool seems very wrong, but it is indeed required in this case. The general
problem is that gcc4+ no longer handles alignment for the programer. IIRC, the
community's reasoning is that the C standard specifies that alignment is up to
the programmer, and therefore it is unnecessary for the compiler to help with
this. (Sorry, I can find the link I was given to the section of the standard
that talks about it). I guess in previous versions of gcc, they were just "kind
enough" to handle the most common cases for us. Long story short is that the
bool is not aligned and unlike x86, arm doesn't allow for unaligned access. 

Attached is a corrected patch based on your suggestions.

Thanks again.
Ryan


On Fri, 4 Jan 2008 17:03:47 +0200 (EET)
Panu Matilainen <pmatilai at laiskiainen.org> wrote:

> On Tue, 27 Nov 2007, Ryan Burns wrote:
> 
> > Hello,
> 
> Hi, and apologies for very late response...
> 
> > I have a handful of misc bug fixes for apt-rpm. They were originally 
> > found against 0.5.15lorg3.2, but I've updated them so that they apply 
> > cleanly to your git tree.
> >
> > I've also consolidated the patches into one, but left their descriptions 
> > intact in case you want to pick an choose them. Please let me know if 
> > you need me to make any changes before applying them.
> 
> Parts I just applied, a few comments:
> 
> - Garbled output (I haven't seen garbled output myself but...) patch
>    applied with slight modification to use memset() instead of the legacy
>    bzero()
> 
> - Http password handling applied, can't easily test this so I'll just
>    take your word for it ;)
> 
> - Mips64 arch addition applied
> 
> - Absolute state dir "applied", except I rewrote it to explicitly check
>    and error out on the spot if the configured statedir isn't present
>    (it'd bail out later anyway but the sooner we error out the better),
>    in any case it no longer falls back to the ancient /var/state/apt dir.
> 
> - For the same source package downloaded multiple times, I applied a
>    simpler fix from Debian apt (using a set) - anyway thanks for pointing
>    out the issue.
> 
> - The remaining bits wrt ARM cpus I find a bit troublesome:
>    I don't want to have C99 requirement for apt-rpm, it gets put and used
>    on very very old systems where inttypes.h isn't available. Wouldn't
>    __attribute__((aligned...)) work for md5.h too? (see sha1.h which is
>    more or less similar)
> 
>    Having to add aligns for a regular "bool" (the HideEpochs thingy) just
>    seems plain wrong... but then I'm totally clueless about the ARM
>    architecture. Care to enlighten me? :)
> 
> Oh and thanks for the patch(es)!
> 
>  	- Panu -
> _______________________________________________
> Apt-Rpm mailing list
> Apt-Rpm at lists.laiskiainen.org
> http://lists.laiskiainen.org/listinfo.cgi/apt-rpm-laiskiainen.org


-- 
Ryan Burns <rburns at mvista.com>
MontaVista Software, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apt-rpm_fix_alignment.patch
Type: text/x-diff
Size: 1432 bytes
Desc: not available
URL: <http://lists.laiskiainen.org/pipermail/apt-rpm-laiskiainen.org/attachments/20080110/6bfc1d43/attachment-0003.patch>


More information about the Apt-Rpm mailing list