Re: PATCH - x86-64 signed-compare bug, was Re: select() setting ERESTARTNOHAND (514).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday January 11, [email protected] wrote:
> > Just a 'me too' at this point. 
> > The X server on my shiny new notebook (Core 2 Duo) occasionally dies
> > with 'select' repeatedly returning ERESTARTNOHAND.  It is most
> > annoying!
> 
> Normally it should be only visible in strace. Did you see it without
> strace?

No, only in strace.

> 
> > 
> > You don't mention in the Email which kernel version you use but I see
> > from the web page you reference it is 2.6.19.1.  I'm using
> > 2.6.18.something.
> > 
> > I thought I'd have a quick look at the code, comparing i386 to x86-64
> > and guess what I found.....
> > 
> > On x86-64, regs->rax is "unsigned long", so the following is
> > needed....
> 
> regs->rax is unsigned long.
> I don't think your patch will make any difference. What do you think
> it will change?

If regs->rax is unsigned long, then I would think the compiler would
be allowed to convert

   switch (regs->rax) {
	case -514 : whatever;
   }

to a no-op, as regs->rax will never have a negative value.

However it appears that the current compiler doesn't make that
optimisation so I guess I was too hasty.

Still, I think it would be safer to have the cast, in case the compiler
decided to be clever.... or does the C standard ensure against that?

Sorry for the noise,

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux