Comment 10 for bug 1267062

Revision history for this message
Kalpana S Shetty (kalshett) wrote :

Here is my analysis with a small code:

Summary:
If we include signal.h from usr/include: MINSIGSTKSZ -----> 4096 ###TC case FAIL
If we explicitly include signal.h from ppc64le : MINSIGSTKSZ -----> 4096 ###TC case PASS

In my opinion glibc should be taken care to point to right signal.h when an appln includes signal.h, in this case when appln include "signal.h" it should be taken from --> "/usr/include/powerpc64le-linux-gnu/asm/signal.h" NOT from "/usr/include/signal.h".

Conclusion: I do not see this is a test case issue.

root@ubuntuk60:~# cat s1.c
/*
 * TC1:
 * sigaltstack() should fails and sets errno to ENOMEM when the size of alternate
 * stack area is less than MINSIGSTKSZ.
*/
#include <stdio.h>
//#include <signal.h>
#include "/usr/include/powerpc64le-linux-gnu/asm/signal.h"
#include <errno.h>

int main()
{
 stack_t sigstk; /* signal stack storing struct. */
 int rc;

 sigstk.ss_size = MINSIGSTKSZ - 1;
 sigstk.ss_flags = 0;

 printf ("MINSTKSZ = %d\n", MINSIGSTKSZ);
 /* Verify sigaltstack() fails and sets errno */
 rc = sigaltstack(&sigstk, (stack_t *) 0);
 if (rc < 0)
 {
  // TC pass if rc < 0
  printf ("FAILED: rc = %d, errono = %d\n", rc, errno);
 }
 else {
  printf ("PASS: rc = %d, errono = %d\n", rc, errno);
 }
}

output TC PASS: used with "#include "/usr/include/powerpc64le-linux-gnu/asm/signal.h"
root@ubuntuk60:~# ./a.out
MINSTKSZ = 2048
FAILED: rc = -1, errono = 12

output TC FAILED: used with #include <signal.h>
root@ubuntuk60:~# ./a.out
MINSTKSZ = 4096
PASS: rc = 0, errono = 0