public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build
@ 2021-11-29 15:23 pjfloyd at wanadoo dot fr
  2021-11-29 15:26 ` [Bug sanitizer/103466] " marxin at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: pjfloyd at wanadoo dot fr @ 2021-11-29 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103466
           Summary: SIGILL due to use of vmovdqu, thread sanitizer build
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pjfloyd at wanadoo dot fr
                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: ---

With GCC built from source

commit 5e5f880d0452ef2cffb94f4a686d56833c9f4215 (HEAD -> master, origin/trunk,
origin/master, origin/HEAD)

My small testcase:
#include <iostream>
#include <thread>

void f()
{
   std::cout << "Hello from f\n";
}

void g()
{
   std::cout << "Hello from g\n";
}

int main()
{
   std::thread t1(f);
   std::thread t2(g);
   t1.join();
   t2.join();
}

(But it looks like this is happening before main, so the actual testcase may
not matter).

Under GDB:
Program received signal SIGILL, Illegal instruction.
__tsan_trace_switch_thunk () at
../../../../libsanitizer/tsan/tsan_rtl_amd64.S:48
48        vmovdqu %xmm0, 0x0(%rsp)
(gdb) bt
#0  __tsan_trace_switch_thunk () at
../../../../libsanitizer/tsan/tsan_rtl_amd64.S:48
#1  0x00007ffff4dfc62c in __tsan::TraceAddEvent (addr=0,
typ=__tsan::EventTypeMop, fs=..., thr=<optimized out>)
    at ../../../../libsanitizer/tsan/tsan_rtl.h:625
#2  __tsan::ThreadContext::OnStarted (this=0x7ffff2303e80, arg=<optimized out>)
at ../../../../libsanitizer/tsan/tsan_rtl_thread.cpp:209
#3  0x00007ffff4e1c735 in __sanitizer::ThreadContextBase::SetStarted
(arg=0x7fffffffccd0, _thread_type=__sanitizer::ThreadType::Regular,
_os_id=19197,
    this=<optimized out>) at
../../../../libsanitizer/sanitizer_common/sanitizer_thread_registry.cpp:78
#4  __sanitizer::ThreadRegistry::StartThread (this=0x7ffff5889230
<__tsan::ctx_placeholder+10485872>, tid=tid@entry=0, os_id=os_id@entry=19197,
    thread_type=thread_type@entry=__sanitizer::ThreadType::Regular,
arg=arg@entry=0x7fffffffccd0)
    at
../../../../libsanitizer/sanitizer_common/sanitizer_thread_registry.cpp:309
#5  0x00007ffff4dfcdbc in __tsan::ThreadStart (thr=thr@entry=0x7ffff7edb780,
tid=tid@entry=0, os_id=19197,
    thread_type=thread_type@entry=__sanitizer::ThreadType::Regular) at
../../../../libsanitizer/tsan/tsan_rtl_thread.cpp:165
#6  0x00007ffff4de22e0 in __tsan::Initialize (thr=0x7ffff7edb780) at
../../../../libsanitizer/tsan/tsan_rtl.cpp:412
#7  0x00007ffff7deaae3 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#8  0x00007ffff7ddc15a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2

OS:
Red Hat Enterprise Linux Workstation release 7.6 (Maipo)
CPU:
Model name:            Intel(R) Xeon(R) CPU           X5667  @ 3.07GHz
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx
pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm epb ssbd
ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida arat spec_ctrl
intel_stibp flush_l1d


1st line of git blame

86289a4ff476 (H.J. Lu           2021-11-12 22:23:45 -0800  48)   vmovdqu %xmm0,
0x0(%rsp)

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

* [Bug sanitizer/103466] SIGILL due to use of vmovdqu, thread sanitizer build
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
@ 2021-11-29 15:26 ` marxin at gcc dot gnu.org
  2021-11-30  1:13 ` [Bug sanitizer/103466] [12 Regression] SIGILL due to use of vmovdqu when using thread sanitizer (merge from upstream) pinskia at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-29 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
            Summary|SIGILL due to use of        |SIGILL due to use of
                   |vmovdqu when using thread   |vmovdqu, thread sanitizer
                   |sanitizer                   |build
   Last reconfirmed|                            |2021-11-29

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

* [Bug sanitizer/103466] [12 Regression] SIGILL due to use of vmovdqu when using thread sanitizer (merge from upstream)
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
  2021-11-29 15:26 ` [Bug sanitizer/103466] " marxin at gcc dot gnu.org
@ 2021-11-30  1:13 ` pinskia at gcc dot gnu.org
  2021-11-30  1:21 ` [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-30  1:13 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|SIGILL due to use of        |[12 Regression] SIGILL due
                   |vmovdqu when using thread   |to use of vmovdqu when
                   |sanitizer                   |using thread sanitizer
                   |                            |(merge from upstream)
   Target Milestone|---                         |12.0

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
  2021-11-29 15:26 ` [Bug sanitizer/103466] " marxin at gcc dot gnu.org
  2021-11-30  1:13 ` [Bug sanitizer/103466] [12 Regression] SIGILL due to use of vmovdqu when using thread sanitizer (merge from upstream) pinskia at gcc dot gnu.org
@ 2021-11-30  1:21 ` pinskia at gcc dot gnu.org
  2021-11-30  1:22 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-30  1:21 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12 Regression] SIGILL on   |[12 Regression] SIGILL on
                   |machine without avx support |machine without avx support
                   |when using thread sanitizer |when using thread sanitizer
                   |(merge from upstream)       |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't see this section in the upstream sources:
+  # All XMM registers are caller-saved.

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (2 preceding siblings ...)
  2021-11-30  1:21 ` [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer pinskia at gcc dot gnu.org
@ 2021-11-30  1:22 ` pinskia at gcc dot gnu.org
  2021-11-30  1:26 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-30  1:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> I don't see this section in the upstream sources:
> +  # All XMM registers are caller-saved.

Or maybe I am looking at the wrong branch

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (3 preceding siblings ...)
  2021-11-30  1:22 ` pinskia at gcc dot gnu.org
@ 2021-11-30  1:26 ` pinskia at gcc dot gnu.org
  2021-11-30  3:44 ` dvyukov at google dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-30  1:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://reviews.llvm.org/D113742

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (4 preceding siblings ...)
  2021-11-30  1:26 ` pinskia at gcc dot gnu.org
@ 2021-11-30  3:44 ` dvyukov at google dot com
  2021-11-30  7:02 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dvyukov at google dot com @ 2021-11-30  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

Dmitry Vyukov <dvyukov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dvyukov at google dot com

--- Comment #4 from Dmitry Vyukov <dvyukov at google dot com> ---
I guess I needed to use MOVDQU, but this code is unused since
https://github.com/llvm/llvm-project/commit/66d4ce7e26a5 and will be removed in
https://reviews.llvm.org/D112604

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (5 preceding siblings ...)
  2021-11-30  3:44 ` dvyukov at google dot com
@ 2021-11-30  7:02 ` rguenth at gcc dot gnu.org
  2021-11-30 13:47 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-30  7:02 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
            Version|unknown                     |12.0

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (6 preceding siblings ...)
  2021-11-30  7:02 ` rguenth at gcc dot gnu.org
@ 2021-11-30 13:47 ` marxin at gcc dot gnu.org
  2021-12-06 15:44 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-30 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

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
             Status|NEW                         |ASSIGNED

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
I'm planning one more merge from master, so it would be hopefully fixed by tah.

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (7 preceding siblings ...)
  2021-11-30 13:47 ` marxin at gcc dot gnu.org
@ 2021-12-06 15:44 ` jakub at gcc dot gnu.org
  2021-12-06 15:57 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-06 15:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'd say we should patch away locally the initial v prefixes until the merge is
done.

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (8 preceding siblings ...)
  2021-12-06 15:44 ` jakub at gcc dot gnu.org
@ 2021-12-06 15:57 ` hjl.tools at gmail dot com
  2021-12-06 16:19 ` cvs-commit at gcc dot gnu.org
  2021-12-09 13:07 ` marxin at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: hjl.tools at gmail dot com @ 2021-12-06 15:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Jakub Jelinek from comment #6)
> I'd say we should patch away locally the initial v prefixes until the merge
> is done.

The patch is here:

https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585755.html

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (9 preceding siblings ...)
  2021-12-06 15:57 ` hjl.tools at gmail dot com
@ 2021-12-06 16:19 ` cvs-commit at gcc dot gnu.org
  2021-12-09 13:07 ` marxin at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-06 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:70b043845d7c378c6a9361a6769885897d1018c2

commit r12-5806-g70b043845d7c378c6a9361a6769885897d1018c2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Nov 30 05:31:26 2021 -0800

    libsanitizer: Use SSE to save and restore XMM registers

    Use SSE, instead of AVX, to save and restore XMM registers to support
    processors without AVX.  The affected codes are unused in upstream since

    https://github.com/llvm/llvm-project/commit/66d4ce7e26a5

    and will be removed in

    https://reviews.llvm.org/D112604

    This fixed

    FAIL: g++.dg/tsan/pthread_cond_clockwait.C   -O0  execution test
    FAIL: g++.dg/tsan/pthread_cond_clockwait.C   -O2  execution test

    on machines without AVX.

            PR sanitizer/103466
            * tsan/tsan_rtl_amd64.S (__tsan_trace_switch_thunk): Replace
            vmovdqu with movdqu.
            (__tsan_report_race_thunk): Likewise.

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

* [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer
  2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
                   ` (10 preceding siblings ...)
  2021-12-06 16:19 ` cvs-commit at gcc dot gnu.org
@ 2021-12-09 13:07 ` marxin at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-09 13:07 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-12-09 13:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 15:23 [Bug sanitizer/103466] New: SIGILL due to use of vmovdqu, thread sanitizer build pjfloyd at wanadoo dot fr
2021-11-29 15:26 ` [Bug sanitizer/103466] " marxin at gcc dot gnu.org
2021-11-30  1:13 ` [Bug sanitizer/103466] [12 Regression] SIGILL due to use of vmovdqu when using thread sanitizer (merge from upstream) pinskia at gcc dot gnu.org
2021-11-30  1:21 ` [Bug sanitizer/103466] [12 Regression] SIGILL on machine without avx support when using thread sanitizer pinskia at gcc dot gnu.org
2021-11-30  1:22 ` pinskia at gcc dot gnu.org
2021-11-30  1:26 ` pinskia at gcc dot gnu.org
2021-11-30  3:44 ` dvyukov at google dot com
2021-11-30  7:02 ` rguenth at gcc dot gnu.org
2021-11-30 13:47 ` marxin at gcc dot gnu.org
2021-12-06 15:44 ` jakub at gcc dot gnu.org
2021-12-06 15:57 ` hjl.tools at gmail dot com
2021-12-06 16:19 ` cvs-commit at gcc dot gnu.org
2021-12-09 13:07 ` 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).