public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/110763] New: FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution test
@ 2023-07-21 9:54 rguenth at gcc dot gnu.org
2023-07-26 11:43 ` [Bug testsuite/110763] " cvs-commit at gcc dot gnu.org
2023-07-26 11:52 ` siddhesh at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-21 9:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110763
Bug ID: 110763
Summary: FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution
test
Product: gcc
Version: 13.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
I see this testcase FAILing because it ends up returning uninitialized memory.
This can be seen when enabling glibc malloc perturbing. The 'off' method
ands with zero to avoid this.
int
__attribute__ ((noinline))
dyn (int size, int i)
{
__builtin_printf ("dyn\n");
fflush (stdout);
int *alloc = __builtin_calloc (size, sizeof (int));
int ret = alloc[i];
__builtin_free (alloc);
return ret;
}
...
int
main (void)
{
int ret = dyn (2, 2);
ret |= off (4, 4, 0);
return ret;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug testsuite/110763] FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution test
2023-07-21 9:54 [Bug testsuite/110763] New: FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution test rguenth at gcc dot gnu.org
@ 2023-07-26 11:43 ` cvs-commit at gcc dot gnu.org
2023-07-26 11:52 ` siddhesh at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-26 11:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110763
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Siddhesh Poyarekar
<siddhesh@gcc.gnu.org>:
https://gcc.gnu.org/g:386df7ce7b38ef00e28080a779ef2dfd6949cf15
commit r14-2789-g386df7ce7b38ef00e28080a779ef2dfd6949cf15
Author: Siddhesh Poyarekar <siddhesh@gotplt.org>
Date: Fri Jul 21 11:13:58 2023 -0400
testsuite/110763: Ensure zero return from test
The test deliberately reads beyond bounds to exersize ubsan and the
return value may be anything, based on previous allocations. The OFF
test caters for it by ANDing the return with 0, do the same for the DYN
test.
gcc/testsuite/ChangeLog:
PR testsuite/110763
* gcc.dg/ubsan/object-size-dyn.c (dyn): New parameter RET.
(main): Use it.
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug testsuite/110763] FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution test
2023-07-21 9:54 [Bug testsuite/110763] New: FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution test rguenth at gcc dot gnu.org
2023-07-26 11:43 ` [Bug testsuite/110763] " cvs-commit at gcc dot gnu.org
@ 2023-07-26 11:52 ` siddhesh at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: siddhesh at gcc dot gnu.org @ 2023-07-26 11:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110763
Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-26 11:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-21 9:54 [Bug testsuite/110763] New: FAIL: gcc.dg/ubsan/object-size-dyn.c -O2 execution test rguenth at gcc dot gnu.org
2023-07-26 11:43 ` [Bug testsuite/110763] " cvs-commit at gcc dot gnu.org
2023-07-26 11:52 ` siddhesh 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).