This is the mail archive of the mailing list for the GDB 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]

[binutils-gdb] testsuite: Fix false FAIL for gdb.base/morestack.exp;h=b8d38ee4250fb6ad001c2f03fa2cef8c2bc06b57

commit b8d38ee4250fb6ad001c2f03fa2cef8c2bc06b57
Author: Jan Kratochvil <>
Date:   Mon Oct 24 14:13:51 2016 +0200

    testsuite: Fix false FAIL for gdb.base/morestack.exp
    	[commit] [testsuite patch] Fix gcc_compiled for gcc 6 & 7
    there has started running again
    	 Running gdb/testsuite/gdb.base/morestack.exp ...
    	+FAIL: gdb.base/morestack.exp: continue
    	+PASS: gdb.base/morestack.exp: up 3000
    but as you can see it FAILs now - on Fedora 24 x86_64 (although for example it
    still PASSes on CentOS-7.2 x86_64).
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff787c7bb in malloc_consolidate (av=av@entry=0x7ffff7bbcb00 <main_arena>) at malloc.c:4181
    4181		      unlink(av, nextchunk, bck, fwd);
    (gdb) bt
    This apparently is due to - man gcc - -fsplit-stack:
    	When code compiled with -fsplit-stack calls code compiled without
    	-fsplit-stack, there may not be much stack space available for the
    	latter code to run.  If compiling all code, including library code,
    	with -fsplit-stack is not an option, then the linker can fix up these
    	calls so that the code compiled without -fsplit-stack always has
    	a large stack.  Support for this is implemented in the gold linker in
    	GNU binutils release 2.21 and later.
    2016-10-24  Jan Kratochvil  <>
    	* gdb.base/morestack.exp: Try to build it using -fuse-ld=gold first.

 gdb/testsuite/ChangeLog              | 4 ++++
 gdb/testsuite/gdb.base/morestack.exp | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c8709b7..460e6b9 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-24  Jan Kratochvil  <>
+	* gdb.base/morestack.exp: Try to build it using -fuse-ld=gold first.
 2016-10-20  Jan Kratochvil  <>
 	* lib/gdb.exp (get_compiler_info): Generalize gcc_compile regexp.
diff --git a/gdb/testsuite/gdb.base/morestack.exp b/gdb/testsuite/gdb.base/morestack.exp
index 12f5d28..fb9bbf3 100644
--- a/gdb/testsuite/gdb.base/morestack.exp
+++ b/gdb/testsuite/gdb.base/morestack.exp
@@ -23,7 +23,11 @@ if {$gcc_compiled == 0} {
-if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {additional_flags=-fsplit-stack}] } {
+# -fuse-ld=gold is used for calling printf code built without -fsplit-stack
+# which could crash otherwise.  See GCC documentation of -fsplit-stack.
+set opts "additional_flags=-fsplit-stack"
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile [list $opts additional_flags=-fuse-ld=gold]] \
+     && [prepare_for_testing ${testfile}.exp ${testfile} $srcfile $opts] } {
     return -1

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