Bug 81096 - [8 regression] test case ttest in libbacktrace fails starting with its introduction in r249111
Summary: [8 regression] test case ttest in libbacktrace fails starting with its introd...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: 8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-14 17:35 UTC by seurer
Modified: 2017-11-07 18:58 UTC (History)
4 users (show)

See Also:
Host: powerpc*-*-*
Target: powerpc*-*-*
Build: powerpc*-*-*
Known to work:
Known to fail:
Last reconfirmed: 2017-08-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2017-06-14 17:35:24 UTC
This started failing on powerpc64 LE with r249111.  It also fails with the same error for BE though note that on BE some of the other tests here (like btest) have not worked properly for some time.

seurer@genoa:~/gcc/build/gcc-test3$ cd libbacktrace/
seurer@genoa:~/gcc/build/gcc-test3/libbacktrace$ make check
true  DO=all multi-do # make
make  btest stest edtest ttest
make[1]: Entering directory `/home/seurer/gcc/build/gcc-test3/libbacktrace'
make[1]: `stest' is up to date.
make[1]: `ttest' is up to date.
make[1]: Leaving directory `/home/seurer/gcc/build/gcc-test3/libbacktrace'
make  check-TESTS
make[1]: Entering directory `/home/seurer/gcc/build/gcc-test3/libbacktrace'
PASS: backtrace_full noinline
PASS: backtrace_full inline
PASS: backtrace_simple noinline
PASS: backtrace_simple inline
PASS: backtrace_syminfo variable
PASS: btest
PASS: stest
PASS: backtrace_full alloc stress
PASS: edtest
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
FAIL: threaded backtrace_full noinline
FAIL: ttest
===================
1 of 4 tests failed
===================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/home/seurer/gcc/build/gcc-test3/libbacktrace'
make: *** [check-am] Error 2
Comment 1 Ian Lance Taylor 2017-06-14 18:04:41 UTC
Revision 249111 introduced the test, so evidently the test never worked on PPC64.  But I don't know why.  You should find a ttest program in your working directory, and presumably running that program will fail as shown below.  Can you disassemble the functions test1_thread, f2, and f3 from that program and post the disassembly here?
Comment 2 seurer 2017-06-14 19:26:05 UTC
0000000010001510 <test1_thread>:
    10001510:	03 10 40 3c 	lis     r2,4099
    10001514:	00 7f 42 38 	addi    r2,r2,32512
    10001518:	a6 02 08 7c 	mflr    r0
    1000151c:	10 00 01 f8 	std     r0,16(r1)
    10001520:	e1 ff 21 f8 	stdu    r1,-32(r1)
    10001524:	b5 ff ff 4b 	bl      100014d8 <f2.constprop.0+0x8>
    10001528:	20 00 21 38 	addi    r1,r1,32
    1000152c:	10 00 01 e8 	ld      r0,16(r1)
    10001530:	fe ff 63 38 	addi    r3,r3,-2
    10001534:	b4 07 63 7c 	extsw   r3,r3
    10001538:	a6 03 08 7c 	mtlr    r0
    1000153c:	20 00 80 4e 	blr
    10001540:	00 00 00 00 	.long 0x0
    10001544:	00 00 00 01 	.long 0x1000000
    10001548:	80 00 00 00 	.long 0x80
    1000154c:	00 00 00 60 	nop

00000000100014d0 <f2.constprop.0>:
    100014d0:	03 10 40 3c 	lis     r2,4099
    100014d4:	00 7f 42 38 	addi    r2,r2,32512
    100014d8:	a6 02 08 7c 	mflr    r0
    100014dc:	10 00 01 f8 	std     r0,16(r1)
    100014e0:	e1 ff 21 f8 	stdu    r1,-32(r1)
    100014e4:	65 fe ff 4b 	bl      10001348 <f3.constprop.1+0x8>
    100014e8:	20 00 21 38 	addi    r1,r1,32
    100014ec:	10 00 01 e8 	ld      r0,16(r1)
    100014f0:	02 00 63 38 	addi    r3,r3,2
    100014f4:	b4 07 63 7c 	extsw   r3,r3
    100014f8:	a6 03 08 7c 	mtlr    r0
    100014fc:	20 00 80 4e 	blr
    10001500:	00 00 00 00 	.long 0x0
    10001504:	00 00 00 01 	.long 0x1000000
    10001508:	80 00 00 00 	.long 0x80
    1000150c:	00 00 42 60 	ori     r2,r2,0

0000000010001340 <f3.constprop.1>:
    10001340:	03 10 40 3c 	lis     r2,4099
    10001344:	00 7f 42 38 	addi    r2,r2,32512
    10001348:	a6 02 08 7c 	mflr    r0
    1000134c:	f8 ff e1 fb 	std     r31,-8(r1)
    10001350:	e8 ff a1 fb 	std     r29,-24(r1)
    10001354:	14 00 40 39 	li      r10,20
    10001358:	f0 ff c1 fb 	std     r30,-16(r1)
    1000135c:	00 00 00 60 	nop
    10001360:	d0 84 22 39 	addi    r9,r2,-31536
    10001364:	fd ff a2 3c 	addis   r5,r2,-3
    10001368:	00 99 a5 38 	addi    r5,r5,-26368
    1000136c:	00 00 80 38 	li      r4,0
    10001370:	fd ff c2 3c 	addis   r6,r2,-3
    10001374:	a0 9a c6 38 	addi    r6,r6,-25952
    10001378:	10 00 01 f8 	std     r0,16(r1)
    1000137c:	81 fd 21 f8 	stdu    r1,-640(r1)
    10001380:	00 00 69 e8 	ld      r3,0(r9)
    10001384:	60 00 e1 3b 	addi    r31,r1,96
    10001388:	00 00 20 39 	li      r9,0
    1000138c:	50 02 41 f9 	std     r10,592(r1)
    10001390:	40 02 e1 38 	addi    r7,r1,576
    10001394:	40 02 e1 fb 	std     r31,576(r1)
    10001398:	48 02 21 f9 	std     r9,584(r1)
    1000139c:	58 02 21 91 	stw     r9,600(r1)
    100013a0:	19 0c 00 48 	bl      10001fb8 <backtrace_full+0x8>
    100013a4:	00 00 00 60 	nop
    100013a8:	79 1b 65 7c 	mr.     r5,r3
    100013ac:	e4 00 82 40 	bne     10001490 <f3.constprop.1+0x150>
    100013b0:	48 02 a1 e8 	ld      r5,584(r1)
    100013b4:	02 00 a5 2b 	cmpldi  cr7,r5,2
    100013b8:	28 00 9d 41 	bgt     cr7,100013e0 <f3.constprop.1+0xa0>
    100013bc:	00 00 00 60 	nop
    100013c0:	e0 80 22 e9 	ld      r9,-32544(r2)
    100013c4:	fe ff 82 3c 	addis   r4,r2,-2
    100013c8:	b0 95 84 38 	addi    r4,r4,-27216
    100013cc:	00 00 69 e8 	ld      r3,0(r9)
    100013d0:	a1 fa ff 4b 	bl      10000e70 <0000003a.plt_call.fprintf@@GLIBC_2.17>
    100013d4:	18 00 41 e8 	ld      r2,24(r1)
    100013d8:	01 00 20 39 	li      r9,1
    100013dc:	58 02 21 91 	stw     r9,600(r1)
    100013e0:	fe ff a2 3f 	addis   r29,r2,-2
    100013e4:	fe ff c2 3f 	addis   r30,r2,-2
    100013e8:	e8 95 bd 3b 	addi    r29,r29,-27160
    100013ec:	f8 95 de 3b 	addi    r30,r30,-27144
    100013f0:	fe ff e2 3c 	addis   r7,r2,-2
    100013f4:	78 fb e5 7f 	mr      r5,r31
    100013f8:	f0 95 e7 38 	addi    r7,r7,-27152
    100013fc:	78 f3 c3 7f 	mr      r3,r30
    10001400:	58 02 21 39 	addi    r9,r1,600
    10001404:	78 eb a8 7f 	mr      r8,r29
    10001408:	53 00 c0 38 	li      r6,83
    1000140c:	00 00 80 38 	li      r4,0
    10001410:	c9 01 00 48 	bl      100015d8 <check+0x8>
    10001414:	00 00 00 60 	nop
    10001418:	fe ff e2 3c 	addis   r7,r2,-2
    1000141c:	58 02 21 39 	addi    r9,r1,600
    10001420:	78 eb a8 7f 	mr      r8,r29
    10001424:	00 96 e7 38 	addi    r7,r7,-27136
    10001428:	78 fb e5 7f 	mr      r5,r31
    1000142c:	78 f3 c3 7f 	mr      r3,r30
    10001430:	42 00 c0 38 	li      r6,66
    10001434:	01 00 80 38 	li      r4,1
    10001438:	a1 01 00 48 	bl      100015d8 <check+0x8>
    1000143c:	00 00 00 60 	nop
    10001440:	fe ff e2 3c 	addis   r7,r2,-2
    10001444:	58 02 21 39 	addi    r9,r1,600
    10001448:	78 eb a8 7f 	mr      r8,r29
    1000144c:	78 f3 c3 7f 	mr      r3,r30
    10001450:	78 fb e5 7f 	mr      r5,r31
    10001454:	08 96 e7 38 	addi    r7,r7,-27128
    10001458:	3c 00 c0 38 	li      r6,60
    1000145c:	02 00 80 38 	li      r4,2
    10001460:	79 01 00 48 	bl      100015d8 <check+0x8>
    10001464:	00 00 00 60 	nop
    10001468:	5a 02 61 e8 	lwa     r3,600(r1)
    1000146c:	80 02 21 38 	addi    r1,r1,640
    10001470:	10 00 01 e8 	ld      r0,16(r1)
    10001474:	e8 ff a1 eb 	ld      r29,-24(r1)
    10001478:	f0 ff c1 eb 	ld      r30,-16(r1)
    1000147c:	f8 ff e1 eb 	ld      r31,-8(r1)
    10001480:	a6 03 08 7c 	mtlr    r0
    10001484:	20 00 80 4e 	blr
    10001488:	00 00 00 60 	nop
    1000148c:	00 00 42 60 	ori     r2,r2,0
    10001490:	00 00 00 60 	nop
    10001494:	e0 80 22 e9 	ld      r9,-32544(r2)
    10001498:	fe ff 82 3c 	addis   r4,r2,-2
    1000149c:	88 95 84 38 	addi    r4,r4,-27256
    100014a0:	00 00 69 e8 	ld      r3,0(r9)
    100014a4:	cd f9 ff 4b 	bl      10000e70 <0000003a.plt_call.fprintf@@GLIBC_2.17>
    100014a8:	18 00 41 e8 	ld      r2,24(r1)
    100014ac:	01 00 20 39 	li      r9,1
    100014b0:	58 02 21 91 	stw     r9,600(r1)
    100014b4:	fc fe ff 4b 	b       100013b0 <f3.constprop.1+0x70>
    100014b8:	00 00 00 00 	.long 0x0
    100014bc:	00 00 00 01 	.long 0x1000000
    100014c0:	80 03 00 00 	.long 0x380
    100014c4:	00 00 00 60 	nop
    100014c8:	00 00 00 60 	nop
    100014cc:	00 00 42 60 	ori     r2,r2,0
Comment 3 Steve Ellcey 2017-08-08 20:38:55 UTC
I see this same failure on aarch64-*-linux-gnu.

% ./ttest
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
test1: not enough frames; got 1, expected at least 3
FAIL: threaded backtrace_full noinline
Comment 4 Wilco 2017-08-16 13:05:45 UTC
Confirmed. It works fine for me with ttest_CFLAGS = -pthread -funwind-tables so the issue is that it doesn't also add $(AM_CFLAGS) like btest_CFLAGS does.
Comment 5 Steve Ellcey 2017-09-12 16:34:02 UTC
Author: sje
Date: Tue Sep 12 16:33:31 2017
New Revision: 252035

URL: https://gcc.gnu.org/viewcvs?rev=252035&root=gcc&view=rev
Log:
2017-09-12  Steve Ellcey  <sellcey@cavium.com>

	PR other/81096
	* libbacktrace/Makefile.in
	(HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)

Modified:
    trunk/libbacktrace/ChangeLog
    trunk/libbacktrace/Makefile.in
Comment 6 Steve Ellcey 2017-09-12 17:00:31 UTC
Author: sje
Date: Tue Sep 12 17:00:00 2017
New Revision: 252038

URL: https://gcc.gnu.org/viewcvs?rev=252038&root=gcc&view=rev
Log:
2017-09-12  Steve Ellcey  <sellcey@cavium.com>

	PR other/81096
	* Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
	* Makefile.in: Regenerate.

Modified:
    trunk/libbacktrace/ChangeLog
    trunk/libbacktrace/Makefile.am
Comment 7 Wilco 2017-11-02 18:29:54 UTC
Is this now fixed on PPC too? If so, it can be closed.
Comment 8 seurer 2017-11-07 18:58:49 UTC
Yes, it works on ppc64 now too.