[PATCH 0.9.33 0/7] Backport pread/pwrite fixes from master

2012-08-29 Thread Natanael Copa
I previously sent a bug report for pread/pwrite with a link to a
patch that i hacked up quick and dirty. This showed up to be severly
broken on x86_64 and corrupted several qemu disks images for me.

I see that this bad patch made it into 0.9.33 stabel tree. I think it
should be reverted and instead use cherry-picks from master. This is
what we currently use with success in Alpine Linux.

Tested on x86_64 and x86.


Mike Frysinger (2):
  pread/pwrite: handle renamed syscalls in common/ppc/xtensa code
  pread/pwrite: drop fallback funcs

Natanael Copa (1):
  Revert "pread/pwrite: backport fix"

Peter S. Mazinger (4):
  cancel.h: add generic file to ease cancellation support
  add cancellation to generic pread_write
  pread_write.c: make all archs use common code
  endian.h: add some handy macros to be used in syscalls

 Makefile.in  |   1 +
 include/cancel.h | 101 
 include/endian.h |  11 ++
 libc/sysdeps/linux/c6x/Makefile.arch |   3 +-
 libc/sysdeps/linux/c6x/pread_write.c | 103 
 libc/sysdeps/linux/common/pread_write.c  | 103 
 libc/sysdeps/linux/mips/pread_write.c| 116 ++
 libc/sysdeps/linux/powerpc/pread_write.c | 192 +-
 libc/sysdeps/linux/sh/pread_write.c  | 109 +++--
 libc/sysdeps/linux/xtensa/pread_write.c  | 195 +--
 10 files changed, 272 insertions(+), 662 deletions(-)
 create mode 100644 include/cancel.h
 delete mode 100644 libc/sysdeps/linux/c6x/pread_write.c

-- 
1.7.12

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH 0.9.33 0/7] Backport pread/pwrite fixes from master

2012-08-29 Thread Johannes Stezenbach
Hi Natanael,

On Wed, Aug 29, 2012 at 09:18:57AM +, Natanael Copa wrote:
> I previously sent a bug report for pread/pwrite with a link to a
> patch that i hacked up quick and dirty. This showed up to be severly
> broken on x86_64 and corrupted several qemu disks images for me.
> 
> I see that this bad patch made it into 0.9.33 stabel tree. I think it
> should be reverted and instead use cherry-picks from master. This is
> what we currently use with success in Alpine Linux.
> 
> Tested on x86_64 and x86.

I just built a toolchain for ARM from 0.9.33 stable branch
and I'm trying to figure out if the breakage is x86_64 only.
could you give more details what breaks and why?


Thanks,
Johannes
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH 0.9.33 0/7] Backport pread/pwrite fixes from master

2012-08-29 Thread Natanael Copa
On Wed, Aug 29, 2012 at 2:42 PM, Johannes Stezenbach  wrote:
> Hi Natanael,
>
> On Wed, Aug 29, 2012 at 09:18:57AM +, Natanael Copa wrote:
>> I previously sent a bug report for pread/pwrite with a link to a
>> patch that i hacked up quick and dirty. This showed up to be severly
>> broken on x86_64 and corrupted several qemu disks images for me.
>>
>> I see that this bad patch made it into 0.9.33 stabel tree. I think it
>> should be reverted and instead use cherry-picks from master. This is
>> what we currently use with success in Alpine Linux.
>>
>> Tested on x86_64 and x86.
>
> I just built a toolchain for ARM from 0.9.33 stable branch
> and I'm trying to figure out if the breakage is x86_64 only.
> could you give more details what breaks and why?

It is only 64bit that is broke. On 64bit it should be an alias to the
pread64/pwrite64 syscalls and not do the offset hi/lo stuff like it
need to do on 32bit. The result was that offsets bigger than 4G (or
2G?) got cutted. Typical 64 bit vs 32 bit bug.

-- 
Natanael Copa
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH 0.9.33 0/7] Backport pread/pwrite fixes from master

2012-08-29 Thread Rich Felker
On Wed, Aug 29, 2012 at 04:50:37PM +0200, Natanael Copa wrote:
> On Wed, Aug 29, 2012 at 2:42 PM, Johannes Stezenbach  wrote:
> > Hi Natanael,
> >
> > On Wed, Aug 29, 2012 at 09:18:57AM +, Natanael Copa wrote:
> >> I previously sent a bug report for pread/pwrite with a link to a
> >> patch that i hacked up quick and dirty. This showed up to be severly
> >> broken on x86_64 and corrupted several qemu disks images for me.
> >>
> >> I see that this bad patch made it into 0.9.33 stabel tree. I think it
> >> should be reverted and instead use cherry-picks from master. This is
> >> what we currently use with success in Alpine Linux.
> >>
> >> Tested on x86_64 and x86.
> >
> > I just built a toolchain for ARM from 0.9.33 stable branch
> > and I'm trying to figure out if the breakage is x86_64 only.
> > could you give more details what breaks and why?
> 
> It is only 64bit that is broke. On 64bit it should be an alias to the
> pread64/pwrite64 syscalls and not do the offset hi/lo stuff like it
> need to do on 32bit. The result was that offsets bigger than 4G (or
> 2G?) got cutted. Typical 64 bit vs 32 bit bug.

You might take a look at how we do it in musl; it's much simpler:

http://git.etalabs.net/cgi-bin/cgit.cgi?url=musl/tree/src/unistd/pread.c

The definition of __SYSCALL_LL_O expands correctly to put the long
long argument at the right slots for the target arch where there are
an odd number of arguments before the long long argument (it might
expand to a single long, for 64-bit archs, two longs, for 32-bit archs
with no alignment requirement, or 3 longs, the first being zero, for
32-bit archs where 64-bit arguments must be aligned on an even slot.

The same macro works for most syscalls that take long long arguments.

Rich
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc