nscd from glibc 2.1 miscompiled on Alpha

Thorsten Kukuk kukuk@suse.de
Mon May 24 10:16:00 GMT 1999


Hello,

I have a problem with all current egcs/gcc (2.95) versions/snapshot
on an Alpha running linux 2.2.7. It works on Intel without problems.

The nscd from glibc 2.1(.1) compiled with -O, -Os or -O2 doesn't work
correct or crashes. It works fine if I compile it without optimization, 
-O3 or -Ox -finline-functions.

The code which doesn't work is in glibc/nscd/cache.c (add_cache()):

  /* Put the new entry in the first position.  */
  do
    newp->next = table->array[hash];
  while (! compare_and_swap ((volatile long int *) &table->array[hash],
                             (long int) newp->next, (long int) newp)); 

It seems the compare_and_swap goes wrong and sometimes nscd seg.faults here,
the thread dies, or it ends in an endless loop. It will never execute the next
line.

How to repeat: Start nscd in debug mode: nscd -d
In another Window type: ls -al

nscd should crash here.

Sorry, I was not able to write an smaller testcase. This happens on
SuSE Linux 6.1 AXP (beta) and RedHat 6.0 Alpha.

  Thorsten

-- 
Thorsten Kukuk      http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE GmbH           Schanzaeckerstr. 10             90443 Nuernberg
Linux is like a Vorlon.  It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.


More information about the Gcc-bugs mailing list