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 1mx9zH-0000iY-Om for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Dec 2021 15:45:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mx9zG-0001l3-IC for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Dec 2021 15:45:06 +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 1mx9zG-0001iE-8D for pgsql-bugs@lists.postgresql.org; Tue, 14 Dec 2021 15:45:06 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1mx9zB-00089z-Pk for pgsql-bugs@lists.postgresql.org; Tue, 14 Dec 2021 15:45:03 +0000 Received: by mail-ed1-x52f.google.com with SMTP id y12so63574560eda.12 for ; Tue, 14 Dec 2021 07:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KWtiZwn5R4Ytor3byLzDx9qNWgW7A1/auwNWNYimHQU=; b=FBCBcYsB4hm1WR1iqBe25p+iYch4koBeV27fgaIKjyWWt6ZXJw4evtnIvA7tG7A7Li inibyG2PacxEMeeM61RREjzFuep2jnl1o+/3v4BIeNe7qFOLVBeOpl1uwkS5EGYV+NHq pZxPT2ujKFOwouL0CcKd+Ofx8NCg0X+zeCp/1F2PBUCPL0putXCZFI0q90pd4pTQoFi6 OzZxbv7uk5roSiwJdu7VxTADxVPv4HuCKUiFnHy1VE4793+1QnPS6GE6zwiHz4C9MxOR VkODdkiklegSMzbBlG7PPrJO/aC4tyx5BMJ++A6fGccSuLeaXo8SSKLx6d+TGFQpI2Sg LBhg== 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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KWtiZwn5R4Ytor3byLzDx9qNWgW7A1/auwNWNYimHQU=; b=bXa8FEGumoTSOteoUOqiNipKFynstwBQzUfFMYS8vxEpd+/HtaZOsycBprYdJLH0da AjS1nMZVhxwW/60hLkLLgn71xW3/prXPaOjCCi+yafI9MiiSz5PJUVUYb165aR/WtCUW 4OB7ZcXdhqeMxsrmQnI6tkmH7ERyHQI/n/llgnjU6Q9KCLE5imQkrtIjj9bnk90+Mqv9 1edPSNhrxTj6bO/qRFC15dn/sXfri7vSD9cgaRPz+XIdAXjXCr8tObv2oSkkjPlBU1S3 znaHLzWmtP89XoxxJNNSCgin6L/qVBAckBygKX9vrtc0YD7BYBd9NsAteg40isdrKsYO snYg== X-Gm-Message-State: AOAM5307WcPevfrbmhDtXGifQSQvg6sghYZIbvL0OpxtPF1c4klxz9yI WuGZjM/3mhtmkW2Tb4uVgr8= X-Google-Smtp-Source: ABdhPJzH2yDWiSIbDaeM7uvY1nkXVo45LbdDpI1uNS+CrVROx2oZ9AD4VU/oWXKnbco6Prp0GL3RNg== X-Received: by 2002:a17:906:2192:: with SMTP id 18mr903664eju.635.1639496699828; Tue, 14 Dec 2021 07:44:59 -0800 (PST) Received: from localhost (dslb-178-012-041-031.178.012.pools.vodafone-ip.de. [178.12.41.31]) by smtp.gmail.com with ESMTPSA id d3sm30853edx.79.2021.12.14.07.44.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Dec 2021 07:44:59 -0800 (PST) Date: Tue, 14 Dec 2021 16:46:04 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Michael Paquier Cc: "James Pang (chaolpan)" , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #17326: Postgres crashed when pg_reload_conf() with ssl certificate parameters Message-ID: <20211214154604.cfmv4kpo2inkt2pp@localhost> References: <17326-d40bbb1386b6c9c3@postgresql.org> <20211208134601.gauysdttc65aoeze@localhost> <20211210142231.fvldmwwy4fr477h2@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mon, Dec 13, 2021 at 08:10:57PM +0900, Michael Paquier wrote: > On Mon, Dec 13, 2021 at 07:06:16AM +0000, James Pang (chaolpan) wrote: > > Edit postgresql.conf to change ssl_certificate parameter , > > Do you mean ssl_cert_file here? Also, something that's not completely > clear to me is if this is a problem with a vanilla PostgreSQL > instance or if this is related to the pgaudit extension set_user, as > it has been mentioned as one potential origin of the problem upthread, > but you are not telling if this is the case here. So what do you have > for shared_preload_libraries in this crash? > > > #9 0x00007ff49a78059c in ssl_cert_clear_certs () from /lib64/libssl.so.1.1 > > #10 0x00007ff49a780645 in ssl_cert_free () from /lib64/libssl.so.1.1 > > #11 0x00007ff49a78a25c in SSL_CTX_free () from /lib64/libssl.so.1.1 > > #12 0x000000000068b6b8 in be_tls_init () > > #13 0x00000000007271e1 in SIGHUP_handler () > > Why is secure_initialize() not showing up in this stack? That would > be the caller of be_tls_init() in the SIGHUP handler. The version of > OpenSSL you are linking your binaries to would be useful here. That > would be a 1.1.0 or a 1.1.1, no? Any specific minor version letter? I think I can actually reproduce the issue. In my case the stack is fine, it contains secure_initialize, and overall it looks like some sort of memory corruption -- at least openssl gets segfault because it can't access some memory address it tries to verify in asn1_primitive_free. Not sure yet why, investigating.