Here is my analysis with a small code:

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

In my opinion glibc should be taken care to point to right signal.h when
an appln includes signal.h, I'm not sure which signal.h to use if we
include explicitely from #include "/usr/include/asm-powerpc/signal.h"
Test case works fine.

Conclusion: It does not seems to be 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/asm-powerpc/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/asm-powerpc/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


The same behavior on LE Ubuntu as well.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1267062

Title:
  LTP sigaltstack02 test failure -- MINSIGSTKSZ in userspace missmatches
  kernel (was: sigaltstack system call unable to send proper return code
  (error12))

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1267062/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to