All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash
@ 2009-09-15 15:28 Geert Uytterhoeven
  2009-09-16 15:17 ` Subrata Modak
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2009-09-15 15:28 UTC (permalink / raw)
  To: Linux Test Project

When the quotactl syscall fails, quotactl01 crashes with a segmentation fault
due to an incorrect printf()-style format.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
--
v2: Use TTERRNO

 testcases/kernel/syscalls/quotactl/quotactl01.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 6800a25..fe8df33 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -147,7 +147,7 @@ int main(int ac, char **av) {
                 for (i = 0; i <= 7; i++){
                         TEST(retval = syscall(__NR_quotactl, cmd[i], (const char *)NULL, id, (caddr_t)NULL));
 			if(TEST_RETURN != 0){
-                 	   	tst_resm(TFAIL, "%s failed - errno = %d : %s ...cmderror=%s", TCID, TEST_ERRNO, strerror(TEST_ERRNO),cmd[i]);
+				tst_resm(TFAIL|TTERRNO, "%s failed, cmd=0x%x", TCID, cmd[i]);
                         }else{
         			tst_resm(TPASS, "quotactl call succeeded");
                         }
-- 
1.6.2.4

With kind regards,

Geert Uytterhoeven
Software Architect
Techsoft Centre

Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash
  2009-09-15 15:28 [LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash Geert Uytterhoeven
@ 2009-09-16 15:17 ` Subrata Modak
  0 siblings, 0 replies; 4+ messages in thread
From: Subrata Modak @ 2009-09-16 15:17 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux Test Project

On Tue, 2009-09-15 at 17:28 +0200, Geert Uytterhoeven wrote: 
> When the quotactl syscall fails, quotactl01 crashes with a segmentation fault
> due to an incorrect printf()-style format.
> 
> Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>

Thanks.

Regards--
Subrata

> --
> v2: Use TTERRNO
> 
>  testcases/kernel/syscalls/quotactl/quotactl01.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
> index 6800a25..fe8df33 100644
> --- a/testcases/kernel/syscalls/quotactl/quotactl01.c
> +++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
> @@ -147,7 +147,7 @@ int main(int ac, char **av) {
>                  for (i = 0; i <= 7; i++){
>                          TEST(retval = syscall(__NR_quotactl, cmd[i], (const char *)NULL, id, (caddr_t)NULL));
>  			if(TEST_RETURN != 0){
> -                 	   	tst_resm(TFAIL, "%s failed - errno = %d : %s ...cmderror=%s", TCID, TEST_ERRNO, strerror(TEST_ERRNO),cmd[i]);
> +				tst_resm(TFAIL|TTERRNO, "%s failed, cmd=0x%x", TCID, cmd[i]);
>                          }else{
>          			tst_resm(TPASS, "quotactl call succeeded");
>                          }


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash
  2009-08-27 15:04 Geert Uytterhoeven
@ 2009-08-27 19:22 ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2009-08-27 19:22 UTC (permalink / raw)
  To: ltp-list; +Cc: Geert Uytterhoeven


[-- Attachment #1.1: Type: Text/Plain, Size: 386 bytes --]

On Thursday 27 August 2009 11:04:40 Geert Uytterhoeven wrote:
> -                 	   	tst_resm(TFAIL, "%s failed - errno = %d : %s
> ...cmderror=%s", TCID, TEST_ERRNO, strerror(TEST_ERRNO),cmd[i]);
> +				tst_resm(TFAIL, "%s failed - errno = %d : %s ...cmd=0x%x", TCID,
> TEST_ERRNO, strerror(TEST_ERRNO), cmd[i]);

please use the new TTERRNO flag: tst_resm(TFAIL|TTERRNO, ....)
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 355 bytes --]

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

[-- Attachment #3: 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] 4+ messages in thread

* [LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash
@ 2009-08-27 15:04 Geert Uytterhoeven
  2009-08-27 19:22 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2009-08-27 15:04 UTC (permalink / raw)
  To: Linux Test Project

When the quotactl syscall fails, quotactl01 crashes with a segmentation fault
due to an incorrect printf()-style format.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
 testcases/kernel/syscalls/quotactl/quotactl01.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 6800a25..0be4fd5 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -147,7 +147,7 @@ int main(int ac, char **av) {
                 for (i = 0; i <= 7; i++){
                         TEST(retval = syscall(__NR_quotactl, cmd[i], (const char *)NULL, id, (caddr_t)NULL));
 			if(TEST_RETURN != 0){
-                 	   	tst_resm(TFAIL, "%s failed - errno = %d : %s ...cmderror=%s", TCID, TEST_ERRNO, strerror(TEST_ERRNO),cmd[i]);
+				tst_resm(TFAIL, "%s failed - errno = %d : %s ...cmd=0x%x", TCID, TEST_ERRNO, strerror(TEST_ERRNO), cmd[i]);
                         }else{
         			tst_resm(TPASS, "quotactl call succeeded");
                         }
-- 
1.6.2.4

With kind regards,

Geert Uytterhoeven
Software Architect
Techsoft Centre

Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2009-09-16 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-15 15:28 [LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash Geert Uytterhoeven
2009-09-16 15:17 ` Subrata Modak
  -- strict thread matches above, loose matches on Subject: below --
2009-08-27 15:04 Geert Uytterhoeven
2009-08-27 19:22 ` Mike Frysinger

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.