From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B662E385840A; Sun, 13 Feb 2022 22:45:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B662E385840A From: "juanjo at juanjoalvarez dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104523] New: G++ crash when compiling a simple module that includes pybind11/stl.h Date: Sun, 13 Feb 2022 22:45:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: juanjo at juanjoalvarez dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2022 22:45:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104523 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 u= sing C++20 modules. Steps to reproduce: 1. Install PyBind11 header files (it's a header only lib). If you have Pyth= on 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=3Dc++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 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 for instructions.=