[Bug testsuite/70520] Incorrect child stack alignment in c-c++-common/asan/clone-test-1.c

2016-05-02 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70520

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #6 from H.J. Lu  ---
Fixed for GCC 7.

[Bug testsuite/70520] Incorrect child stack alignment in c-c++-common/asan/clone-test-1.c

2016-05-02 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70520

--- Comment #5 from hjl at gcc dot gnu.org  ---
Author: hjl
Date: Mon May  2 21:45:34 2016
New Revision: 235790

URL: https://gcc.gnu.org/viewcvs?rev=235790=gcc=rev
Log:
Backport r265322 from llvm upstream

Since x86 psABIs require the function incoming stack must align at 16
bytes, child process stack passed to clone should be aligned at 16
bytes.

PR testsuite/70520
* c-c++-common/asan/clone-test-1.c (main): Align child process
stack to 16 bytes.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/c-c++-common/asan/clone-test-1.c

[Bug testsuite/70520] Incorrect child stack alignment in c-c++-common/asan/clone-test-1.c

2016-04-05 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70520

--- Comment #4 from Andreas Schwab  ---
Does this really make a difference?  I think the attribute still applies to the
object, not the type.

[Bug testsuite/70520] Incorrect child stack alignment in c-c++-common/asan/clone-test-1.c

2016-04-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70520

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
That is very weird placement of the attribute, then it is array of overaligned
chars rather than aligned array of normal chars.

[Bug testsuite/70520] Incorrect child stack alignment in c-c++-common/asan/clone-test-1.c

2016-04-05 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70520

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-04-05
 Ever confirmed|0   |1

--- Comment #2 from H.J. Lu  ---
It has been fixed upstream by

commit 5e263ef18766b562a05aa6736d6c7ea3c8af3b4e
Author: Reid Kleckner 
Date:   Mon Apr 4 18:27:32 2016 +

Apply suggestion from HJ Lu to avoid misaligned stack in test

Fixes PR27191

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265322
91177308-0d34-0410-b5e6-96231b3b80d8

diff --git a/test/asan/TestCases/Linux/clone_test.cc
b/test/asan/TestCases/Linux/clone_test.cc
index e9c1f16..f6eb261 100644
--- a/test/asan/TestCases/Linux/clone_test.cc
+++ b/test/asan/TestCases/Linux/clone_test.cc
@@ -22,7 +22,7 @@ int Child(void *arg) {

 int main(int argc, char **argv) {
   const int kStackSize = 1 << 20;
-  char child_stack[kStackSize + 1];
+  char __attribute__((aligned(16))) child_stack[kStackSize + 1];
   char *sp = child_stack + kStackSize;  // Stack grows down.
   printf("Parent: %p\n", sp);
   pid_t clone_pid = clone(Child, sp, CLONE_FILES | CLONE_VM, NULL);

[Bug testsuite/70520] Incorrect child stack alignment in c-c++-common/asan/clone-test-1.c

2016-04-03 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70520

--- Comment #1 from H.J. Lu  ---
Also see:

https://llvm.org/bugs/show_bug.cgi?id=27191