where is the bug?

where is the bug?

Post by Eric Raib » Thu, 25 Mar 1993 00:24:54



On my SGI Indigo running 4.0.1e, this command:

  echo 'SHELL = /bin/sh\n\nfoo:\n\t/bin/echo $(CFLAGS) > out' | make -f -

correctly creates a file 'out' that contains CFLAGS.

However this one (which uses csh instead of sh)

  echo 'SHELL = /bin/csh\n\nfoo:\n\t/bin/echo $(CFLAGS) > out' | make -f -

incorrectly echos CFLAGS to stdout, and creates an empty file 'out'.

So is the bug in make or csh?

Please include me by email in any responses, as I don't read this group.


 
 
 

1. bug in thr_keycreate ? or am I clueless ?

Hi there. I've been working with the solaris thread package and I'm having
some problems with the thr_keycreate function call. This function is used
to create thread specific data. The arguments are a pointer to a  thread_key_t
variable where the created key will be stored and a pointer to a destrucutor
function call. It seems however that thr_keycreate only works properly if
the  thread_key_t is initialized to 0. If it's not then no key will
be created but the function call will not return any error. There is
(to my knowledge) no reference to this kind of beahviour in the manuals, so
is this a bug a feature or am I missing something here ?

The progam below ilustrates what I mean.

The output is :

   Error x1: 22 (EINVAL = 22)
   Error x2: 22 (EINVAL = 22)

and the compile line is :

   cc -g -D _REENTRANT create_thread.c -lthread

I know that  thread_key_t are supposed to be globals and in that case
we can count on them be initialized to 0 ( can we ?) but what if
we want to allocate memory to the key at run time ? do we have to
iniatialize it ?

Thanks for reading

#include <thread.h>
#include <stdlib.h>
#include <errno.h>

main ()
{  

  int ret;
  int data1 = 12345678;
  int data2 = 22345678;
  int data3 = 32345678;
  int data4 = 42345678;

  thread_key_t k1 = 0 , k2 = 0;
  thread_key_t x1 = -1 , x2 = -11;

  ret = thr_keycreate (&k1, NULL);
  ret = thr_setspecific (k1,&data1);
  if (ret != 0)
    printf ("Error k1: %d (EINVAL = %d)\n", ret, EINVAL);

  ret = thr_keycreate (&k2, NULL);
  ret = thr_setspecific (k2,&data2);
  if (ret != 0)
    printf ("Error k2: %d (EINVAL = %d)\n", ret, EINVAL);

  ret = thr_keycreate (&x1, NULL);
  ret = thr_setspecific (x1,&data3);
  if (ret != 0)
    printf ("Error x1: %d (EINVAL = %d)\n", ret, EINVAL);

  ret = thr_keycreate (&x2, NULL);
  ret = thr_setspecific (x2,&data4);
  if (ret != 0)
    printf ("Error x2: %d (EINVAL = %d)\n", ret, EINVAL);

2. Bull Estrella Series 300 / Lan Adapter?

3. Bug in cardbus initialization, or am I missing something?

4. Anyone try Qt?

5. Is this a bug or am I ...

6. What Linux and BSD Dist. support Lucent Winmodem?

7. Am I stupid or is this a bug in gcc ?

8. kde

9. am-utils or kernel bug ?

10. Did I find a bug in egrep or am I misreading the man page?

11. ipchains BUG?? or Am I losing it?

12. syslog full of kernel BUGs - why am I being ignored?

13. Is this a bug or am I loosing it....