Do not allocate MemoryPoolManager from a memory pool
Our implementations of memory pools have a hidden dependency on _the_ global memory pool manager: typically GPOS_NEW and GPOS_DELETE will reach for the memory pool manager singleton. This makes GPOS_DELETE on a memory pool manager undefined behavior because we call member functions on an object after its destructor finishes. On the Postgres 12 merge branch, this manifests itself in a crash during initdb. More concerning is that it only crashed when we set max connections and shared buffers to a specific number.
Showing
想要评论请 注册 或 登录