Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoVQS-00033g-JN for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Feb 2018 14:31:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoVQR-00071f-Cc for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Feb 2018 14:31:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eoVQQ-00071U-EN for pgsql-bugs@lists.postgresql.org; Wed, 21 Feb 2018 14:31:15 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eoVQL-0004V7-EU for pgsql-bugs@postgresql.org; Wed, 21 Feb 2018 14:31:13 +0000 Received: by mail-wr0-x243.google.com with SMTP id m5so5076427wrg.1 for ; Wed, 21 Feb 2018 06:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=yBJaK4CULt0+LAJIPVE6UH33qYLjxDIC835G7/RLirQ=; b=dLLcziUUo/drdmfE2nb0CtA560iFvt2DDFB5GsFXiC2v3gG8Sf7R0v2qGNqk1TcO9Y uZkZbgHrrsVEiAJNCt6xznR21lYVxIjCHrU9cPkuWRuid3Dqf9gA81n3jneJ+sbhcuvC qveC9Mufi6ZgrRf0ibp27u+pxvrdgzfb3fB5ilg+GbbNC42VSPW7nN+CbYpida9wwfKL KusI0Lph3WKjUCVtNBhiSBriQxloSSgkCFOZbiPYFOJsv+4o/v0T4B1IctSAUtvQhhhU wid5OG0/z+CqPxf/nSzRN/bJeE7BjGHcouUNGvh+ox0Qh5GlpXglwMvL8U0lGtn/MDZ5 koLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yBJaK4CULt0+LAJIPVE6UH33qYLjxDIC835G7/RLirQ=; b=ozZyk4psBAHfk76c76Vetpezrl5bPTos4GHmBSomK1UbaV/EIUM9d4lUsYCJzUGibR 73lXP+JCfijauOZmAI7+d6EU3q8cPp6t/NhPQoDO05Hv+uMUI/cTojD/j6hgsJdn3ATr P5Axx12aUQD40e3BRyhvcJzKsY2OjfyW/Dsf6d2MiDvDOkdOwWnhfXL3Pcg8PoJ6ekLR ykajn5iU57SuIiRLevXuvR54X6pUD6Sz9xMVKpxDgOH6RoIn1Q6ooKDef8I8koaYjIVs qz2JpoUR1YU6zgwFqPXWdYy1IOBJfIfs3XiJhm6QM+oa3J7GQDHW0l2bzCwn2xKDa8Sf 6hCQ== X-Gm-Message-State: APf1xPB/75Odz2W7b+24dJkI9uRUOBQ60I50yM83Lb/IdL5CV3tw6ncU ZjEoHB37ZoZJezDSImJa0QdqtKj3yNAq5vV76PCnqfiHTsMWl57AFvUZj+rUNOiU1cZIThwjWdU wanulWPes5KpQZ7thIPmqImEJCziljRwPpai1bMcJjNdXwUhw3hVZcoDJppEWnZDUqXLyTfTzye 35bu5a X-Google-Smtp-Source: AH8x226y3QiCSVpNE/t4imgPu+f1n6iFQNuEwEXtEJKC0htmKWwbBptVynJhXnu5F8K8W99qq3Rbpg== X-Received: by 10.223.172.167 with SMTP id o36mr3467852wrc.34.1519223467986; Wed, 21 Feb 2018 06:31:07 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id c12sm6727398wmh.2.2018.02.21.06.31.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 06:31:07 -0800 (PST) Subject: Re: Segmentation Fault in logical decoding get/peek API To: Sudalai , pgsql-bugs@postgresql.org References: <1519042814659-0.post@n3.nabble.com> <20180220175530.6ib4b3ngzkipekgs@alap3.anarazel.de> <1519197538224-0.post@n3.nabble.com> From: Tomas Vondra Message-ID: <9fe0a6de-d204-9067-4eba-dd686077dd89@2ndquadrant.com> Date: Wed, 21 Feb 2018 15:31:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1519197538224-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 02/21/2018 08:18 AM, Sudalai wrote: > > >>> And if it's segfaulting, it has to mean specinsert is NULL. So either we >>> never got REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT, or we threw it >>> away in the "change_done" part. Seems strange in both cases. > > Yes, specinsert is NULL. > >>> Sudalai, are you using speculative inserts in the transaction? > Yes . We have done ON CONFLICT DO NOTHING . > > > Is it correct to add below check , > if(specinsert == NULL ){ > goto change_done; > } > before , Assert(specinsert->data.tp.oldtuple == NULL); to fix segfault ? > That seems unlikely to fix the root cause - more likely it's going to mask it in some strange way. We need to understand why it does happen (i.e. specinsert is not expected to be NULL here). It would really help if you could provide a self-contained test case demonstrating the issue, as mentioned by Andres. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services