This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is this a bug in libffi testsuite on solaris2.8?


Bradley Lucier wrote:
My systems administrators told me they are getting the following in in /var/adm/messages on the sparc-sun-solaris2.8 box I use to bootstrap and regression-test mainline every night:

Oct 30 04:58:37 banach.math.purdue.edu genunix: [ID 533030 kern.notice] NOTICE: unwindtest.exe[7957] attempt to execute code on stack by uid <xxx>

and I happen to be the lucky owner of uid <xxx>. The unwindtest.cc tests pass on libffi, but is this a bug in the testsuite, a bogus warning, or something else?

Would something like the appended patch calm down the /var/adm/messages ?


Unfortunately I can't test since bootstrap is broken on solaris and I can't fix it. Seem to be to stupid.

Andreas
Index: libffi/testsuite/libffi.special/unwindtest.cc
===================================================================
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.special/unwindtest.cc,v
retrieving revision 1.3
diff -u -r1.3 unwindtest.cc
--- libffi/testsuite/libffi.special/unwindtest.cc	19 Sep 2003 19:21:53 -0000	1.3
+++ libffi/testsuite/libffi.special/unwindtest.cc	2 Nov 2003 11:59:40 -0000
@@ -49,18 +49,19 @@
 int main (void)
 {
   ffi_cif cif;
-  ffi_closure cl;
+  static ffi_closure cl;
+  ffi_closure *pcl = &cl;
   ffi_type * cl_arg_types[17];
   {
     cl_arg_types[1] = NULL;
 
     CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0,
 		       &ffi_type_void, cl_arg_types) == FFI_OK);
-    CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn, NULL) == FFI_OK);
+    CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn, NULL) == FFI_OK);
 
     try
       {
-	(*((closure_test_type)(&cl)))();
+	(*((closure_test_type)(pcl)))();
       } catch (int exception_code)
       {
 	CHECK(exception_code == 9);
@@ -94,11 +95,11 @@
       CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
 			 &ffi_type_sint, cl_arg_types) == FFI_OK);
 
-      CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn1,
+      CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1,
 			     (void *) 3 /* userdata */)  == FFI_OK);
       try
 	{
-	  (*((closure_test_type1)(&cl)))
+	  (*((closure_test_type1)pcl))
 	    (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
 	     19, 21, 1);
 	  /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]