hstore bug and repair method - Mailing list pgsql-hackers
From | maosen.zhang |
---|---|
Subject | hstore bug and repair method |
Date | |
Msg-id | 013401c9b347$83a2bc20$1f12fea9@yahoo.ali.com Whole thread Raw |
Responses |
Re: hstore bug and repair method
|
List | pgsql-hackers |
<div class="Section1" style="layout-grid:15.6pt"><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">Hi all:</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">I’ve found a bug about hstore, example below:</span></font><p class="MsoNormal"><font face="Arial"size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">CREATE TABLE temp_table (</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial"> dcp smallint,</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial"> atext hstore</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial">);</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">COPY temp_table (dcp, atext) FROM stdin;</span></font><p class="MsoNormal"><font face="Arial" size="1"><spanlang="EN-US" style="font-size: 9.0pt;font-family:Arial">800 ""=>NULL</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial">\.</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">Then do the sql twice below :</span></font><p class="MsoNormal"><font face="Arial" size="1"><spanlang="EN-US" style="font-size: 9.0pt;font-family:Arial">Select * from temp_table;</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">Pg(version 8.3 and above) will coredump, backtrace below:</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">Program received signal SIGABRT, Aborted.</span></font><p class="MsoNormal"><font face="Arial" size="1"><spanlang="EN-US" style="font-size: 9.0pt;font-family:Arial">0x0000002a95a5821d in raise () from /lib64/tls/libc.so.6</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">(gdb) bt</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#0 0x0000002a95a5821d in raise () from /lib64/tls/libc.so.6</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#1 0x0000002a95a59a1e in abort () from /lib64/tls/libc.so.6</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#2 0x0000000000724b50 in ExceptionalCondition (conditionName=Could not find the frame base for"ExceptionalCondition".</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">) at assert.c:57</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial">#3 0x0000000000747c6f in pfree (pointer=0xb11290) at mcxt.c:591</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#4 0x000000000044a500 in printtup (slot=0xb101d8, self=0xb1bac0) at printtup.c:344</span></font><pclass="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#5 0x0000000000572de9 in ExecSelect (slot=0xb101d8, dest=0xb1bac0, estate=0xb10058) at execMain.c:1554</span></font><pclass="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#6 0x0000000000572c70 in ExecutePlan (estate=0xb10058, planstate=0xb10388, operation=CMD_SELECT,numberTuples=0, </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial"> direction=ForwardScanDirection, dest=0xb1bac0) at execMain.c:1480</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#7 0x0000000000570ebe in ExecutorRun (queryDesc=0xb1d910, direction=ForwardScanDirection, count=0)at execMain.c:270</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#8 0x000000000064b6ad in PortalRunSelect (portal=0xb06fd8, forward=1 '\001', count=0, dest=0xb1bac0)at pquery.c:943</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#9 0x000000000064b34d in PortalRun (portal=0xb06fd8, count=9223372036854775807, isTopLevel=1 '\001',dest=0xb1bac0, </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial"> altdest=0xb1bac0, completionTag=0x7fbfffee60 "") at pquery.c:769</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#10 0x0000000000645a0d in exec_simple_query (query_string=0xac5c88 "select * from temp_table ;")at postgres.c:1004</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#11 0x00000000006497a0 in PostgresMain (argc=4, argv=0xa45948, username=0xa45920 "cherokee") atpostgres.c:3631</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#12 0x000000000060ba2e in BackendRun (port=0xa468f0) at postmaster.c:3207</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#13 0x000000000060afbd in BackendStartup (port=0xa468f0) at postmaster.c:2830</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#14 0x0000000000608b7c in ServerLoop () at postmaster.c:1274</span></font><p class="MsoNormal"><fontface="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#15 0x000000000060855d in PostmasterMain (argc=3, argv=0xa25c30) at postmaster.c:1029</span></font><pclass="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">#16 0x00000000005a1dcb in main (argc=3, argv=0xa25c30) at main.c:188</span></font><p class="MsoSalutation"><fontface="宋体" size="1"><span lang="EN-US" style="font-size: 9.0pt"> </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">The repair method is :</span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="1"><span lang="EN-US" style="font-size: 9.0pt;font-family:Arial">Hstore_io.c:</span></font><p class="MsoSalutation"><font face="Arial" size="1"><span lang="EN-US"style="font-size:9.0pt;font-family:Arial"> 440 buflen = (4 /* " */ + 2 /* => */ + 2 /* , */ ) * in->size+</span></font><p class="MsoSalutation"><font face="Arial" size="1"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial"> 441 2 /* esc */ * (VARSIZE(in) - CALCDATASIZE(in->size, 0));</span></font><pclass="MsoSalutation"><font face="Arial" size="1"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial"> 442 </span></font><p class="MsoSalutation" style="text-indent:18.0pt"><fontface="宋体" size="3"><span lang="EN-US" style="font-size:12.0pt">443 -- out = ptr = palloc(buflen);</span></font><fontface="Arial" size="1"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial"></span></font><pclass="MsoNormal"><font face="Arial" size="1"><span lang="EN-US"style="font-size: 9.0pt;font-family:Arial"> ++ out = ptr = palloc(buflen+1);</span></font><p class="MsoSalutation"style="text-indent:18.0pt"><font face="Arial" size="1"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial"> </span></font><pclass="MsoSalutation" style="text-indent:18.0pt"><font face="Arial"size="1"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial"> </span></font><p class="MsoSalutation"style="text-indent:18.0pt"><font face="宋体" size="1"><span style="font-size:9.0pt">此致<span lang="EN-US"></span></span></font><pclass="MsoClosing" style="margin-left:220.5pt"><font face="宋体" size="1"><span style="font-size:9.0pt">敬礼<spanlang="EN-US"></span></span></font><p class="MsoNormal"><font face="宋体" size="1"><span style="font-size:9.0pt; font-family:宋体">茂森</span></font><font size="1"><span lang="EN-US" style="font-size: 9.0pt"></span></font><p class="MsoNormal"><font face="Times New Roman" size="1"><span lang="EN-US" style="font-size:9.0pt"> </span></font><pclass="MsoNormal"><font face="Times New Roman" size="1"><span lang="EN-US" style="font-size:9.0pt"><imgheight="23" id="_x0000_i1025" src="cid:image001.gif@01C9B38A.90784670" width="122" /></span></font><fontsize="1"><span lang="EN-US" style="font-size:9.0pt"></span></font><p class="MsoNormal"><font face="TimesNew Roman" size="2"><span lang="EN-US"> </span></font></div>
pgsql-hackers by date: