Reset CurrentMemoryContext to TopMemoryContext at the beginning of error cleanup, ie, as soon as we have caught the longjmp.  This ensures that current context will be a valid context throughout error cleanup.  Before it was possible that current context was pointing at a context that would get deleted during cleanup, leaving any subsequent pallocs in deep trouble.  I was able to provoke an Assert failure when compiled with asserts + -DCLOBBER_FREED_MEMORY, if I did something that would cause an error to be reported by the backend large-object code, because indeed that code operates in a context that gets deleted partway through xact abort --- and CurrentMemoryContext was still pointing at it!  Boo hiss.
Reset CurrentMemoryContext to TopMemoryContext at the beginning of error
cleanup, ie, as soon as we have caught the longjmp.  This ensures that
current context will be a valid context throughout error cleanup.  Before
it was possible that current context was pointing at a context that would
get deleted during cleanup, leaving any subsequent pallocs in deep
trouble.  I was able to provoke an Assert failure when compiled with
asserts + -DCLOBBER_FREED_MEMORY, if I did something that would cause
an error to be reported by the backend large-object code, because indeed
that code operates in a context that gets deleted partway through xact
abort --- and CurrentMemoryContext was still pointing at it!  Boo hiss.

randomtask1155/gpdb,adam8157/gpdb,royc1/gpdb,rvs/gpdb,techdragon/Postgres-XL,zaksoup/gpdb,tpostgres-projects/tPostgres,royc1/gpdb,yazun/postgres-xl,snaga/postgres-xl,lintzc/gpdb,xuegang/gpdb,ashwinstar/gpdb,xinzweb/gpdb,randomtask1155/gpdb,lisakowen/gpdb,xuegang/gpdb,yuanzhao/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,xinzweb/gpdb,janebeckman/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,chrishajas/gpdb,xuegang/gpdb,lintzc/gpdb,Quikling/gpdb,foyzur/gpdb,xinzweb/gpdb,ashwinstar/gpdb,lintzc/gpdb,chrishajas/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,0x0FFF/gpdb,ahachete/gpdb,randomtask1155/gpdb,janebeckman/gpdb,CraigHarris/gpdb,lintzc/gpdb,50wu/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,rubikloud/gpdb,lisakowen/gpdb,rvs/gpdb,techdragon/Postgres-XL,tpostgres-projects/tPostgres,snaga/postgres-xl,oberstet/postgres-xl,royc1/gpdb,lintzc/gpdb,greenplum-db/gpdb,atris/gpdb,xinzweb/gpdb,adam8157/gpdb,janebeckman/gpdb,janebeckman/gpdb,Chibin/gpdb,tangp3/gpdb,Quikling/gpdb,rvs/gpdb,yazun/postgres-xl,rvs/gpdb,Chibin/gpdb,50wu/gpdb,rvs/gpdb,Chibin/gpdb,kmjungersen/PostgresXL,rvs/gpdb,xuegang/gpdb,CraigHarris/gpdb,rubikloud/gpdb,pavanvd/postgres-xl,randomtask1155/gpdb,cjcjameson/gpdb,rubikloud/gpdb,royc1/gpdb,CraigHarris/gpdb,zaksoup/gpdb,ahachete/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,chrishajas/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,xinzweb/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,tangp3/gpdb,lintzc/gpdb,tpostgres-projects/tPostgres,atris/gpdb,lpetrov-pivotal/gpdb,arcivanov/postgres-xl,cjcjameson/gpdb,Quikling/gpdb,Postgres-XL/Postgres-XL,lintzc/gpdb,ahachete/gpdb,lpetrov-pivotal/gpdb,techdragon/Postgres-XL,lisakowen/gpdb,ahachete/gpdb,atris/gpdb,royc1/gpdb,janebeckman/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,edespino/gpdb,postmind-net/postgres-xl,xuegang/gpdb,greenplum-db/gpdb,Chibin/gpdb,edespino/gpdb,foyzur/gpdb,kaknikhil/gpdb,lintzc/gpdb,chrishajas/gpdb,edespino/gpdb,pavanvd/postgres-xl,greenplum-db/gpdb,rvs/gpdb,zaksoup/gpdb,ahachete/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,Quikling/gpdb,rubikloud/gpdb,janebeckman/gpdb,chrishajas/gpdb,techdragon/Postgres-XL,kaknikhil/gpdb,ashwinstar/gpdb,ovr/postgres-xl,kaknikhil/gpdb,edespino/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,tpostgres-projects/tPostgres,jmcatamney/gpdb,Chibin/gpdb,lisakowen/gpdb,zaksoup/gpdb,xuegang/gpdb,Quikling/gpdb,atris/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,50wu/gpdb,jmcatamney/gpdb,tangp3/gpdb,edespino/gpdb,arcivanov/postgres-xl,Postgres-XL/Postgres-XL,foyzur/gpdb,tpostgres-projects/tPostgres,chrishajas/gpdb,rubikloud/gpdb,kmjungersen/PostgresXL,ashwinstar/gpdb,Chibin/gpdb,0x0FFF/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,rubikloud/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,rubikloud/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,adam8157/gpdb,yazun/postgres-xl,yazun/postgres-xl,zeroae/postgres-xl,foyzur/gpdb,foyzur/gpdb,ovr/postgres-xl,tangp3/gpdb,lisakowen/gpdb,lisakowen/gpdb,zeroae/postgres-xl,royc1/gpdb,lpetrov-pivotal/gpdb,ahachete/gpdb,cjcjameson/gpdb,edespino/gpdb,50wu/gpdb,Chibin/gpdb,postmind-net/postgres-xl,yazun/postgres-xl,yuanzhao/gpdb,rvs/gpdb,kaknikhil/gpdb,atris/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,randomtask1155/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,postmind-net/postgres-xl,lintzc/gpdb,ahachete/gpdb,kmjungersen/PostgresXL,lpetrov-pivotal/gpdb,jmcatamney/gpdb,xuegang/gpdb,postmind-net/postgres-xl,rvs/gpdb,50wu/gpdb,adam8157/gpdb,foyzur/gpdb,Quikling/gpdb,ovr/postgres-xl,50wu/gpdb,Quikling/gpdb,rvs/gpdb,tangp3/gpdb,tangp3/gpdb,kaknikhil/gpdb,tangp3/gpdb,foyzur/gpdb,kaknikhil/gpdb,snaga/postgres-xl,greenplum-db/gpdb,lpetrov-pivotal/gpdb,zaksoup/gpdb,lpetrov-pivotal/gpdb,yuanzhao/gpdb,CraigHarris/gpdb,chrishajas/gpdb,atris/gpdb,Quikling/gpdb,cjcjameson/gpdb,oberstet/postgres-xl,tangp3/gpdb,chrishajas/gpdb,Chibin/gpdb,kaknikhil/gpdb,edespino/gpdb,zaksoup/gpdb,janebeckman/gpdb,zeroae/postgres-xl,yuanzhao/gpdb,greenplum-db/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,lpetrov-pivotal/gpdb,adam8157/gpdb,edespino/gpdb,atris/gpdb,adam8157/gpdb,0x0FFF/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,jmcatamney/gpdb,kaknikhil/gpdb,xuegang/gpdb,snaga/postgres-xl,zaksoup/gpdb,Quikling/gpdb,lisakowen/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,zeroae/postgres-xl,50wu/gpdb,edespino/gpdb,ashwinstar/gpdb,royc1/gpdb,randomtask1155/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,oberstet/postgres-xl,xuegang/gpdb,Chibin/gpdb,0x0FFF/gpdb,rubikloud/gpdb,ovr/postgres-xl,adam8157/gpdb,yuanzhao/gpdb,pavanvd/postgres-xl,ovr/postgres-xl,janebeckman/gpdb,ashwinstar/gpdb,xinzweb/gpdb,zaksoup/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,0x0FFF/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,oberstet/postgres-xl,yuanzhao/gpdb,0x0FFF/gpdb,royc1/gpdb,adam8157/gpdb,zeroae/postgres-xl,foyzur/gpdb,ahachete/gpdb,edespino/gpdb,snaga/postgres-xl,0x0FFF/gpdb,Chibin/gpdb,yuanzhao/gpdb,50wu/gpdb,Quikling/gpdb,randomtask1155/gpdb,arcivanov/postgres-xl,oberstet/postgres-xl,arcivanov/postgres-xl