Re: Bug#153948: Need help with afio on powerpc
I had to make a big diagram of the thread in order to understand
everything. Now I want to summarise where we are, as far as I can
determine, and then add some new points.
0) linux 64 bit file support is still a bit of a mess, see the afio
1) in Debian afio 2.4.7-3. Dirk E set options -D_FILE_OFFSET_BITS=64
D_LARGEFILE_SOURCE + in order write archives larger than 2gb. If this
is used, then off_t gets to be 64 bits, (maybe inode_t also?), which
seems (so far) harmless on intel, but on powerpc triggers bugs due to
2) Dieter S reported such a cast related bug, this was fixed by
changing some sprintf statements to cast the argument asb->sb_size
to (long int) asb->sb_size. This is debian bug 144986
3) Stephen van Egmond also had problems with afio 2.4.7-3,
investigations led to the identification of one other casting
related bug, in that a call to inalloc() did not apply the right
conversion, this can be fixed by changing:
afio.h: void inalloc(off_t)
afio.c: STATIC void inalloc(off_t len)
4) Stephan also made some other changes to eliminate warnings
and add full declarations on the .h file etc. this led to
Dirk producing a version 2.4.7-6 on
5) Dieter S still reports (on 30 Jul) that this above 2.4.7-6 has `the
same error' which is an error in executing the -t option. This is
worrying, and maybe Dieter wants to produce a test case for Stephen
to try to reproduce on his powerpc installation.
numbers 3-5 are captured in the logs of debian bug 153948
Now for some additions of my own:
6) I agree completely with Stephen's conclusions that there may be
more endianness bugs lurking, so in the short term, I recommend to
Dirk that any afio release on debian that pretends to be stable
should omit the -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE options
in the powerpc builds so as to avoid any endianness bugs.
7) Stephen recommends modernising the code base, I agree with this,
and notice that already some modernisation was done in the massive
patch file that produces 2.4.7-6.
8) HOWEVER some parts of this patch I do not want to fold into the
main afio tree, in particular I do not want to have any assumption
that printf/scanf can deal with 64 bit ints at all, because (from
experience!) I know that this would cause lots of pain on some
non-gcc non-linux platforms. So I will (have to) do my own
modernisation, warning, etc pass based on the patch file.
9) Depending on the weather. i.e. if we get a few rainy days, (and I
am not in California but in Holland right now), I might soon
release a modernised afio source base to Dirk, so that we can avoid
a futher branching between my afio code base and Dirk's afio/debian
revisions. No hard promises or deadlines though.
Please tell me if I missed anything important. Are the patches in
point 4 still the latest ones?
In terms of me getting access to a powerpc machine: I don't want to
have it right now, but if I get going on this (and depending on the
weather) I might want to later.