Re: [HACKERS] Parallel Bitmap scans a bit broken - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: [HACKERS] Parallel Bitmap scans a bit broken
Date
Msg-id CAFiTN-tVgRBkWkcMmEMOeJ9cSy36dYeVCbjtQEn37E8eTKZQvQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Parallel Bitmap scans a bit broken  (Emre Hasegeli <emre@hasegeli.com>)
Responses Re: [HACKERS] Parallel Bitmap scans a bit broken  (Emre Hasegeli <emre@hasegeli.com>)
List pgsql-hackers
On Wed, Mar 15, 2017 at 8:11 PM, Emre Hasegeli <emre@hasegeli.com> wrote:
>> * thread #1: tid = 0x5045a8f, 0x000000010ae44558 postgres`brin_deform_tuple(brdesc=0x00007fea3c86a3a8,
tuple=0x00007fea3c891040)+ 40 at brin_tuple.c:414, queue = 'com.apple.main-thread', stop reason = signal SIGUSR1
 
>>  * frame #0: 0x000000010ae44558 postgres`brin_deform_tuple(brdesc=0x00007fea3c86a3a8, tuple=0x00007fea3c891040) + 40
atbrin_tuple.c:414 [opt]
 
>>    frame #1: 0x000000010ae4000c postgres`bringetbitmap(scan=0x00007fea3c875c20, tbm=<unavailable>) + 428 at
brin.c:398[opt]
 
>>    frame #2: 0x000000010ae9b451 postgres`index_getbitmap(scan=0x00007fea3c875c20, bitmap=<unavailable>) + 65 at
indexam.c:726[opt]
 
>>    frame #3: 0x000000010b0035a9 postgres`MultiExecBitmapIndexScan(node=<unavailable>) + 233 at
nodeBitmapIndexscan.c:91[opt]
 
>>    frame #4: 0x000000010b002840 postgres`BitmapHeapNext(node=<unavailable>) + 400 at nodeBitmapHeapscan.c:143 [opt]

Further analyzing the call stack, seems like this is not exact call
stack where it crashed.  Because, if you notice the code in the
brin_deform_tuple (line 414)

brin_deform_tuple(BrinDesc *brdesc, BrinTuple *tuple)

{     dtup = brin_new_memtuple(brdesc);
    if (BrinTupleIsPlaceholder(tuple))        dtup->bt_placeholder = true;    dtup->bt_blkno = tuple->bt_blkno;  -->
line414
 

This can crash at line:414, if either tuple is invalid memory(but I
think it's not because we have already accessed this memory in above
if check) or dtup is invalid (this is also not possible because
brin_new_memtuple has already accessed this).

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] [PATCH] Suppress Clang 3.9 warnings
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] [POC] hash partitioning