All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [LTP] Compile failure with rt_sigaction on amd64
@ 2009-07-07 12:46 naresh kamboju
  2009-07-07 16:06 ` Garrett Cooper
  0 siblings, 1 reply; 9+ messages in thread
From: naresh kamboju @ 2009-07-07 12:46 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 2965 bytes --]

Hi Garrett Cooper,

Thanks for your info.

>Oops... looks like someone forgot __amd64__ / >__ia64__:

yes.
i forgot to add these ARCH.
Because I am not having this Architecture at my end :-(

>gcc -g -O2 -I../../include -g -Wall -I../../../../include >-Wall -O2 -W
>rt_sigaction01.c -L../../../../lib -lltp -o rt_sigaction01
>rt_sigaction01.c: In function 'set_handler':
>rt_sigaction01.c:147: error: 'SIGSETSIZE' >undeclared .(first use in
>this function)
>rt_sigaction01.c:147: error: (Each undeclared >identifier is reported only once
>rt_sigaction01.c:147: error: for each function it >appears in.)
>make[4]: *** [rt_sigaction01] Error 1

>I tried using sizeof(sigaction_t), but unfortunately the >results for
>the testcase(s) on my system were always EINVAL. >This issue wasn't
>present a few days ago...

>Any ideas?


I have made a patch to fix this issue please review the this temporary fix.

In my previous mail I have stated that sigset size (size_t sigsetsize)
will be different for Different ARCH. It is depending on
_COMPAT_NSIG_WORDS Macro.

We have to conform how its different with respect to ARCH and need to
have a generic solution to fix this issue.

I think its going to be an issue othere than __arm__ || __i386__ ||
__powerpc__ || __amd64__ || __ia64__ and __mips__

There are different ARCH are being used by our LTP developers.

I’ll investigate this issue and come back with generic Solution to
support most of the ARCH.


please refer this linux-2.6.30/include/linux/compat.h

http://lxr.linux.no/linux+v2.6.30/include/linux/compat.h#L75

#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)

typedef struct {
compat_sigset_word sig[_COMPAT_NSIG_WORDS];
} compat_sigset_t;

Your suggestions are welcome ... :)


Best regards
Naresh Kamboju

Signed-off-by: Naresh Kamboju < naresh.kernel@gm... >

diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
16:58:11.000000000 +0530
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
16:59:38.000000000 +0530
@@ -59,7 +59,7 @@
#define SIGSETSIZE 16
#endif

-#if defined __arm__ || __i386__ || __powerpc__
+#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
#define SIGSETSIZE 8
#endif

diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
16:58:11.000000000 +0530
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
16:59:48.000000000 +0530
@@ -55,7 +55,7 @@
#define SIGSETSIZE 16
#endif

-#if defined __arm__ || __i386__ || __powerpc__
+#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
#define SIGSETSIZE 8
#endif

[-- Attachment #2: ltp-fix-rt_sigaction.patch --]
[-- Type: application/octet-stream, Size: 1056 bytes --]

diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c	2009-07-07 16:58:11.000000000 +0530
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c	2009-07-07 16:59:38.000000000 +0530
@@ -59,7 +59,7 @@
 #define SIGSETSIZE 16
 #endif
 
-#if defined __arm__ || __i386__ || __powerpc__
+#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
 #define SIGSETSIZE 8
 #endif
 
diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c	2009-07-07 16:58:11.000000000 +0530
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c	2009-07-07 16:59:48.000000000 +0530
@@ -55,7 +55,7 @@
 #define SIGSETSIZE 16
 #endif
 
-#if defined __arm__ || __i386__ || __powerpc__
+#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
 #define SIGSETSIZE 8
 #endif
 

[-- Attachment #3: Type: text/plain, Size: 390 bytes --]

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] Compile failure with rt_sigaction on amd64
  2009-07-07 12:46 [LTP] Compile failure with rt_sigaction on amd64 naresh kamboju
@ 2009-07-07 16:06 ` Garrett Cooper
  2009-07-09 14:50   ` naresh kamboju
  0 siblings, 1 reply; 9+ messages in thread
From: Garrett Cooper @ 2009-07-07 16:06 UTC (permalink / raw)
  To: naresh kamboju; +Cc: ltp-list

On Tue, Jul 7, 2009 at 5:46 AM, naresh kamboju<naresh.kernel@gmail.com> wrote:
> Hi Garrett Cooper,
>
> Thanks for your info.
>
>>Oops... looks like someone forgot __amd64__ / >__ia64__:
>
> yes.
> i forgot to add these ARCH.
> Because I am not having this Architecture at my end :-(
>
>>gcc -g -O2 -I../../include -g -Wall -I../../../../include >-Wall -O2 -W
>>rt_sigaction01.c -L../../../../lib -lltp -o rt_sigaction01
>>rt_sigaction01.c: In function 'set_handler':
>>rt_sigaction01.c:147: error: 'SIGSETSIZE' >undeclared .(first use in
>>this function)
>>rt_sigaction01.c:147: error: (Each undeclared >identifier is reported only once
>>rt_sigaction01.c:147: error: for each function it >appears in.)
>>make[4]: *** [rt_sigaction01] Error 1
>
>>I tried using sizeof(sigaction_t), but unfortunately the >results for
>>the testcase(s) on my system were always EINVAL. >This issue wasn't
>>present a few days ago...
>
>>Any ideas?
>
>
> I have made a patch to fix this issue please review the this temporary fix.
>
> In my previous mail I have stated that sigset size (size_t sigsetsize)
> will be different for Different ARCH. It is depending on
> _COMPAT_NSIG_WORDS Macro.
>
> We have to conform how its different with respect to ARCH and need to
> have a generic solution to fix this issue.
>
> I think its going to be an issue othere than __arm__ || __i386__ ||
> __powerpc__ || __amd64__ || __ia64__ and __mips__
>
> There are different ARCH are being used by our LTP developers.
>
> I’ll investigate this issue and come back with generic Solution to
> support most of the ARCH.
>
>
> please refer this linux-2.6.30/include/linux/compat.h
>
> http://lxr.linux.no/linux+v2.6.30/include/linux/compat.h#L75
>
> #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
>
> typedef struct {
> compat_sigset_word sig[_COMPAT_NSIG_WORDS];
> } compat_sigset_t;
>
> Your suggestions are welcome ... :)
>
>
> Best regards
> Naresh Kamboju
>
> Signed-off-by: Naresh Kamboju < naresh.kernel@gm... >
>
> diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
> b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
> --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
> 16:58:11.000000000 +0530
> +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
> 16:59:38.000000000 +0530
> @@ -59,7 +59,7 @@
> #define SIGSETSIZE 16
> #endif
>
> -#if defined __arm__ || __i386__ || __powerpc__
> +#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
> #define SIGSETSIZE 8
> #endif
>
> diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
> b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
> --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
> 16:58:11.000000000 +0530
> +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
> 16:59:48.000000000 +0530
> @@ -55,7 +55,7 @@
> #define SIGSETSIZE 16
> #endif
>
> -#if defined __arm__ || __i386__ || __powerpc__
> +#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
> #define SIGSETSIZE 8
> #endif

Interesting. I checked the kernel sources and it appears that __mips__
is the only odd man out.

Here's what I did (similar to what you did above, but I hardcoded
values because you can't determine the actual values from compat.h
without kernel sources AFAIK).

It might be wiser to move to a general purpose header, btw...

Thanks,
-Garrett

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>

Index: testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c,v
retrieving revision 1.2
diff -u -r1.2 rt_sigaction01.c
--- testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c     6 Jul
2009 15:24:06 -0000       1.2
+++ testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c     7 Jul
2009 16:02:21 -0000
@@ -55,15 +55,19 @@
 #include "usctest.h"
 #include "linux_syscall_numbers.h"

-#if defined __mips__
+/*
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
+ *
+ * See asm/compat.h under the kernel source for more details.
+ *
+ * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
+ */
+#if defined (__mips__)
 #define SIGSETSIZE 16
-#endif
-
-#if defined __arm__ || __i386__ || __powerpc__
+#else
 #define SIGSETSIZE 8
 #endif

-
 /* Extern Global Variables */
 extern int Tst_count;           /* counter for tst_xxx routines.         */
 extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
Index: testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c,v
retrieving revision 1.1
diff -u -r1.1 rt_sigaction02.c
--- testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c     6 Jul
2009 15:24:06 -0000       1.1
+++ testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c     7 Jul
2009 16:02:21 -0000
@@ -51,11 +51,16 @@
 #include "usctest.h"
 #include "linux_syscall_numbers.h"

-#if defined __mips__
+/*
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
+ *
+ * See asm/compat.h under the kernel source for more details.
+ *
+ * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
+ */
+#if defined (__mips__)
 #define SIGSETSIZE 16
-#endif
-
-#if defined __arm__ || __i386__ || __powerpc__
+#else
 #define SIGSETSIZE 8
 #endif

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] Compile failure with rt_sigaction on amd64
  2009-07-07 16:06 ` Garrett Cooper
@ 2009-07-09 14:50   ` naresh kamboju
  2009-07-09 17:40     ` Garrett Cooper
  0 siblings, 1 reply; 9+ messages in thread
From: naresh kamboju @ 2009-07-09 14:50 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

On Tue, Jul 7, 2009 at 9:36 PM, Garrett Cooper<yanegomi@gmail.com> wrote:
> On Tue, Jul 7, 2009 at 5:46 AM, naresh kamboju<naresh.kernel@gmail.com> wrote:
>> Hi Garrett Cooper,
>>
>> Thanks for your info.
>>
>>>Oops... looks like someone forgot __amd64__ / >__ia64__:
>>
>> yes.
>> i forgot to add these ARCH.
>> Because I am not having this Architecture at my end :-(
>>
>>>gcc -g -O2 -I../../include -g -Wall -I../../../../include >-Wall -O2 -W
>>>rt_sigaction01.c -L../../../../lib -lltp -o rt_sigaction01
>>>rt_sigaction01.c: In function 'set_handler':
>>>rt_sigaction01.c:147: error: 'SIGSETSIZE' >undeclared .(first use in
>>>this function)
>>>rt_sigaction01.c:147: error: (Each undeclared >identifier is reported only once
>>>rt_sigaction01.c:147: error: for each function it >appears in.)
>>>make[4]: *** [rt_sigaction01] Error 1
>>
>>>I tried using sizeof(sigaction_t), but unfortunately the >results for
>>>the testcase(s) on my system were always EINVAL. >This issue wasn't
>>>present a few days ago...
>>
>>>Any ideas?
>>
>>
>> I have made a patch to fix this issue please review the this temporary fix.
>>
>> In my previous mail I have stated that sigset size (size_t sigsetsize)
>> will be different for Different ARCH. It is depending on
>> _COMPAT_NSIG_WORDS Macro.
>>
>> We have to conform how its different with respect to ARCH and need to
>> have a generic solution to fix this issue.
>>
>> I think its going to be an issue othere than __arm__ || __i386__ ||
>> __powerpc__ || __amd64__ || __ia64__ and __mips__
>>
>> There are different ARCH are being used by our LTP developers.
>>
>> I’ll investigate this issue and come back with generic Solution to
>> support most of the ARCH.
>>
>>
>> please refer this linux-2.6.30/include/linux/compat.h
>>
>> http://lxr.linux.no/linux+v2.6.30/include/linux/compat.h#L75
>>
>> #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
>>
>> typedef struct {
>> compat_sigset_word sig[_COMPAT_NSIG_WORDS];
>> } compat_sigset_t;
>>
>> Your suggestions are welcome ... :)
>>
>>
>> Best regards
>> Naresh Kamboju
>>
>> Signed-off-by: Naresh Kamboju < naresh.kernel@gm... >
>>
>> diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
>> b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
>> --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
>> 16:58:11.000000000 +0530
>> +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
>> 16:59:38.000000000 +0530
>> @@ -59,7 +59,7 @@
>> #define SIGSETSIZE 16
>> #endif
>>
>> -#if defined __arm__ || __i386__ || __powerpc__
>> +#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
>> #define SIGSETSIZE 8
>> #endif
>>
>> diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
>> b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
>> --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
>> 16:58:11.000000000 +0530
>> +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
>> 16:59:48.000000000 +0530
>> @@ -55,7 +55,7 @@
>> #define SIGSETSIZE 16
>> #endif
>>
>> -#if defined __arm__ || __i386__ || __powerpc__
>> +#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
>> #define SIGSETSIZE 8
>> #endif
>
> Interesting. I checked the kernel sources and it appears that __mips__
> is the only odd man out.

If you are sure about only MIPS is odd man out.
Then it would be perfect patch to fix this issue.

Subrata,
Please review this patch and test at your end and conform with PASSED
architectures and FAILED.

If you found any issue please let me know.

Best regards,
Naresh Kamboju

>
> Here's what I did (similar to what you did above, but I hardcoded
> values because you can't determine the actual values from compat.h
> without kernel sources AFAIK).
>
> It might be wiser to move to a general purpose header, btw...
>
> Thanks,
> -Garrett
>
> Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
>
> Index: testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
> ===================================================================
> RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c,v
> retrieving revision 1.2
> diff -u -r1.2 rt_sigaction01.c
> --- testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c     6 Jul
> 2009 15:24:06 -0000       1.2
> +++ testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c     7 Jul
> 2009 16:02:21 -0000
> @@ -55,15 +55,19 @@
>  #include "usctest.h"
>  #include "linux_syscall_numbers.h"
>
> -#if defined __mips__
> +/*
> + * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
> + *
> + * See asm/compat.h under the kernel source for more details.
> + *
> + * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
> + */
> +#if defined (__mips__)
>  #define SIGSETSIZE 16
> -#endif
> -
> -#if defined __arm__ || __i386__ || __powerpc__
> +#else
>  #define SIGSETSIZE 8
>  #endif
>
> -
>  /* Extern Global Variables */
>  extern int Tst_count;           /* counter for tst_xxx routines.         */
>  extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
> Index: testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
> ===================================================================
> RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c,v
> retrieving revision 1.1
> diff -u -r1.1 rt_sigaction02.c
> --- testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c     6 Jul
> 2009 15:24:06 -0000       1.1
> +++ testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c     7 Jul
> 2009 16:02:21 -0000
> @@ -51,11 +51,16 @@
>  #include "usctest.h"
>  #include "linux_syscall_numbers.h"
>
> -#if defined __mips__
> +/*
> + * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
> + *
> + * See asm/compat.h under the kernel source for more details.
> + *
> + * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
> + */
> +#if defined (__mips__)
>  #define SIGSETSIZE 16
> -#endif
> -
> -#if defined __arm__ || __i386__ || __powerpc__
> +#else
>  #define SIGSETSIZE 8
>  #endif
>

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] Compile failure with rt_sigaction on amd64
  2009-07-09 14:50   ` naresh kamboju
@ 2009-07-09 17:40     ` Garrett Cooper
  2009-07-10  4:52       ` Masatake YAMATO
  0 siblings, 1 reply; 9+ messages in thread
From: Garrett Cooper @ 2009-07-09 17:40 UTC (permalink / raw)
  To: naresh kamboju; +Cc: ltp-list

On Thu, Jul 9, 2009 at 7:50 AM, naresh kamboju<naresh.kernel@gmail.com> wrote:
> On Tue, Jul 7, 2009 at 9:36 PM, Garrett Cooper<yanegomi@gmail.com> wrote:
>> On Tue, Jul 7, 2009 at 5:46 AM, naresh kamboju<naresh.kernel@gmail.com> wrote:
>>> Hi Garrett Cooper,
>>>
>>> Thanks for your info.
>>>
>>>>Oops... looks like someone forgot __amd64__ / >__ia64__:
>>>
>>> yes.
>>> i forgot to add these ARCH.
>>> Because I am not having this Architecture at my end :-(
>>>
>>>>gcc -g -O2 -I../../include -g -Wall -I../../../../include >-Wall -O2 -W
>>>>rt_sigaction01.c -L../../../../lib -lltp -o rt_sigaction01
>>>>rt_sigaction01.c: In function 'set_handler':
>>>>rt_sigaction01.c:147: error: 'SIGSETSIZE' >undeclared .(first use in
>>>>this function)
>>>>rt_sigaction01.c:147: error: (Each undeclared >identifier is reported only once
>>>>rt_sigaction01.c:147: error: for each function it >appears in.)
>>>>make[4]: *** [rt_sigaction01] Error 1
>>>
>>>>I tried using sizeof(sigaction_t), but unfortunately the >results for
>>>>the testcase(s) on my system were always EINVAL. >This issue wasn't
>>>>present a few days ago...
>>>
>>>>Any ideas?
>>>
>>>
>>> I have made a patch to fix this issue please review the this temporary fix.
>>>
>>> In my previous mail I have stated that sigset size (size_t sigsetsize)
>>> will be different for Different ARCH. It is depending on
>>> _COMPAT_NSIG_WORDS Macro.
>>>
>>> We have to conform how its different with respect to ARCH and need to
>>> have a generic solution to fix this issue.
>>>
>>> I think its going to be an issue othere than __arm__ || __i386__ ||
>>> __powerpc__ || __amd64__ || __ia64__ and __mips__
>>>
>>> There are different ARCH are being used by our LTP developers.
>>>
>>> I’ll investigate this issue and come back with generic Solution to
>>> support most of the ARCH.
>>>
>>>
>>> please refer this linux-2.6.30/include/linux/compat.h
>>>
>>> http://lxr.linux.no/linux+v2.6.30/include/linux/compat.h#L75
>>>
>>> #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
>>>
>>> typedef struct {
>>> compat_sigset_word sig[_COMPAT_NSIG_WORDS];
>>> } compat_sigset_t;
>>>
>>> Your suggestions are welcome ... :)
>>>
>>>
>>> Best regards
>>> Naresh Kamboju
>>>
>>> Signed-off-by: Naresh Kamboju < naresh.kernel@gm... >
>>>
>>> diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
>>> b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
>>> --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
>>> 16:58:11.000000000 +0530
>>> +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c 2009-07-07
>>> 16:59:38.000000000 +0530
>>> @@ -59,7 +59,7 @@
>>> #define SIGSETSIZE 16
>>> #endif
>>>
>>> -#if defined __arm__ || __i386__ || __powerpc__
>>> +#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
>>> #define SIGSETSIZE 8
>>> #endif
>>>
>>> diff -Naurb a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
>>> b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
>>> --- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
>>> 16:58:11.000000000 +0530
>>> +++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c 2009-07-07
>>> 16:59:48.000000000 +0530
>>> @@ -55,7 +55,7 @@
>>> #define SIGSETSIZE 16
>>> #endif
>>>
>>> -#if defined __arm__ || __i386__ || __powerpc__
>>> +#if defined __arm__ || __i386__ || __powerpc__ || __amd64__ || __ia64__
>>> #define SIGSETSIZE 8
>>> #endif
>>
>> Interesting. I checked the kernel sources and it appears that __mips__
>> is the only odd man out.
>
> If you are sure about only MIPS is odd man out.
> Then it would be perfect patch to fix this issue.
>
> Subrata,
> Please review this patch and test at your end and conform with PASSED
> architectures and FAILED.
>
> If you found any issue please let me know.

Naresh,
    In retrospect the comment I wrote up about the calculation I made
could be a bit misleading... this one's better.

1. Fix compile issue across all platforms (like before)
2. Better comments on calculations => less confusion => happier
developers and users :).

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>

Index: testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction0
.c,v
retrieving revision 1.2
diff -u -r1.2 rt_sigaction01.c
--- testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c     6 Jul 2009 15:2
:06 -0000       1.2
+++ testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c     9 Jul 2009 17:3
:49 -0000
@@ -55,15 +55,25 @@
 #include "usctest.h"
 #include "linux_syscall_numbers.h"

-#if defined __mips__
+/*
+ * For all but __mips__:
+ *
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
+ *
+ * For __mips__:
+ *
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 4.
+ *
+ * See asm/compat.h under the kernel source for more details.
+ *
+ * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
+ */
+#if defined (__mips__)
 #define SIGSETSIZE 16
-#endif
-
-#if defined __arm__ || __i386__ || __powerpc__
+#else
 #define SIGSETSIZE 8
 #endif

-
 /* Extern Global Variables */
 extern int Tst_count;           /* counter for tst_xxx routines.         */
 extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
Index: testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction0
.c,v
retrieving revision 1.1
diff -u -r1.1 rt_sigaction02.c
--- testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c     6 Jul 2009 15:2
:06 -0000       1.1
+++ testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c     9 Jul 2009 17:3
:49 -0000
@@ -51,11 +51,22 @@
 #include "usctest.h"
 #include "linux_syscall_numbers.h"

-#if defined __mips__
+/*
+ * For all but __mips__:
+ *
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
+ *
+ * For __mips__:
+ *
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 4.
+ *
+ * See asm/compat.h under the kernel source for more details.
+ *
+ * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
+ */
+#if defined (__mips__)
 #define SIGSETSIZE 16
-#endif
-
-#if defined __arm__ || __i386__ || __powerpc__
+#else
 #define SIGSETSIZE 8
 #endif

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] Compile failure with rt_sigaction on amd64
  2009-07-09 17:40     ` Garrett Cooper
@ 2009-07-10  4:52       ` Masatake YAMATO
  2009-07-10  9:01         ` naresh kamboju
  0 siblings, 1 reply; 9+ messages in thread
From: Masatake YAMATO @ 2009-07-10  4:52 UTC (permalink / raw)
  To: yanegomi; +Cc: ltp-list, naresh.kernel

I've found an interesting code in glibc about "rt_sigaction".

sysdeps/unix/sysv/linux/x86_64/sigaction.c:
int
__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
{
  int result;
  struct kernel_sigaction kact, koact;

  if (act)
    {
      kact.k_sa_handler = act->sa_handler;
      memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
      kact.sa_flags = act->sa_flags | SA_RESTORER;

      kact.sa_restorer = &restore_rt;
    }

  /* XXX The size argument hopefully will have to be changed to the
     real size of the user-level sigset_t.  */
  result = INLINE_SYSCALL (rt_sigaction, 4,
			   sig, act ? __ptrvalue (&kact) : NULL,
			   oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
--------------------------------------------------------------^^^^^^^^^



How do you think follow the way to glibc?
In addition man page is needed to update.

Masatake YAMATO

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] Compile failure with rt_sigaction on amd64
  2009-07-10  4:52       ` Masatake YAMATO
@ 2009-07-10  9:01         ` naresh kamboju
  2009-07-10 10:46           ` Subrata Modak
  2009-07-10 16:49           ` Garrett Cooper
  0 siblings, 2 replies; 9+ messages in thread
From: naresh kamboju @ 2009-07-10  9:01 UTC (permalink / raw)
  To: Garrett Cooper, Masatake YAMATO; +Cc: ltp-list, naresh.kernel

Garrett,

On Fri, Jul 10, 2009 at 10:22 AM, Masatake YAMATO<yamato@redhat.com> wrote:
> I've found an interesting code in glibc about "rt_sigaction".
>
> sysdeps/unix/sysv/linux/x86_64/sigaction.c:
> int
> __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
>
>
>
> How do you think follow the way to glibc?
> In addition man page is needed to update.
>
> Masatake YAMATO
>

Garrett Cooper <yanegomi@gmail.com> wrote:
>>gcooper@orangebox /scratch/ltp-vanilla/ltp $ /lib/libc.so.6
>>GNU C Library stable release version 2.9, by Roland McGrath >>et al.

>>I'm confused -- how will that help us?

To conform glibc version you are using is 2.9

>>gcooper@orangebox /scratch/ltp-vanilla/ltp $ gdb
>>This GDB was configured as "x86_64-pc-linux-gnu"...
>>(gdb) r
>>Starting program:
>>/scratch/ltp-vanilla/ltp/testcases/kernel/syscalls/rt_sigaction>>/rt_sigaction01
>>rt_sigaction01    0  INFO  :  signal: 34
>>rt_sigaction01    1  PASS  :  rt_sigaction call succeeded: >>result = 0
>>rt_sigaction01    0  INFO  :  sa.sa_flags = >>SA_RESETHAND|SA_SIGINFO

>>Program received signal SIG34, Real-time event 34.
>>0x00007f770ba0b4f7 in kill () from /lib/libc.so.6
>>(gdb) where
>>#0  0x00007f770ba0b4f7 in kill () from /lib/libc.so.6
>>#1  0x0000000000401c3e in main ()
>>(gdb)


As you said in the pervious mail when you try to debug using gdb you
got a segmentation falut from /lib/libc.so.6.

So that segmentation fault is generated by glibc.


As per Masatake YAMATO comments,
glibc code implementation for libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c

X86_64:

http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c?annotate=1.8.2.4&cvsroot=glibc

X86:

http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/sigaction.c?annotate=1.24.2.2&cvsroot=glibc

Thanks Masatake YAMATO for your information.

However, before concluding problem/issue need some more Investigation
Please remove
-kill(getpid(),signal);
from rt_sigaction01.c
And complie and execute and share the results.

Best regards,
Naresh Kamboju

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] Compile failure with rt_sigaction on amd64
  2009-07-10  9:01         ` naresh kamboju
@ 2009-07-10 10:46           ` Subrata Modak
  2009-07-10 16:49           ` Garrett Cooper
  1 sibling, 0 replies; 9+ messages in thread
From: Subrata Modak @ 2009-07-10 10:46 UTC (permalink / raw)
  To: naresh kamboju; +Cc: ltp-list

On Fri, 2009-07-10 at 14:31 +0530, naresh kamboju wrote: 
> Garrett,
> 
> On Fri, Jul 10, 2009 at 10:22 AM, Masatake YAMATO<yamato@redhat.com> wrote:
> > I've found an interesting code in glibc about "rt_sigaction".
> >
> > sysdeps/unix/sysv/linux/x86_64/sigaction.c:
> > int
> > __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
> >
> >
> >
> > How do you think follow the way to glibc?
> > In addition man page is needed to update.
> >
> > Masatake YAMATO
> >
> 
> Garrett Cooper <yanegomi@gmail.com> wrote:
> >>gcooper@orangebox /scratch/ltp-vanilla/ltp $ /lib/libc.so.6
> >>GNU C Library stable release version 2.9, by Roland McGrath >>et al.
> 
> >>I'm confused -- how will that help us?
> 
> To conform glibc version you are using is 2.9
> 
> >>gcooper@orangebox /scratch/ltp-vanilla/ltp $ gdb
> >>This GDB was configured as "x86_64-pc-linux-gnu"...
> >>(gdb) r
> >>Starting program:
> >>/scratch/ltp-vanilla/ltp/testcases/kernel/syscalls/rt_sigaction>>/rt_sigaction01
> >>rt_sigaction01    0  INFO  :  signal: 34
> >>rt_sigaction01    1  PASS  :  rt_sigaction call succeeded: >>result = 0
> >>rt_sigaction01    0  INFO  :  sa.sa_flags = >>SA_RESETHAND|SA_SIGINFO
> 
> >>Program received signal SIG34, Real-time event 34.
> >>0x00007f770ba0b4f7 in kill () from /lib/libc.so.6
> >>(gdb) where
> >>#0  0x00007f770ba0b4f7 in kill () from /lib/libc.so.6
> >>#1  0x0000000000401c3e in main ()
> >>(gdb)
> 
> 
> As you said in the pervious mail when you try to debug using gdb you
> got a segmentation falut from /lib/libc.so.6.
> 
> So that segmentation fault is generated by glibc.
> 
> 
> As per Masatake YAMATO comments,
> glibc code implementation for libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c
> 
> X86_64:
> 
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/x86_64/sigaction.c?annotate=1.8.2.4&cvsroot=glibc
> 
> X86:
> 
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/sigaction.c?annotate=1.24.2.2&cvsroot=glibc
> 
> Thanks Masatake YAMATO for your information.
> 
> However, before concluding problem/issue need some more Investigation
> Please remove
> -kill(getpid(),signal);
> from rt_sigaction01.c
> And complie and execute and share the results.

I will wait for any of your patches till you investigate all issues.

Regards--
Subrata

> 
> Best regards,
> Naresh Kamboju


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [LTP] Compile failure with rt_sigaction on amd64
  2009-07-10  9:01         ` naresh kamboju
  2009-07-10 10:46           ` Subrata Modak
@ 2009-07-10 16:49           ` Garrett Cooper
  1 sibling, 0 replies; 9+ messages in thread
From: Garrett Cooper @ 2009-07-10 16:49 UTC (permalink / raw)
  To: naresh kamboju; +Cc: ltp-list

On Fri, Jul 10, 2009 at 2:01 AM, naresh kamboju<naresh.kernel@gmail.com> wrote:
> Garrett,
>
> However, before concluding problem/issue need some more Investigation
> Please remove
> -kill(getpid(),signal);
> from rt_sigaction01.c
> And complie and execute and share the results.

    That worked without segfaulting, but doesn't that negate the whole
purpose of the test?
Thanks,
-Garrett

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] Compile failure with rt_sigaction on amd64
@ 2009-07-07 10:12 Garrett Cooper
  0 siblings, 0 replies; 9+ messages in thread
From: Garrett Cooper @ 2009-07-07 10:12 UTC (permalink / raw)
  To: LTP list

    Oops... looks like someone forgot __amd64__ / __ia64__:

gcc -g -O2 -I../../include -g -Wall -I../../../../include -Wall -O2 -W
   rt_sigaction01.c  -L../../../../lib -lltp -o rt_sigaction01
rt_sigaction01.c: In function 'set_handler':
rt_sigaction01.c:147: error: 'SIGSETSIZE' undeclared (first use in
this function)
rt_sigaction01.c:147: error: (Each undeclared identifier is reported only once
rt_sigaction01.c:147: error: for each function it appears in.)
make[4]: *** [rt_sigaction01] Error 1
make[4]: Leaving directory
`/scratch/ltp-vanilla/ltp/testcases/kernel/syscalls/rt_sigaction'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/scratch/ltp-vanilla/ltp/testcases/kernel/syscalls'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/scratch/ltp-vanilla/ltp/testcases/kernel'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/scratch/ltp-vanilla/ltp/testcases'
make: *** [all] Error 2
gcooper@orangebox /scratch/ltp-vanilla/ltp $ uname -a
Linux orangebox 2.6.29-gentoo-r5 #2 SMP PREEMPT Sun Jun 14 01:11:32
PDT 2009 x86_64 Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz
GenuineIntel GNU/Linux
gcooper@orangebox /scratch/ltp-vanilla/ltp $ grep -B 1 -A 1 SIGSETSIZE
/scratch/ltp-vanilla/ltp/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
#if defined __mips__
#define SIGSETSIZE 16
#endif
--
#if defined __arm__ || __i386__ || __powerpc__
#define SIGSETSIZE 8
#endif
--
                sigaddset(&sa.sa_mask, sig_to_mask);
                TEST(syscall(__NR_rt_sigaction,sig, &sa,
&oldaction,SIGSETSIZE));
        if (TEST_RETURN == 0) {

#endif

I tried using sizeof(sigaction_t), but unfortunately the results for
the testcase(s) on my system were always EINVAL. This issue wasn't
present a few days ago...

Any ideas?

Thanks,
-Garrett

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-07-10 16:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-07 12:46 [LTP] Compile failure with rt_sigaction on amd64 naresh kamboju
2009-07-07 16:06 ` Garrett Cooper
2009-07-09 14:50   ` naresh kamboju
2009-07-09 17:40     ` Garrett Cooper
2009-07-10  4:52       ` Masatake YAMATO
2009-07-10  9:01         ` naresh kamboju
2009-07-10 10:46           ` Subrata Modak
2009-07-10 16:49           ` Garrett Cooper
  -- strict thread matches above, loose matches on Subject: below --
2009-07-07 10:12 Garrett Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.