public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure
@ 2020-10-27 14:48 seurer at gcc dot gnu.org
2020-10-27 15:09 ` [Bug gcov-profile/97594] [11 Regression] " rguenth at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: seurer at gcc dot gnu.org @ 2020-10-27 14:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97594
Bug ID: 97594
Summary: new test case gcc.dg/tree-prof/pr97461.c execution
failure
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: seurer at gcc dot gnu.org
Target Milestone: ---
g:14e19b82c1e67ead60c3095ac23347317298904b, r11-4423
make -k check-gcc RUNTESTFLAGS=tree-prof.exp=gcc.dg/tree-prof/pr97461.c
FAIL: gcc.dg/tree-prof/pr97461.c execution, -fprofile-generate
-D_PROFILE_GENERATE
# of expected passes 1
# of unexpected failures 1
# of unsupported tests 1
# of unresolved testcases 2
Executing on host: /home3/seurer/gcc/git/build/gcc-trunk/gcc/xgcc
-B/home3/seurer/gcc/git/build/gcc-trunk/gcc/
/home/seurer/gcc/git/gcc-trunk/gcc/testsuite/gcc.dg/tree-prof/pr97461.c
-fdiagnostics-plain-output -O2 -ldl -fprofile-generate -D_PROFILE_GENERATE
-dumpbase-ext .x01 -lm -o
/home/seurer/gcc/git/build/gcc-trunk/gcc/testsuite/gcc/pr97461.x01 (timeout
= 300)
spawn -ignore SIGHUP /home3/seurer/gcc/git/build/gcc-trunk/gcc/xgcc
-B/home3/seurer/gcc/git/build/gcc-trunk/gcc/
/home/seurer/gcc/git/gcc-trunk/gcc/testsuite/gcc.dg/tree-prof/pr97461.c
-fdiagnostics-plain-output -O2 -ldl -fprofile-generate -D_PROFILE_GENERATE
-dumpbase-ext .x01 -lm -o
/home/seurer/gcc/git/build/gcc-trunk/gcc/testsuite/gcc/pr97461.x01
PASS: gcc.dg/tree-prof/pr97461.c compilation, -fprofile-generate
-D_PROFILE_GENERATE
Setting LD_LIBRARY_PATH to
:/home3/seurer/gcc/git/build/gcc-trunk/gcc::/home3/seurer/gcc/git/build/gcc-trunk/gcc:/home/seurer/gcc/git/build/gcc-trunk/./gmp/.libs:/home/seurer/gcc/git/build/gcc-trunk/./prev-gmp/.libs:/home/seurer/gcc/git/build/gcc-trunk/./mpfr/src/.libs:/home/seurer/gcc/git/build/gcc-trunk/./prev-mpfr/src/.libs:/home/seurer/gcc/git/build/gcc-trunk/./mpc/src/.libs:/home/seurer/gcc/git/build/gcc-trunk/./prev-mpc/src/.libs:/home/seurer/gcc/git/build/gcc-trunk/./isl/.libs:/home/seurer/gcc/git/build/gcc-trunk/./prev-isl/.libs
Execution timeout is: 300
spawn [open ...]
FAIL: gcc.dg/tree-prof/pr97461.c execution, -fprofile-generate
-D_PROFILE_GENERATE
UNRESOLVED: gcc.dg/tree-prof/pr97461.c compilation, -fprofile-use
-D_PROFILE_USE
UNRESOLVED: gcc.dg/tree-prof/pr97461.c execution, -fprofile-use
-D_PROFILE_USE
UNSUPPORTED: gcc.dg/tree-prof/pr97461.c -fauto-profile
testcase
/home/seurer/gcc/git/gcc-trunk/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp
completed in 1 seconds
=== gcc Summary ===
# of expected passes 1
# of unexpected failures 1
# of unresolved testcases 2
# of unsupported tests 1
commit 14e19b82c1e67ead60c3095ac23347317298904b (HEAD)
Author: Martin Liska <mliska@suse.cz>
Date: Mon Oct 19 17:40:00 2020 +0200
gcov-profile: use static pool for TOPN first
gcc/ChangeLog:
PR gcov-profile/97461
* gcov-io.h (GCOV_PREALLOCATED_KVP): Pre-allocate 64
static counters.
libgcc/ChangeLog:
PR gcov-profile/97461
* libgcov.h (gcov_counter_add): Use first static counters
as it should help to have malloc wrappers set up.
gcc/testsuite/ChangeLog:
PR gcov-profile/97461
* gcc.dg/tree-prof/pr97461.c: New test.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/97594] [11 Regression] new test case gcc.dg/tree-prof/pr97461.c execution failure
2020-10-27 14:48 [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure seurer at gcc dot gnu.org
@ 2020-10-27 15:09 ` rguenth at gcc dot gnu.org
2020-10-27 15:11 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-27 15:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97594
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|new test case |[11 Regression] new test
|gcc.dg/tree-prof/pr97461.c |case
|execution failure |gcc.dg/tree-prof/pr97461.c
| |execution failure
CC| |marxin at gcc dot gnu.org
Target Milestone|--- |11.0
Component|other |gcov-profile
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/97594] [11 Regression] new test case gcc.dg/tree-prof/pr97461.c execution failure
2020-10-27 14:48 [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure seurer at gcc dot gnu.org
2020-10-27 15:09 ` [Bug gcov-profile/97594] [11 Regression] " rguenth at gcc dot gnu.org
@ 2020-10-27 15:11 ` marxin at gcc dot gnu.org
2020-10-27 15:43 ` marxin at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-27 15:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97594
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org
Ever confirmed|0 |1
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2020-10-27
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Mine, I see a strange error:
$ Program received signal SIGBUS, Bus error.
0x00003fffb7ceddbc in __GI__IO_link_in () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install
glibc-2.17-307.el7.1.ppc64le
(gdb) bt
#0 0x00003fffb7ceddbc in __GI__IO_link_in () from /lib64/libc.so.6
#1 0x00003fffb7cebe58 in _IO_new_file_init_internal () from /lib64/libc.so.6
#2 0x00003fffb7cd9dcc in fdopen@@GLIBC_2.17 () from /lib64/libc.so.6
#3 0x0000000010002928 in __gcov_open (name=0x100204f0 <memory+8>
"/home/marxin/Programming/gcc/objdir/gcc/testsuite/gcc35/pr97461.gcda") at
../../../libgcc/../gcc/gcov-io.c:171
#4 0x0000000010002db8 in gcov_exit_open_gcda_file (gi_ptr=0x10020408,
gi_ptr=0x10020408, gf=<synthetic pointer>) at
../../../libgcc/libgcov-driver-system.c:312
#5 dump_one_gcov (run_max=<optimized out>, run_counted=<optimized out>,
gf=<synthetic pointer>, gi_ptr=0x10020408) at
../../../libgcc/libgcov-driver.c:478
#6 gcov_do_dump (list=<optimized out>, run_counted=<optimized out>) at
../../../libgcc/libgcov-driver.c:555
#7 0x00000000100047d8 in __gcov_dump_one (root=0x10040590 <__gcov_root>) at
../../../libgcc/libgcov-driver.c:578
#8 __gcov_dump_one (root=0x10040590 <__gcov_root>) at
../../../libgcc/libgcov-driver.c:573
#9 __gcov_exit () at ../../../libgcc/libgcov-driver.c:600
#10 0x0000000010000e18 in _sub_D_00100_1 ()
#11 0x00003fffb7fc7c68 in _dl_fini () from /lib64/ld64.so.2
#12 0x00003fffb7ca4a34 in __run_exit_handlers () from /lib64/libc.so.6
#13 0x00003fffb7ca4a84 in exit () from /lib64/libc.so.6
#14 0x00003fffb7c85308 in generic_start_main.isra.0 () from /lib64/libc.so.6
#15 0x00003fffb7c854f4 in __libc_start_main () from /lib64/libc.so.6
#16 0x0000000000000000 in ?? ()
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/97594] [11 Regression] new test case gcc.dg/tree-prof/pr97461.c execution failure
2020-10-27 14:48 [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure seurer at gcc dot gnu.org
2020-10-27 15:09 ` [Bug gcov-profile/97594] [11 Regression] " rguenth at gcc dot gnu.org
2020-10-27 15:11 ` marxin at gcc dot gnu.org
@ 2020-10-27 15:43 ` marxin at gcc dot gnu.org
2020-11-06 6:10 ` linkw at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-27 15:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97594
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> Mine, I see a strange error:
>
> $ Program received signal SIGBUS, Bus error.
> 0x00003fffb7ceddbc in __GI__IO_link_in () from /lib64/libc.so.6
> Missing separate debuginfos, use: debuginfo-install
> glibc-2.17-307.el7.1.ppc64le
> (gdb) bt
> #0 0x00003fffb7ceddbc in __GI__IO_link_in () from /lib64/libc.so.6
> #1 0x00003fffb7cebe58 in _IO_new_file_init_internal () from /lib64/libc.so.6
> #2 0x00003fffb7cd9dcc in fdopen@@GLIBC_2.17 () from /lib64/libc.so.6
> #3 0x0000000010002928 in __gcov_open (name=0x100204f0 <memory+8>
> "/home/marxin/Programming/gcc/objdir/gcc/testsuite/gcc35/pr97461.gcda") at
> ../../../libgcc/../gcc/gcov-io.c:171
> #4 0x0000000010002db8 in gcov_exit_open_gcda_file (gi_ptr=0x10020408,
> gi_ptr=0x10020408, gf=<synthetic pointer>) at
> ../../../libgcc/libgcov-driver-system.c:312
> #5 dump_one_gcov (run_max=<optimized out>, run_counted=<optimized out>,
> gf=<synthetic pointer>, gi_ptr=0x10020408) at
> ../../../libgcc/libgcov-driver.c:478
> #6 gcov_do_dump (list=<optimized out>, run_counted=<optimized out>) at
> ../../../libgcc/libgcov-driver.c:555
> #7 0x00000000100047d8 in __gcov_dump_one (root=0x10040590 <__gcov_root>) at
> ../../../libgcc/libgcov-driver.c:578
> #8 __gcov_dump_one (root=0x10040590 <__gcov_root>) at
> ../../../libgcc/libgcov-driver.c:573
> #9 __gcov_exit () at ../../../libgcc/libgcov-driver.c:600
> #10 0x0000000010000e18 in _sub_D_00100_1 ()
> #11 0x00003fffb7fc7c68 in _dl_fini () from /lib64/ld64.so.2
> #12 0x00003fffb7ca4a34 in __run_exit_handlers () from /lib64/libc.so.6
> #13 0x00003fffb7ca4a84 in exit () from /lib64/libc.so.6
> #14 0x00003fffb7c85308 in generic_start_main.isra.0 () from /lib64/libc.so.6
> #15 0x00003fffb7c854f4 in __libc_start_main () from /lib64/libc.so.6
> #16 0x0000000000000000 in ?? ()
All right, so the test-case overloads malloc and returns a memory that is a
static buffer. For some reason, it leads to SEGBUS.
Do Power people know what's causing that?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/97594] [11 Regression] new test case gcc.dg/tree-prof/pr97461.c execution failure
2020-10-27 14:48 [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure seurer at gcc dot gnu.org
` (2 preceding siblings ...)
2020-10-27 15:43 ` marxin at gcc dot gnu.org
@ 2020-11-06 6:10 ` linkw at gcc dot gnu.org
2020-11-06 13:18 ` marxin at gcc dot gnu.org
2020-11-06 13:49 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: linkw at gcc dot gnu.org @ 2020-11-06 6:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97594
--- Comment #3 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #2)
> (In reply to Martin Liška from comment #1)
> > Mine, I see a strange error:
> >
> > $ Program received signal SIGBUS, Bus error.
> > 0x00003fffb7ceddbc in __GI__IO_link_in () from /lib64/libc.so.6
> > Missing separate debuginfos, use: debuginfo-install
> > glibc-2.17-307.el7.1.ppc64le
> > (gdb) bt
> > #0 0x00003fffb7ceddbc in __GI__IO_link_in () from /lib64/libc.so.6
> > #1 0x00003fffb7cebe58 in _IO_new_file_init_internal () from /lib64/libc.so.6
>
> All right, so the test-case overloads malloc and returns a memory that is a
> static buffer. For some reason, it leads to SEGBUS.
> Do Power people know what's causing that?
I was testing the patch for PR97705 and met this issue during regression
testing, happened to notice this PR and just realized this one is also a random
issue. (how lucky I am :-))
Checked the assembly insn causing the SEGBUS
0x00007ffff7cc6940 <+240>: beq 0x7ffff7cc6b30 <__GI__IO_link_in+736>
0x00007ffff7cc6944 <+244>: li r9,1
0x00007ffff7cc6948 <+248>: clrldi r10,r10,32
=> 0x00007ffff7cc694c <+252>: lwarx r8,0,r3
0x00007ffff7cc6950 <+256>: subf. r8,r10,r8
r3 0x100207e6 268568550
As Power ISA pointed out, the EA for lwarx must be a multiple of 4. "If it is
not, either the system alignment error handler is invoked or the results are
boundedly undefined."
So the code of function __GI__IO_link_in has already assumed the address there
would have one reasonable alignment.
By checking the manual of malloc/calloc, it says:
RETURN VALUE
The malloc() and calloc() functions return a pointer to the
allocated memory, which is suitably aligned for any built-in
type. On error, these functions return NULL. NULL may also be
returned by a successful call to malloc() with a size of zero,
or by a successful call to calloc() with nmemb or size equal to
zero.
I think the assumption there is reasonable, the addresses returned from
user-overloaded malloc/calloc should also take care of this alignment
requirement and adjust the return address respecting this.
The below small patch can get the case to pass.
$ diff ~/gcc/gcc-git/gcc/testsuite/gcc.dg/tree-prof/pr97461.c pr97461.c
20a21,26
> /* The malloc() and calloc() functions return a pointer to the allocated
> memory, which is suitably aligned for any built-in type. Use 16
> bytes here as the basic alignment requirement for user-defined malloc
> and calloc. See PR97594 for the details. */
> #define ROUND_UP_FOR_16B_ALIGNMENT(x) ((x + 15) & (-16))
>
23c29
< memory_p += size;
---
> memory_p += ROUND_UP_FOR_16B_ALIGNMENT (size);
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/97594] [11 Regression] new test case gcc.dg/tree-prof/pr97461.c execution failure
2020-10-27 14:48 [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure seurer at gcc dot gnu.org
` (3 preceding siblings ...)
2020-11-06 6:10 ` linkw at gcc dot gnu.org
@ 2020-11-06 13:18 ` marxin at gcc dot gnu.org
2020-11-06 13:49 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-06 13:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97594
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Thank you Kewen, the patch works! The analysis is correct, what a stupid
mistake from my side :P.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug gcov-profile/97594] [11 Regression] new test case gcc.dg/tree-prof/pr97461.c execution failure
2020-10-27 14:48 [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure seurer at gcc dot gnu.org
` (4 preceding siblings ...)
2020-11-06 13:18 ` marxin at gcc dot gnu.org
@ 2020-11-06 13:49 ` marxin at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-06 13:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97594
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed in r11-4785-g15bcd01a94c23f312ac03b5faea29f18ef8d2a07.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-11-06 13:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 14:48 [Bug other/97594] New: new test case gcc.dg/tree-prof/pr97461.c execution failure seurer at gcc dot gnu.org
2020-10-27 15:09 ` [Bug gcov-profile/97594] [11 Regression] " rguenth at gcc dot gnu.org
2020-10-27 15:11 ` marxin at gcc dot gnu.org
2020-10-27 15:43 ` marxin at gcc dot gnu.org
2020-11-06 6:10 ` linkw at gcc dot gnu.org
2020-11-06 13:18 ` marxin at gcc dot gnu.org
2020-11-06 13:49 ` marxin at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).