On Tue, Nov 04, 2008 at 09:22:45PM +0100, Daniel Baumann wrote:
> > $ gdb /usr/sbin/rvmutl
> > GNU gdb 6.8-debian
> > ...
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x00007f4d179e59d8 in makecontext () from /lib/libc.so.6
> >
> > I expect it may be AMD64-related because this works fine on an x86 box.
>
> likely (am not using coda and related tools on amd64 myself), let's see
> if Jan has any insight.
Yes, the libc version of makecontext is (was?) broken on amd64 and it
was corrupting pointers passed as arguments. I think the high bits of
the pointer were either cleared or filled with random data, not sure
anymore.
There is a configure test CODA_CHECK_MAKECONTEXT which tries to detect
if makecontext fails to correctly pass a pointer,
void *ptr;
#define SSIZE 32768
void test(void *arg)
{
exit(ptr != arg);
}
int main(int argc, char **argv)
{
ucontext_t x;
static void *stack = NULL;
int arg = 0;
ptr = &arg;
getcontext(&x);
if (stack == NULL) {
x.uc_stack.ss_sp = stack = malloc(SSIZE);
x.uc_stack.ss_size = SSIZE;
makecontext(&x, (void (*)(void))test, 1, &arg);
setcontext(&x);
}
exit(2);
}
This tries to catch 3 possible cases,
1) makecontext failed completely, so setcontext loops back to the state
saved by getcontext and we return with exit code 2.
2) makecontext worked, but the passed pointer argument was corrupted
and doesn't match the copy in a global variable, return with exit 1.
3) makecontext worked correctly, no corrupted arguments, exit 0.
It could be that the configure test failed to detect the problem, or
that it has been fixed in a current libc6 as it is clearly trying to use
the libc6 makecontext function and not a workaround. Maybe liblwp was
built against a working version of libc6, but the installed one is
broken?
Jan
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]