* [PATCH][Revisedx2] PR55679: skip invalid tests from r194458 on darwin
@ 2012-12-16 21:19 Jack Howarth
2012-12-17 14:44 ` Jakub Jelinek
0 siblings, 1 reply; 5+ messages in thread
From: Jack Howarth @ 2012-12-16 21:19 UTC (permalink / raw)
To: gcc-patches
Cc: dodji, konstantin.s.serebryany, mikestump, iain, glider, jakub
[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]
The attached revised patch disables three asan tests introduced in r194458 which are invalid
on darwin. The g++.dg/asan/interception-test-1.C test should be dg-skip-if'd on darwin since
mac function interposition is used instead of interception. The c-c++-common/asan/swapcontext-test-1.c
test is invalid as ucontext support was deprecated in darwin10 and removed completely
in darwin11. The current implementation of check_effective_target_swapcontext in
lib/target-supports.exp doesn't catch the deprecation of ucontext support on darwin
because it doesn't try to parse the ucontext.h include file. The attached patch
changes the check_effective_target_swapcontext to use check_no_compiler_messages
with compilation of ucontext.h. It also skips the c-c++-common/asan/rlimit-mmap-test-1.c
on darwin since that target lacks RLIMIT_AS in setrlimit. Tested without regression on both
x86_64-apple-darwin10 and x86_64-unknown-linux-gnu. Okay for gcc trunk?
Jack
ps This patch leaves the failures in c-c++-common/asan/global-overflow-1.c and
c-c++-common/asan/stack-overflow-1.c as the only unresolved parts of PR55679 on darwin.
[-- Attachment #2: pr55679_v4.diff --]
[-- Type: text/plain, Size: 2094 bytes --]
gcc/testsuite/
2012-12-16 Jack Howarth <howarth@bromo.med.uc.edu>
PR sanitizer/55679
* g++.dg/asan/interception-test-1.C: Skip on darwin.
* c-c++-common/asan/rlimit-mmap-test-1.c: Likewise.
* lib/target-supports.exp (check_effective_target_swapcontext): Use
check_no_compiler_messages to test support in ucontext.h.
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp (revision 194538)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -736,7 +736,14 @@ proc check_effective_target_setrlimit {}
# Return 1 if the target supports swapcontext, 0 otherwise.
proc check_effective_target_swapcontext {} {
- return [check_function_available "swapcontext"]
+ return [check_no_compiler_messages swapcontext executable {
+ #include <ucontext.h>
+ int main (void)
+ {
+ ucontext_t orig_context,child_context;
+ if (swapcontext(&child_context, &orig_context) < 0) { }
+ }
+ }]
}
# Return 1 if compilation with -pthread is error-free for trivial
Index: gcc/testsuite/g++.dg/asan/interception-test-1.C
===================================================================
--- gcc/testsuite/g++.dg/asan/interception-test-1.C (revision 194538)
+++ gcc/testsuite/g++.dg/asan/interception-test-1.C (working copy)
@@ -3,6 +3,7 @@
// { dg-do run }
// { dg-options "-fno-builtin-malloc -fno-builtin-free" }
// { dg-shouldfail "asan" }
+// { dg-skip-if "Darwin uses mac function interposition" { *-*-darwin* } }
#include <stdlib.h>
#include <stdio.h>
Index: gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c
===================================================================
--- gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c (revision 194538)
+++ gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c (working copy)
@@ -2,6 +2,7 @@
/* { dg-do run { target setrlimit } } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+// { dg-skip-if "Darwin lacks RLIMIT_AS in setrlimit" { *-*-darwin* } }
/* { dg-shouldfail "asan" } */
#include <stdlib.h>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][Revisedx2] PR55679: skip invalid tests from r194458 on darwin
2012-12-16 21:19 [PATCH][Revisedx2] PR55679: skip invalid tests from r194458 on darwin Jack Howarth
@ 2012-12-17 14:44 ` Jakub Jelinek
2012-12-17 15:13 ` Jack Howarth
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2012-12-17 14:44 UTC (permalink / raw)
To: Jack Howarth
Cc: gcc-patches, dodji, konstantin.s.serebryany, mikestump, iain, glider
On Sun, Dec 16, 2012 at 04:19:11PM -0500, Jack Howarth wrote:
> 2012-12-16 Jack Howarth <howarth@bromo.med.uc.edu>
>
> PR sanitizer/55679
> * g++.dg/asan/interception-test-1.C: Skip on darwin.
> * lib/target-supports.exp (check_effective_target_swapcontext): Use
> check_no_compiler_messages to test support in ucontext.h.
The above two changes were already approved, just check those in.
> * c-c++-common/asan/rlimit-mmap-test-1.c: Likewise.
This doesn't look right. Either you should add code testing for
RLIMIT_AS presence into the setrlimit effective target proc, or
add setrlimit_as as another effective target. If we want to have more such
tests in the future, we don't want to augment all those tests with
dg-skip-if for broken targets.
> --- gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c (revision 194538)
> +++ gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c (working copy)
> @@ -2,6 +2,7 @@
>
> /* { dg-do run { target setrlimit } } */
> /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
> +// { dg-skip-if "Darwin lacks RLIMIT_AS in setrlimit" { *-*-darwin* } }
> /* { dg-shouldfail "asan" } */
>
> #include <stdlib.h>
Jakub
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][Revisedx2] PR55679: skip invalid tests from r194458 on darwin
2012-12-17 14:44 ` Jakub Jelinek
@ 2012-12-17 15:13 ` Jack Howarth
2012-12-17 15:16 ` Jakub Jelinek
0 siblings, 1 reply; 5+ messages in thread
From: Jack Howarth @ 2012-12-17 15:13 UTC (permalink / raw)
To: Jakub Jelinek
Cc: gcc-patches, dodji, konstantin.s.serebryany, mikestump, iain, glider
On Mon, Dec 17, 2012 at 03:42:59PM +0100, Jakub Jelinek wrote:
> On Sun, Dec 16, 2012 at 04:19:11PM -0500, Jack Howarth wrote:
> > 2012-12-16 Jack Howarth <howarth@bromo.med.uc.edu>
> >
> > PR sanitizer/55679
> > * g++.dg/asan/interception-test-1.C: Skip on darwin.
> > * lib/target-supports.exp (check_effective_target_swapcontext): Use
> > check_no_compiler_messages to test support in ucontext.h.
>
> The above two changes were already approved, just check those in.
>
> > * c-c++-common/asan/rlimit-mmap-test-1.c: Likewise.
>
> This doesn't look right. Either you should add code testing for
> RLIMIT_AS presence into the setrlimit effective target proc, or
> add setrlimit_as as another effective target. If we want to have more such
> tests in the future, we don't want to augment all those tests with
> dg-skip-if for broken targets.
Jakub,
On darwin in /usr/include/sys/resource.h, we have...
#define RLIMIT_AS 5 /* address space (resident set size) */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define RLIMIT_RSS RLIMIT_AS /* source compatibility alias */
so I guess we could craft a setrlimit effective target proc which checks
if RLIMIT_AS has the same rlimit ID as RLIMIT_RSS. Any suggestions on how
to implement such a check?
Jack
>
> > --- gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c (revision 194538)
> > +++ gcc/testsuite/c-c++-common/asan/rlimit-mmap-test-1.c (working copy)
> > @@ -2,6 +2,7 @@
> >
> > /* { dg-do run { target setrlimit } } */
> > /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
> > +// { dg-skip-if "Darwin lacks RLIMIT_AS in setrlimit" { *-*-darwin* } }
> > /* { dg-shouldfail "asan" } */
> >
> > #include <stdlib.h>
>
>
> Jakub
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][Revisedx2] PR55679: skip invalid tests from r194458 on darwin
2012-12-17 15:13 ` Jack Howarth
@ 2012-12-17 15:16 ` Jakub Jelinek
0 siblings, 0 replies; 5+ messages in thread
From: Jakub Jelinek @ 2012-12-17 15:16 UTC (permalink / raw)
To: Jack Howarth
Cc: gcc-patches, dodji, konstantin.s.serebryany, mikestump, iain, glider
On Mon, Dec 17, 2012 at 10:13:25AM -0500, Jack Howarth wrote:
> On darwin in /usr/include/sys/resource.h, we have...
>
> #define RLIMIT_AS 5 /* address space (resident set size) */
> #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
> #define RLIMIT_RSS RLIMIT_AS /* source compatibility alias */
>
> so I guess we could craft a setrlimit effective target proc which checks
> if RLIMIT_AS has the same rlimit ID as RLIMIT_RSS. Any suggestions on how
> to implement such a check?
Or perhaps just return 0 early for [ target *-*-darwin* ] in the setrlimit
effective target test, with a comment that it violates POSIX.
Jakub
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][Revisedx2] PR55679: skip invalid tests from r194458 on darwin
@ 2012-12-16 21:46 Dominique Dhumieres
0 siblings, 0 replies; 5+ messages in thread
From: Dominique Dhumieres @ 2012-12-16 21:46 UTC (permalink / raw)
To: gcc-patches; +Cc: howarth
Hi jack,
> +// { dg-skip-if "Darwin lacks RLIMIT_AS in setrlimit" { *-*-darwin* } }
The comment is not fully accurate. See pr55679 comment #17 for some analysis
and another candidate patch for rlimit-mmap-test-1.c (it will detect any fix
by Apple).
Cheers,
Dominique
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-12-17 15:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-16 21:19 [PATCH][Revisedx2] PR55679: skip invalid tests from r194458 on darwin Jack Howarth
2012-12-17 14:44 ` Jakub Jelinek
2012-12-17 15:13 ` Jack Howarth
2012-12-17 15:16 ` Jakub Jelinek
2012-12-16 21:46 Dominique Dhumieres
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).