* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
@ 2015-01-31 17:38 ` mpolacek at gcc dot gnu.org
2015-09-23 16:55 ` mpolacek at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-01-31 17:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-01-31
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yikes. Confirmed.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
2015-01-31 17:38 ` [Bug sanitizer/64888] " mpolacek at gcc dot gnu.org
@ 2015-09-23 16:55 ` mpolacek at gcc dot gnu.org
2015-09-23 22:21 ` mikulas at artax dot karlin.mff.cuni.cz
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-23 16:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started looking into this. Seems that we should handle specially those
artificial ubsan decls such as *.Lubsan_data in omp_default_clause, i.e. treat
them as shared? But I hardly know what I'm talking about; inviting Jakub to
comment.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
2015-01-31 17:38 ` [Bug sanitizer/64888] " mpolacek at gcc dot gnu.org
2015-09-23 16:55 ` mpolacek at gcc dot gnu.org
@ 2015-09-23 22:21 ` mikulas at artax dot karlin.mff.cuni.cz
2015-09-24 8:18 ` mpolacek at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mikulas at artax dot karlin.mff.cuni.cz @ 2015-09-23 22:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #3 from mikulas at artax dot karlin.mff.cuni.cz ---
I think you should treat these artifical variables as private, not shared. If
you treated them as shared, threads would race with each other when accessing
them.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (2 preceding siblings ...)
2015-09-23 22:21 ` mikulas at artax dot karlin.mff.cuni.cz
@ 2015-09-24 8:18 ` mpolacek at gcc dot gnu.org
2021-10-19 8:09 ` claudiokozicky at gmail dot com
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-24 8:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
But these *.Lubsan_data0 are read-only I think, so I don't think there's a
problem if multiple threads read such a variable.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (3 preceding siblings ...)
2015-09-24 8:18 ` mpolacek at gcc dot gnu.org
@ 2021-10-19 8:09 ` claudiokozicky at gmail dot com
2021-10-19 8:16 ` claudiokozicky at gmail dot com
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: claudiokozicky at gmail dot com @ 2021-10-19 8:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
Claudio Kozický <claudiokozicky at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |claudiokozicky at gmail dot com
--- Comment #5 from Claudio Kozický <claudiokozicky at gmail dot com> ---
Created attachment 51627
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51627&action=edit
A minimal testcase to reproduce the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (4 preceding siblings ...)
2021-10-19 8:09 ` claudiokozicky at gmail dot com
@ 2021-10-19 8:16 ` claudiokozicky at gmail dot com
2021-10-19 8:25 ` claudiokozicky at gmail dot com
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: claudiokozicky at gmail dot com @ 2021-10-19 8:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #6 from Claudio Kozický <claudiokozicky at gmail dot com> ---
Created attachment 51628
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51628&action=edit
GCC version
This is the version of GCC with which I have reproduced the bug with.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (5 preceding siblings ...)
2021-10-19 8:16 ` claudiokozicky at gmail dot com
@ 2021-10-19 8:25 ` claudiokozicky at gmail dot com
2021-10-19 8:28 ` claudiokozicky at gmail dot com
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: claudiokozicky at gmail dot com @ 2021-10-19 8:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
Claudio Kozický <claudiokozicky at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #51628|0 |1
is obsolete| |
--- Comment #7 from Claudio Kozický <claudiokozicky at gmail dot com> ---
Created attachment 51629
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51629&action=edit
GCC 11.1.0 compilation log on Arch Linux
executed command: gcc -v -save-temps -fsanitize=undefined -fopenmp
minimal_example.c
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug sanitizer/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (6 preceding siblings ...)
2021-10-19 8:25 ` claudiokozicky at gmail dot com
@ 2021-10-19 8:28 ` claudiokozicky at gmail dot com
2021-10-20 10:44 ` [Bug middle-end/64888] " jakub at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: claudiokozicky at gmail dot com @ 2021-10-19 8:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #8 from Claudio Kozický <claudiokozicky at gmail dot com> ---
Created attachment 51630
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51630&action=edit
GCC 11.1.0 preprocessed source
executed command: gcc -v -save-temps -fsanitize=undefined -fopenmp
minimal_example.c
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (7 preceding siblings ...)
2021-10-19 8:28 ` claudiokozicky at gmail dot com
@ 2021-10-20 10:44 ` jakub at gcc dot gnu.org
2021-10-21 8:30 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-10-20 10:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 51636
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51636&action=edit
gcc12-pr64888.patch
Untested fix.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (8 preceding siblings ...)
2021-10-20 10:44 ` [Bug middle-end/64888] " jakub at gcc dot gnu.org
@ 2021-10-21 8:30 ` cvs-commit at gcc dot gnu.org
2021-11-29 8:49 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-21 8:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:40dd9d839e52f679d8eabc1c5ca0ca17a5ccfd14
commit r12-4599-g40dd9d839e52f679d8eabc1c5ca0ca17a5ccfd14
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Oct 21 10:27:44 2021 +0200
openmp: For default(none) ignore variables created by ubsan_create_data
[PR64888]
We weren't ignoring the ubsan variables created by c-ubsan.c before
gimplification
(others are added later). One way to fix this would be to introduce
further
UBSAN_ internal functions and lower it later (sanopt pass) like other ifns,
this patch instead recognizes those magic vars by name/name of type and
DECL_ARTIFICIAL
and TYPE_ARTIFICIAL.
2021-10-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/64888
gcc/c-family/
* c-omp.c (c_omp_predefined_variable): Return true also for
ubsan_create_data created artificial variables.
gcc/testsuite/
* c-c++-common/ubsan/pr64888.c: New test.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (9 preceding siblings ...)
2021-10-21 8:30 ` cvs-commit at gcc dot gnu.org
@ 2021-11-29 8:49 ` cvs-commit at gcc dot gnu.org
2022-05-10 8:21 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-29 8:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:930ffe933186b66ee33479fe384d4aa08e9f7459
commit r11-9327-g930ffe933186b66ee33479fe384d4aa08e9f7459
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Oct 21 10:27:44 2021 +0200
openmp: For default(none) ignore variables created by ubsan_create_data
[PR64888]
We weren't ignoring the ubsan variables created by c-ubsan.c before
gimplification
(others are added later). One way to fix this would be to introduce
further
UBSAN_ internal functions and lower it later (sanopt pass) like other ifns,
this patch instead recognizes those magic vars by name/name of type and
DECL_ARTIFICIAL
and TYPE_ARTIFICIAL.
2021-10-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/64888
gcc/c-family/
* c-omp.c (c_omp_predefined_variable): Return true also for
ubsan_create_data created artificial variables.
gcc/testsuite/
* c-c++-common/ubsan/pr64888.c: New test.
(cherry picked from commit 40dd9d839e52f679d8eabc1c5ca0ca17a5ccfd14)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (10 preceding siblings ...)
2021-11-29 8:49 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 8:21 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:22 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:32 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 8:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:cf3a927af0c040478280d90559e3e3088256c6fc
commit r10-10651-gcf3a927af0c040478280d90559e3e3088256c6fc
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Oct 21 10:27:44 2021 +0200
openmp: For default(none) ignore variables created by ubsan_create_data
[PR64888]
We weren't ignoring the ubsan variables created by c-ubsan.c before
gimplification
(others are added later). One way to fix this would be to introduce
further
UBSAN_ internal functions and lower it later (sanopt pass) like other ifns,
this patch instead recognizes those magic vars by name/name of type and
DECL_ARTIFICIAL
and TYPE_ARTIFICIAL.
2021-10-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/64888
gcc/c-family/
* c-omp.c (c_omp_predefined_variable): Return true also for
ubsan_create_data created artificial variables.
gcc/testsuite/
* c-c++-common/ubsan/pr64888.c: New test.
(cherry picked from commit 40dd9d839e52f679d8eabc1c5ca0ca17a5ccfd14)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (11 preceding siblings ...)
2022-05-10 8:21 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:22 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:32 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11 6:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:a76e866211798da138c51abea390bcd605b6da02
commit r9-10107-ga76e866211798da138c51abea390bcd605b6da02
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Oct 21 10:27:44 2021 +0200
openmp: For default(none) ignore variables created by ubsan_create_data
[PR64888]
We weren't ignoring the ubsan variables created by c-ubsan.c before
gimplification
(others are added later). One way to fix this would be to introduce
further
UBSAN_ internal functions and lower it later (sanopt pass) like other ifns,
this patch instead recognizes those magic vars by name/name of type and
DECL_ARTIFICIAL
and TYPE_ARTIFICIAL.
2021-10-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/64888
gcc/c-family/
* c-omp.c (c_omp_predefined_variable): Return true also for
ubsan_create_data created artificial variables.
gcc/testsuite/
* c-c++-common/ubsan/pr64888.c: New test.
(cherry picked from commit 40dd9d839e52f679d8eabc1c5ca0ca17a5ccfd14)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug middle-end/64888] ubsan doesn't work with openmp
2015-01-31 17:20 [Bug sanitizer/64888] New: ubsan doesn't work with openmp mikulas at artax dot karlin.mff.cuni.cz
` (12 preceding siblings ...)
2022-05-11 6:22 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:32 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-11 6:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64888
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 15+ messages in thread