From: Nikhil S. <ni...@st...> - 2013-03-07 12:34:43
|
Hi, PFA, patch which fixes an obnoxious crash in GTM Standby. This one was a tough nut to crack down. The crash is as below Program terminated with signal 11, Segmentation fault. #0 0x00000000004253c9 in gtm_lappend () Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6_3.6.x86_64 libgcc-4.4.6-4.el6.x86_64 (gdb) bt #0 0x00000000004253c9 in gtm_lappend () #1 0x000000000040ad77 in GTM_BkupBeginTransactionGetGXIDMulti.clone.0 () #2 0x000000000040aedb in ProcessBkupBeginTransactionGetGXIDCommand () #3 0x000000000040417c in GTM_ThreadMain () IMHO, using TopMemoryContext to mean the top context of each thread is pretty confusing. Bad choice of name for the memory context according to me. Maybe we could have avoided this crash if we had used a different name for the context. This "TopMemoryContext" goes away when that thread goes away. So ain't nothing TOP about it. The GTMTransactions.gt_open_transactions list was being appended to using this memory context. So later if another thread came in (and the earlier appending thread had been cleaned up), it will find garbage in this list and this was causing the crash. I always saw a couple of threads being cleaned up in the gtm standby logs just prior to the crash. The fix is to use TopMostMemoryContext. If it were to me I would re-haul this TopMemoryContext naming business in GTM. Am sure people will get confused in the future too when they write code.. Regards, Nikhils -- StormDB - http://www.stormdb.com The Database Cloud Postgres-XC Support and Service |