This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem in aio_notify.c in glibc 2.1.92?


Hi,

For the sake of argument, gdb shows the following.  On ppc on entry to
callback register r3 has the value 27 (the value of sival_int!) it then
treats this a pointer to a union and tries to access memory via lwz
r0,0(r3) and segfaults (the very first line of code in callback).

We on ppc seem to be passing the value of the sival_int but expecting a
pointer. This jives with what Geoff said about the ABI.

So how do we fix this?

Thanks,

Kevin


At 2:08 AM -0700 8/15/00, Geoff Keating wrote:
>> Date: Mon, 14 Aug 2000 23:39:05 -0700 (PDT)
>> From: Kaz Kylheku <kaz@ashi.footprints.net>
>
>> Note that the target callback receives a parameter of type sigval_t,
>> which is a union, and returns void.  Whereas a proper thread
>> function used by pthread create has type void *(void *).
>
>> The motivation for the trick is understandable, since it eliminates
>> the need for a bounce function to be passed to pthread create which
>> would process the argument.  Maybe the type system abuse is not
>> working on the PPC target of the compiler version you are using?
>
>Indeed this is the problem.  The SVR4 ABI specifies that structure and
>union arguments are passed by passing a pointer to a copy of the
>structure.  So this trick will not work on powerpc.
>
>--
>- Geoffrey Keating <geoffk@cygnus.com>




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]