This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/64535] Emergency buffer for exception allocation too small


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

--- Comment #21 from Richard Biener <rguenth at gcc dot gnu.org> ---
We can make it extra-safe but still deallocate in most common cases:

  pool::~pool ()
    {
      __gnu_cxx::__scoped_lock sentry(emergency_mutex);
      if (arena
          && arena == reinterpret_cast <char *> (first_free_entry)
          && arena_size == first_free_entry->size)
        {
          free (arena);
          arena = NULL;
          first_free_entry = NULL;
        }
    }

this ensures threads won't continue allocating from the pool.  Well,
they may in case some other thread frees some exception...  So indeed
running a destructor makes the whole stuff undefined (object lifetime
of the pool ended) :/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]