Skip to content
Snippets Groups Projects
  • Robert Haas's avatar
    41fb35fa
    Fix possible crash due to incorrect allocation context. · 41fb35fa
    Robert Haas authored
    Commit af330393 aimed to reduce
    leakage from tqueue.c, which is good.  Unfortunately, by changing the
    memory context in which all of gather_readnext() executes, it also
    changed the context in which ExecShutdownGatherWorkers executes, which
    is not good, because that function eventually causes a call to
    ExecParallelRetrieveInstrumentation, which proceeds to allocate
    planstate->worker_instrument in a short-lived context, causing a
    crash.
    
    Rushabh Lathia, reviewed by Amit Kapila and by me.
    41fb35fa
    History
    Fix possible crash due to incorrect allocation context.
    Robert Haas authored
    Commit af330393 aimed to reduce
    leakage from tqueue.c, which is good.  Unfortunately, by changing the
    memory context in which all of gather_readnext() executes, it also
    changed the context in which ExecShutdownGatherWorkers executes, which
    is not good, because that function eventually causes a call to
    ExecParallelRetrieveInstrumentation, which proceeds to allocate
    planstate->worker_instrument in a short-lived context, causing a
    crash.
    
    Rushabh Lathia, reviewed by Amit Kapila and by me.