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 1kDWx4-0007Nf-Lu for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 17:53:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDWx1-0008Cn-47 for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Sep 2020 17:53:39 +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 ) id 1kDWx0-0008Cf-OX for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 17:53:38 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDWwt-0006Ea-J2 for pgsql-bugs@lists.postgresql.org; Wed, 02 Sep 2020 17:53:37 +0000 Received: by mail-qt1-x842.google.com with SMTP id b3so4237998qtg.13 for ; Wed, 02 Sep 2020 10:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=I69gKxQqTG8qOv5umKSIYJSgN/RT0b71yw73Ck+ieuo=; b=XaUnUtzBbOV03gWXuwrTTJv6fgzPPIFTkNRjEQR8pwIamX6ey8H86yNMxfRNh2MO77 f4lwhN5tjbewEAsm2yreeYiXBgXGfUPVwB6nftsdK28c1SASdLHiucFvcsc9o49ndSL0 9Jz6rElL0YqescTg560t3R4OUuYqwPDLo1qv606Pb2Ygb8dCEdaDEHRZKYD5HC+RvQ5q DjAzO5LbAZ0Upa8Ng32egNTbQZmsp93GdB3Nr4J46K5wto+CoXaP9iX67rkYJJKavH1r wG3lrWMyVTec+jzwOU2hIx3qNDjo7DmtB8g8aTpn44Fvbkb6K7TL70poo2Bl+XumVYu4 aUQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=I69gKxQqTG8qOv5umKSIYJSgN/RT0b71yw73Ck+ieuo=; b=mdyWIs5mlRvPS3TkaMeeEPicJ7tXmnLuh39UVSiHK93bhHnbZixqcsZCzTMHtbGizJ H/3OPLzZ6zWCSyTCAIEehSuuwEMGQOp7453sVIO/QzJt8kwZi+gqiOMkZ/Bdyio96Kcx Wl2g/FyuEb5X9Ga5Adm1pOmBk8YWz+ALrMGGd/FZuTnnBkATp78Xnjv4dfvWNt8PJAnv B1tgMUmBWlMjAJDTL2UBrvRGwUPbXYI4XEt0cm/Rx+KwryR7z8Z/PGJm4KaWPb/mTt3N NzNr5DtdJS0ywGODv9QmgnW3z/1isSzWBR34TDJf29WID96Wop4Yi1P3VySLPSsvK2rk SMow== X-Gm-Message-State: AOAM532Vl+jr4Mr1fdQA3UuGoSEeRW7g0FA2EImUkDuQDmSNt7Qfxw3G z1qsd2c8L/KorH2FaV2mZVHtmTfaI4hoig== X-Google-Smtp-Source: ABdhPJzS4cVE5tgVbGIT8euV+MKBNcfWAVCZ7pGAZFtLLbJe7g/PI3P9p1hxuc9SYBLuFMbFD2skcQ== X-Received: by 2002:ac8:2495:: with SMTP id s21mr3292350qts.194.1599069210636; Wed, 02 Sep 2020 10:53:30 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id 201sm244531qkf.103.2020.09.02.10.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 10:53:30 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 180E72A1565; Wed, 2 Sep 2020 13:53:28 -0400 (-04) Date: Wed, 2 Sep 2020 13:53:28 -0400 From: Alvaro Herrera To: Jehan-Guillaume de Rorthais Cc: pgsql-bugs@lists.postgresql.org Subject: Re: [BUG v13] Crash with event trigger in extension Message-ID: <20200902175328.GA21242@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200902193715.6e0269d4@firost> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Sep-02, Jehan-Guillaume de Rorthais wrote: > Hi, > > Philippe Beaudoin reported to me a crash he was able to reproduce with some > extension update script. Please, find in attachment a script that triggers it. > Just edit the three first vars to point to a temporary installation and > instance. > > Some git bisect shows the bug was introduced by b5810de3f4, where > multi-statement query strings are using different short memory contexts. Good find. I think we should turn your case into a proper TAP test so that we can incorporate it, for coverage -- the lines you patch do appear covered, but obviously not in these specific conditions. I'm just not very sure *where* to add it; maybe src/test/modules/test_extensions is the place to have it, though that one doesn't have TAP tests currently. An easy addition, though. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services