public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/97294] New: ASAN "dynamic-stack-buffer-overflow" false positive with OpenMP reduction to std::vector
@ 2020-10-05 15:19 paulg-b at web dot de
  2020-10-06 10:47 ` [Bug sanitizer/97294] " marxin at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: paulg-b at web dot de @ 2020-10-05 15:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97294

            Bug ID: 97294
           Summary: ASAN "dynamic-stack-buffer-overflow" false positive
                    with OpenMP reduction to std::vector
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: paulg-b at web dot de
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 49308
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49308&action=edit
Minimal example

When the attached minimal example is compiled with

g++ -fsanitize=address -fopenmp -o asan_omp_test asan_omp_test.cpp

and executed, ASAN reports a dynamic-stack-buffer-overflow. I tested gcc 10.2.1
and 8.2 on different systems (one being the login node of a cluster, the other
being my personal computer with a Fedora 32 OS). 

ASAN seems to report on the copy of the array-section invoked by the omp clause
reduction(+ : ptr[:v.size()])
where ptr is a copy of v.data() and v is the std::vector.

This does *not* happen when the std::vector is replaced by std::array. 

The same code does *not* report anything when compiled and ASAN-instrumented
with clang 10.0.1. I first filed a issue
https://github.com/google/sanitizers/issues/1326 and was sent here.

The problem is also *not* reproducible in C when replacing the std::vector with
dynamic memory allocated via calloc.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-09-11 14:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 15:19 [Bug sanitizer/97294] New: ASAN "dynamic-stack-buffer-overflow" false positive with OpenMP reduction to std::vector paulg-b at web dot de
2020-10-06 10:47 ` [Bug sanitizer/97294] " marxin at gcc dot gnu.org
2020-10-07 15:56 ` jakub at gcc dot gnu.org
2020-10-07 15:58 ` jakub at gcc dot gnu.org
2020-10-08  9:13 ` cvs-commit at gcc dot gnu.org
2020-10-08  9:57 ` jakub at gcc dot gnu.org
2020-10-16 11:37 ` cvs-commit at gcc dot gnu.org
2021-04-20 23:29 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:48 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:06 ` jakub at gcc dot gnu.org
2021-09-11 14:29 ` pinskia 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).