This is the mail archive of the gcc-patches@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: [libgo] Reduce fmt_test.TestScanInts recursion depth (PR go/48553)


Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> As described in the PR, fmt FAILs on targets without split-stack support
> (anything but Linux, it seems) since the 32-bit TestScanInts tests
> overflows the default thread stack of 1 MB.  To avoid this, I've reduced
> the recursion depth from 1000 to 800 which lets the test pass.

Thanks.  Committed upstream and brought back to libgo as follows.
Committed to mainline.

Ian

diff -r 62a12171bf58 libgo/go/fmt/scan_test.go
--- a/libgo/go/fmt/scan_test.go	Fri Apr 22 17:00:44 2011 -0700
+++ b/libgo/go/fmt/scan_test.go	Fri Apr 22 17:06:09 2011 -0700
@@ -810,7 +810,9 @@
 	})
 }
 
-const intCount = 1000
+// 800 is small enough to not overflow the stack when using gccgo on a
+// platform that does not support split stack.
+const intCount = 800
 
 func testScanInts(t *testing.T, scan func(*RecursiveInt, *bytes.Buffer) os.Error) {
 	r := new(RecursiveInt)

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