public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc
@ 2021-04-23 21:51 taraba.peter at mail dot com
  2021-04-23 21:52 ` [Bug c++/100240] " taraba.peter at mail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-23 21:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100240
           Summary: Compiler crashes with segmentation fault on a chrono
                    library using nvcc
           Product: gcc
           Version: 10.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: taraba.peter at mail dot com
  Target Milestone: ---

Repro steps:
1. Install Ubuntu 21.04 (with third party libraries install enabled)
2. sudo apt install nvidia-cuda-toolkit
3. git clone https://github.com/pepe78/DeeperThought
4. cd DeeperThought
5. ./compile.sh
[ https://www.frisky.world/2021/04/testing-ubuntu-2104.html ]

Output from compilation:
pepe@pepe-MS-7C90:~/code/DeeperThought$ ./compile.sh 
/usr/include/c++/10/chrono: In substitution of ‘template<class _Rep, class
_Period> template<class _Period2> using __is_harmonic =
std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep,
_Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den /
std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))),
((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den,
_Period::den)) * (_Period::num / std::chrono::duration<_Rep,
_Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 =
_Period2; _Rep = _Rep; _Period = _Period]’:
/usr/include/c++/10/chrono:473:154:   required from here
/usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault
  428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
      |                           ^~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
pepe@pepe-MS-7C90:~/code/DeeperThought$ cat compile.sh 
nvcc -o dt ./DeeperThought/*.cu



Version of gcc:

pepe@pepe-MS-7C90:~/code/DeeperThought$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.3.0-1ubuntu1'
--with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-10
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-10-gDeRY6/gcc-10-10.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-gDeRY6/gcc-10-10.3.0/debian/tmp-gcn/usr,hsa
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1) 
pepe@pepe-MS-7C90:~/code/DeeperThought$

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
@ 2021-04-23 21:52 ` taraba.peter at mail dot com
  2021-04-23 23:38 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-23 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Taraba <taraba.peter at mail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |taraba.peter at mail dot com

--- Comment #1 from Peter Taraba <taraba.peter at mail dot com> ---
It used to work on Ubuntu 19.04 & 20.04 just fine:
[https://www.frisky.world/2019/04/testing-ubuntu-1904.html]

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
  2021-04-23 21:52 ` [Bug c++/100240] " taraba.peter at mail dot com
@ 2021-04-23 23:38 ` pinskia at gcc dot gnu.org
  2021-04-24  1:51 ` taraba.peter at mail dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-04-23 23:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|https://www.frisky.world/20 |
                   |21/04/lets-talk-about-biode |
                   |gradable-food.html          |
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2021-04-23

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you attach the preprocessed source as request on https://gcc.gnu.org/bugs/
?
Also what is up with the spam in the URL field?

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
  2021-04-23 21:52 ` [Bug c++/100240] " taraba.peter at mail dot com
  2021-04-23 23:38 ` pinskia at gcc dot gnu.org
@ 2021-04-24  1:51 ` taraba.peter at mail dot com
  2021-04-24  4:27 ` taraba.peter at mail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-24  1:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Peter Taraba <taraba.peter at mail dot com> ---
unfortunately this is using nvcc, which calls probably gcc internally, so
adding option "-save-temps to the complete compilation command" is not going to
provide what you want.

also, I have no clue what "spam" you are mentioning. Provided URLs are legit
websites.

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
                   ` (2 preceding siblings ...)
  2021-04-24  1:51 ` taraba.peter at mail dot com
@ 2021-04-24  4:27 ` taraba.peter at mail dot com
  2021-04-24 19:32 ` taraba.peter at mail dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-24  4:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Peter Taraba <taraba.peter at mail dot com> ---
Actually this works:

nvcc -o dt ./DeeperThought/*.cu -save-temps

But files it creates even if zipped are above 1MB (which is not allowed to be
attached).

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
                   ` (3 preceding siblings ...)
  2021-04-24  4:27 ` taraba.peter at mail dot com
@ 2021-04-24 19:32 ` taraba.peter at mail dot com
  2021-04-26  7:21 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-24 19:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Peter Taraba <taraba.peter at mail dot com> ---
Also, not sure if this info helps, but this bug does not seem to appear with
gcc 10.2 (I tried it on Manjaro KDE Plasma linux). So it's probably some new
code which came after 10.2. Cheers.

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
                   ` (4 preceding siblings ...)
  2021-04-24 19:32 ` taraba.peter at mail dot com
@ 2021-04-26  7:21 ` rguenth at gcc dot gnu.org
  2021-04-26 21:18 ` taraba.peter at mail dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-26  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Peter Taraba from comment #3)
> unfortunately this is using nvcc, which calls probably gcc internally, so
> adding option "-save-temps to the complete compilation command" is not going
> to provide what you want.
> 
> also, I have no clue what "spam" you are mentioning. Provided URLs are legit
> websites.

It should work to provide the input to cc1plus which is the process crashing?

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
                   ` (5 preceding siblings ...)
  2021-04-26  7:21 ` rguenth at gcc dot gnu.org
@ 2021-04-26 21:18 ` taraba.peter at mail dot com
  2021-04-27  1:42 ` taraba.peter at mail dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-26 21:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Peter Taraba <taraba.peter at mail dot com> ---
Created attachment 50682
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50682&action=edit
*.i files zipped

crashes on DNNLayerMatrix (attaching .i* files zipped).

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
                   ` (6 preceding siblings ...)
  2021-04-26 21:18 ` taraba.peter at mail dot com
@ 2021-04-27  1:42 ` taraba.peter at mail dot com
  2021-04-28  1:22 ` ed.gcc at pobox dot com
  2021-04-28 14:56 ` taraba.peter at mail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-27  1:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Peter Taraba <taraba.peter at mail dot com> ---
So, this is happening also with gcc11:

pepe@pepe-MS-7C90:~/code/DeeperThought$ ./compile.sh 
/usr/include/c++/10/chrono: In substitution of ‘template<class _Rep, class
_Period> template<class _Period2> using __is_harmonic =
std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep,
_Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den /
std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))),
((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den,
_Period::den)) * (_Period::num / std::chrono::duration<_Rep,
_Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 =
_Period2; _Rep = _Rep; _Period = _Period]’:
/usr/include/c++/10/chrono:473:154:   required from here
/usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault
  428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
      |                           ^~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
pepe@pepe-MS-7C90:~/code/DeeperThought$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
11-20210417-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-11
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-11-pzZXCn/gcc-11-11-20210417/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-pzZXCn/gcc-11-11-20210417/debian/tmp-gcn/usr
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210417 (experimental) [master revision
c1c86ab96c2:b6fb0ccbb48:8ae884c09fbba91e9cec391290ee4a2859e7ff41] (Ubuntu
11-20210417-1ubuntu1)

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
                   ` (7 preceding siblings ...)
  2021-04-27  1:42 ` taraba.peter at mail dot com
@ 2021-04-28  1:22 ` ed.gcc at pobox dot com
  2021-04-28 14:56 ` taraba.peter at mail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: ed.gcc at pobox dot com @ 2021-04-28  1:22 UTC (permalink / raw)
  To: gcc-bugs

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

Eduard Rozenberg <ed.gcc at pobox dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ed.gcc at pobox dot com

--- Comment #9 from Eduard Rozenberg <ed.gcc at pobox dot com> ---
I run into similar errors (probably the same issue), when trying to use Nvidia
NCCL.

For ex. when trying to run `make` on the nccl tests
(https://github.com/NVIDIA/nccl-tests.git), I get:

nccl-tests/src'
Compiling  all_reduce.cu                       > ../build/all_reduce.o
/usr/include/c++/10.3.0/chrono: In substitution of ‘template<class _Rep, class
_Period> template<class _Period2> using __is_harmonic =
std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep,
_Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den /
std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))),
((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den,
_Period::den)) * (_Period::num / std::chrono::duration<_Rep,
_Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 =
_Period2; _Rep = _Rep; _Period = _Period]’:
/usr/include/c++/10.3.0/chrono:473:154:   required from here
/usr/include/c++/10.3.0/chrono:428:27: internal compiler error: Segmentation
fault
  428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
      |                           ^~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make[1]: *** [Makefile:84: ../build/all_reduce.o] Error 1


And I get build errors when trying to build pytorch since it also tries to use
Nvidia nccl.

The following might be relevant/related but can't tell for sure:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100101
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100102

Even if the issue eventually gets fixed in GCC 11/12, what will the solution be
for GCC 10.3 (10.x) users? Asking because it normally takes operating systems
and Nvidia months or years to move to or support the next major GCC version,
and in particular it's recommended to use the same GCC version as the operating
system's kernel is built with, so I wouldn't be able to decide to just use GCC
11 or 12.

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

* [Bug c++/100240] Compiler crashes with segmentation fault on a chrono library using nvcc
  2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
                   ` (8 preceding siblings ...)
  2021-04-28  1:22 ` ed.gcc at pobox dot com
@ 2021-04-28 14:56 ` taraba.peter at mail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: taraba.peter at mail dot com @ 2021-04-28 14:56 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Taraba <taraba.peter at mail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|WAITING                     |RESOLVED

--- Comment #10 from Peter Taraba <taraba.peter at mail dot com> ---
yes, you are correct - i am closing this as it is already filed:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100102
for some reason I did not find it during my search.

*** This bug has been marked as a duplicate of bug 100102 ***

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

end of thread, other threads:[~2021-04-28 14:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 21:51 [Bug c++/100240] New: Compiler crashes with segmentation fault on a chrono library using nvcc taraba.peter at mail dot com
2021-04-23 21:52 ` [Bug c++/100240] " taraba.peter at mail dot com
2021-04-23 23:38 ` pinskia at gcc dot gnu.org
2021-04-24  1:51 ` taraba.peter at mail dot com
2021-04-24  4:27 ` taraba.peter at mail dot com
2021-04-24 19:32 ` taraba.peter at mail dot com
2021-04-26  7:21 ` rguenth at gcc dot gnu.org
2021-04-26 21:18 ` taraba.peter at mail dot com
2021-04-27  1:42 ` taraba.peter at mail dot com
2021-04-28  1:22 ` ed.gcc at pobox dot com
2021-04-28 14:56 ` taraba.peter at mail dot com

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).