lockup in 2.1.42

Ulrich Drepper (drepper@ipd.info.uni-karlsruhe.de)
17 Aug 1997 23:47:54 +0200


I'm still using .42 and cannot risk using a more recent kernel. With
.42 and the following little program I get on ix86 a solid kernel
hang. Could somebody please check whether this is fixed in the
current version? (I use glibc and I'm not at all sure the program is
correct but I'm pretty sure the kernel should not hang.)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <signal.h>
#include <sigcontext.h>
#include <stdio.h>

int
default_stack_flt_handler(int signr, struct sigcontext_struct sig)
{
int regnr = (sig.fpstate->sw & 0x3800) >> 11;
printf("got FPU stack fault %p\n", (void *)sig.fpstate->ipoff);
sig.fpstate->sw &= ~0x3f;
sig.fpstate->_st[regnr].significand[0] = 0;
sig.fpstate->_st[regnr].significand[1] = 0;
sig.fpstate->_st[regnr].significand[2] = 0;
sig.fpstate->_st[regnr].significand[3] = 0x8000;
sig.fpstate->_st[regnr].exponent = 0x3fff;

sigreturn (&sig);
return 1;
}

int
main (int argc, char argv[])
{
struct sigaction sa;

__setfpucw (0x1340);

sa.sa_handler = default_stack_flt_handler;
sa.sa_flags = 0;
sa.sa_restorer = NULL;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGFPE);
sigaction (SIGFPE, &sa, NULL);

return (int) (((double) argc) / ((double) ((argc < 100) - 1)));
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- Uli
---------------. drepper@cygnus.com ,-. Rubensstrasse 5
Ulrich Drepper \ ,-------------------' \ 76149 Karlsruhe/Germany
Cygnus Solutions `--' drepper@gnu.ai.mit.edu `------------------------