public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104523] New: G++ crash when compiling a simple module that includes pybind11/stl.h
@ 2022-02-13 22:45 juanjo at juanjoalvarez dot net
  2022-02-13 22:51 ` [Bug c++/104523] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: juanjo at juanjoalvarez dot net @ 2022-02-13 22:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104523
           Summary: G++ crash when compiling a simple module that includes
                    pybind11/stl.h
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juanjo at juanjoalvarez dot net
  Target Milestone: ---

// Info
Version of GCC: gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
System type; Ubuntu 21.10 AMD64.

// Steps to reproduce

I have a very simple to reproduce segmentation fault on the compiler when using
C++20 modules.

Steps to reproduce:

1. Install PyBind11 header files (it's a header only lib). If you have Python
the simplest way to do it is to "pip install pybind11". Then get the include
path, it usually will be at (python site-packages dir)/pybind11/include.

2. Install Python development header files (usually called pythonx.y-dev on
most distros).

3. Compile the file below with (update the include paths):

c++ -std=c++20 -fmodules-ts \
  -I/home/juanjux/.local/lib/python3.9/site-packages/pybind11/include \
  -I/home/juanjux/.pyenv/versions/3.9.7/include/python3.9 \
  -c -o build/PyBind11Module.o PyBind11Module.cpp



// File PyBind11Module.cpp start -->

module;
#include <pybind11/stl.h>
export module PyBind11Module;

// <--- File end

Result on my system:

PyBind11Module.cpp:5:9: internal compiler error: Segmentation fault
    5 | export module PyBind11Module;
      |         ^~~~~~
0xb0c67e crash_signal
        ../../src/gcc/toplev.c:327
0x7f517144d51f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x9ca50d node_template_info
        ../../src/gcc/cp/module.cc:3895
0x9f0f5d get_originating_module_decl(tree_node*)
        ../../src/gcc/cp/module.cc:18327
0x9ded59 trees_out::decl_value(tree_node*, depset*)
        ../../src/gcc/cp/module.cc:7523
0x9df5c9 trees_out::decl_node(tree_node*, walk_kind)
        ../../src/gcc/cp/module.cc:8247
0x9e012a trees_out::tree_node(tree_node*)
        ../../src/gcc/cp/module.cc:9085
0x9ead9a module_state::write_cluster(elf_out*, depset**, unsigned int,
depset::hash&, unsigned int*, unsigned int*)
        ../../src/gcc/cp/module.cc:14633
0xa08f7a module_state::write(elf_out*, cpp_reader*)
        ../../src/gcc/cp/module.cc:17736
0x638d8a finish_module_processing(cpp_reader*)
        ../../src/gcc/cp/module.cc:19859
0xfa265e c_parse_final_cleanups()
        ../../src/gcc/cp/decl2.c:5175
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.

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

end of thread, other threads:[~2024-03-06 22:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-13 22:45 [Bug c++/104523] New: G++ crash when compiling a simple module that includes pybind11/stl.h juanjo at juanjoalvarez dot net
2022-02-13 22:51 ` [Bug c++/104523] " pinskia at gcc dot gnu.org
2022-02-13 23:52 ` juanjo at juanjoalvarez dot net
2022-02-13 23:55 ` pinskia at gcc dot gnu.org
2022-02-13 23:57 ` pinskia at gcc dot gnu.org
2022-02-14 20:36 ` pinskia at gcc dot gnu.org
2024-03-06 22:12 ` ppalka 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).