* [LTP] [PATCH 03/21] test.h/tst_brkm: Drop __attribute__((noreturn)) since tst_brk can return to caller
@ 2012-01-03 9:37 Markos Chandras
2012-01-03 18:56 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Markos Chandras @ 2012-01-03 9:37 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Hi, please review the attached patch
--
markos
[-- Attachment #2: 0003-test.h-tst_brkm-Drop-__attribute__-noreturn-since-ts.patch --]
[-- Type: text/plain, Size: 1011 bytes --]
From ab2d6650577acb973f68ddfd8884fab0116e5470 Mon Sep 17 00:00:00 2001
From: Markos Chandras <markos.chandras@imgtec.com>
Date: Thu, 22 Dec 2011 11:42:10 +0000
Subject: [PATCH 03/21] test.h/tst_brkm: Drop __attribute__((noreturn)) since tst_brk can return to caller
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
include/test.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/test.h b/include/test.h
index 033fdbc..39bad72 100644
--- a/include/test.h
+++ b/include/test.h
@@ -189,7 +189,7 @@ void tst_resm(int ttype, char *arg_fmt, ...)
void tst_brk(int ttype, char *fname, void (*func)(void), char *arg_fmt, ...)
__attribute__ ((format (printf, 4, 5)));
void tst_brkm(int ttype, void (*func)(void), char *arg_fmt, ...)
- __attribute__ ((format (printf, 3, 4))) LTP_ATTRIBUTE_NORETURN;
+ __attribute__ ((format (printf, 3, 4)));
void tst_require_root(void (*func)(void));
int tst_environ(void);
void tst_exit(void) LTP_ATTRIBUTE_NORETURN;
--
1.7.1
[-- Attachment #3: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
[-- 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 related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 03/21] test.h/tst_brkm: Drop __attribute__((noreturn)) since tst_brk can return to caller
2012-01-03 9:37 [LTP] [PATCH 03/21] test.h/tst_brkm: Drop __attribute__((noreturn)) since tst_brk can return to caller Markos Chandras
@ 2012-01-03 18:56 ` Mike Frysinger
2012-01-04 13:46 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2012-01-03 18:56 UTC (permalink / raw)
To: ltp-list, yanegomi; +Cc: Markos Chandras
[-- Attachment #1.1: Type: Text/Plain, Size: 481 bytes --]
On Tuesday 03 January 2012 04:37:10 Markos Chandras wrote:
> Hi, please review the attached patch
the tst_brk() API has gotten annoying. it is designed to not return to the
original caller which is why it had the "noreturn" attribute. but Garret re-
rewrote it to be re-entrant presumably so the cleanup() func could itself call
tst_brk(). but i'm not sure how useful that actually is in practice ...
Garret: could you comment on the actual use cases here ?
-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 --]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
[-- 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
* Re: [LTP] [PATCH 03/21] test.h/tst_brkm: Drop __attribute__((noreturn)) since tst_brk can return to caller
2012-01-03 18:56 ` Mike Frysinger
@ 2012-01-04 13:46 ` Cyril Hrubis
[not found] ` <CAGH67wRsHvHkdvPrC5y4Fm7TuYxs1dHytJnnK3d54PxG-vukYA@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2012-01-04 13:46 UTC (permalink / raw)
To: Mike Frysinger; +Cc: ltp-list, Markos Chandras
Hi!
> the tst_brk() API has gotten annoying. it is designed to not return to the
> original caller which is why it had the "noreturn" attribute. but Garret re-
> rewrote it to be re-entrant presumably so the cleanup() func could itself call
> tst_brk(). but i'm not sure how useful that actually is in practice ...
The original problem here is that tests use tst_brkm() in cleanup
functions where you don't want to exit before you do all the cleanups.
That was previously working as tst_brkm() with cleanup set to NULL
wasn't calling tst_exit() (and obviously you would never add cleanup
pointer to tst_brkm() when you are in cleanup function otherwise you are
in infinite loop).
The original behavior was IMHO wrong and now it's little better. And I
think that best solution would be to fix tests to use tst_resm() instead
of tst_brkm() when the test doesn't want to exit immediately.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
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
end of thread, other threads:[~2012-01-04 16:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 9:37 [LTP] [PATCH 03/21] test.h/tst_brkm: Drop __attribute__((noreturn)) since tst_brk can return to caller Markos Chandras
2012-01-03 18:56 ` Mike Frysinger
2012-01-04 13:46 ` Cyril Hrubis
[not found] ` <CAGH67wRsHvHkdvPrC5y4Fm7TuYxs1dHytJnnK3d54PxG-vukYA@mail.gmail.com>
2012-01-04 17:05 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox