https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126004
Henri Menke <henri at henrimenke dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |henri at henrimenke dot de
--- Comment #1 from Henri Menke <henri at henrimenke dot de> ---
Created attachment 65146
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65146&action=edit
c++: fix use-after-free of "declare variant" context selector
This bug is fairly hard to reproduce. In fact, I encountered what I believe to
be the same issue in a complex multi-project setup. Building GCC with
--enable-checking=yes,extra gave me the following error message.
tree check: expected tree_list, have ggc_freed in
omp_get_context_selector_list, at omp-general.cc:2691
So a tree_list is garbage-collected while still being in use, leading to a
use-after-free issue.
Full disclosure: The attached patch was authored by an LLM and can therefore
not be incorporated as-is into GCC. Nevertheless, I hope that this will lead a
maintainer on the right track to quickly assess and fix the issue.