Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgTHb-0000nt-VA for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 14:55:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mgTHa-0004ri-Sr for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Oct 2021 14:55:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1mgTHa-0004rY-J6 for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 14:55:02 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1mgTHW-0003xR-F2 for pgsql-bugs@lists.postgresql.org; Fri, 29 Oct 2021 14:55:01 +0000 Received: by mail-wr1-x429.google.com with SMTP id i5so8882223wrb.2 for ; Fri, 29 Oct 2021 07:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=daNB5+cs+KsqBT/kT7Cf+5WI9UIiX6s7culnuUOhgnA=; b=gQ5ozJt9ZIusCAN6nZjUc1+XRdg+V9vO1iYSk5WhUqhBgJMa0x0qSX5mipgB0f9ja/ SpabnUE8eeU376ERBXoTVNub/xgTMmjpSkhsnXZPuhhnw7KO6E+B1Al/I1UlwiG8mpa5 yC1qBQ/Yd2NffTGpR+JiARbwEBmF89Mknqiu6Z1iSYHX7grSlCRPUeHbifvXDQ0fiAEF 3oX9aPNCEvz5OmPU+lvVLRqUBA3wKJ43ICzEpKe6OdDKpPdvtlZgM2bOMQxXJ9kk+9i6 hhXBAVQKyI+lYTlYhhwzpteVaUBN8X6YLMeDk/R4XUjoZyVU+pMln30C5vAWMCmUQf1H QWpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=daNB5+cs+KsqBT/kT7Cf+5WI9UIiX6s7culnuUOhgnA=; b=6ziwf2qDx+hEbGwjfly3Xr/I+/wnJy50evWRUwHmfeBWf1eGJPR9mjchREOgqrpRl3 V1BIYS4pi1JV/KvTErQzPq5I06HjITkyVqCbL1799gQmSf4EXwGKNa6LSv0aHfmj1MNI vhPHcV7kwIruGZ7dw3/k2mOAlpHKM1v8IGu8dyRCFmfDTvKHdcJuH9jTLpVI3QkXhnc2 ZXw8cuinmZCH/apS36vnMbYsa/CB/8pUwka0imeI2insieepOnYAnxd4jtDsWTQKsSUC ETO9/Au0DbaGUaNkstSIi0zayD+Vp385wHWYqL/IK2WYhJL7bWORh+hb5EBEbrpa8J/U WPDA== X-Gm-Message-State: AOAM532mVXjvvEoPjGe3yx9GlpUuTYpu7LOXCVTtOztvsYo3U/MCsiIl 3gBusF3i2y/yv6QO8gAUeJk= X-Google-Smtp-Source: ABdhPJxTMK7VBnqaIGM5NeFCjpUEkKp+Q+XSqcCoslwQ9iViBXZ+DYqQnnVsk+wmieSoKgpKfkVkNQ== X-Received: by 2002:a5d:4443:: with SMTP id x3mr6426564wrr.189.1635519297085; Fri, 29 Oct 2021 07:54:57 -0700 (PDT) Received: from localhost (dslb-094-222-009-006.094.222.pools.vodafone-ip.de. [94.222.9.6]) by smtp.gmail.com with ESMTPSA id l22sm1736221wmp.34.2021.10.29.07.54.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Oct 2021 07:54:56 -0700 (PDT) Date: Fri, 29 Oct 2021 16:55:32 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum Message-ID: <20211029145532.kfwqwlrdekunwoa2@localhost> References: <17255-14c0ac58d0f9b583@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17255-14c0ac58d0f9b583@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Fri, Oct 29, 2021 at 07:00:01AM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 17255 > Logged by: Alexander Lakhin > Email address: exclusion@gmail.com > PostgreSQL version: 14.0 > Operating system: Ubuntu 20.04 > Description: > > with the following stack: > Core was generated by `postgres: law regression [local] CREATE INDEX > '. > Program terminated with signal SIGABRT, Aborted. > #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 > 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. > (gdb) bt > #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 > #1 0x00007f8a7f97a859 in __GI_abort () at abort.c:79 > #2 0x0000562dabb49700 in index_delete_sort_cmp (deltid2= pointer>, deltid1=) at heapam.c:7582 > #3 index_delete_sort (delstate=0x7fff6f609f10, delstate=0x7fff6f609f10) at > heapam.c:7623 > #4 heap_index_delete_tuples (rel=0x7f8a76523e08, delstate=0x7fff6f609f10) > at heapam.c:7296 > #5 0x0000562dabc5519a in table_index_delete_tuples > (delstate=0x7fff6f609f10, rel=0x562dac23d6c2) > at ../../../../src/include/access/tableam.h:1327 > #6 _bt_delitems_delete_check (rel=rel@entry=0x7f8a7652cc80, > buf=buf@entry=191, heapRel=heapRel@entry=0x7f8a76523e08, > delstate=delstate@entry=0x7fff6f609f10) at nbtpage.c:1541 > #7 0x0000562dabc4dbe1 in _bt_simpledel_pass (maxoff=, > minoff=, newitem=, > ndeletable=55, deletable=0x7fff6f609f30, heapRel=0x7f8a76523e08, > buffer=191, rel=0x7f8a7652cc80) > at nbtinsert.c:2899 > ... > > Discovered while hunting to another bug related to autovacuum (unfortunately > I still can't produce the reliable reproducing script for that). Thanks for reporting (in fact I'm impressed how many issues you've discovered, hopefully there are at least some t-shirts "I've found X bugs in PostgreSQL" available as a reward) and putting efforts into the reproducing steps. I believe I've managed to reproduce at least a similar crash with the same trace. In my case it crashed on pg_unreachable (which is an abort, when asserts are enabled) inside index_delete_sort_cmp. It seems like item pointers to compare both have the same block and offset number. In the view of the recent discussions I was thinking it could be somehow related to the issues with duplicated TIDs, but delstate->deltids doesn't in fact have any duplicated entries -- so not sure about that, still investigating the core dump.