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 1muxFr-0002jb-RE for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Dec 2021 13: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 1muxFq-0002vJ-CM for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Dec 2021 13:45:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1muxFq-0002vA-1a for pgsql-bugs@lists.postgresql.org; Wed, 08 Dec 2021 13:45:06 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1muxFm-00034x-OH for pgsql-bugs@lists.postgresql.org; Wed, 08 Dec 2021 13:45:05 +0000 Received: by mail-wm1-x32f.google.com with SMTP id p3-20020a05600c1d8300b003334fab53afso4185567wms.3 for ; Wed, 08 Dec 2021 05:45:02 -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=RgqgYHDR/FJsvxDM/jYtv+smG0kbtEATz1oYmFHJhsc=; b=a+3ENATn/7cQGMIBVFK79wFAZSK4o3mrAsF3Nn27FxJhHtnvvDxONNcwsqrGhYCdP1 Iv2QkOgaPEtU3neIRN4naSVTEjfCtEr9owcY79ZDRFqtx7FRy2qvZ+JxcZwnsufrWlAB h7cA3dLcIcx9D4lrbURJHKDu4fDHLhjyk9efpqwC/oZhKlaXR9IMmOSl3Qz0BUMStm6B lnHw0qcUydtuqvOEDQ/0KaFVOzk275+TQPwGR7ePAX94476+HDutAeTB2/QIMIh7TazV mD9MvVW/yKMwgo5tArqgT1ymFN8woLyDu7VCq8kEjj0oRwqLlNAxNQXKILihOsIVzJ3u waEw== 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=RgqgYHDR/FJsvxDM/jYtv+smG0kbtEATz1oYmFHJhsc=; b=JpvJceCE7B3WbfoJPipYtKs6BUS1ZkmnGzfLMQbyGnxyhw0nq+CMIBKVozRhVvUlpj 0WGEXvRdPacq73mTMRmZtva54bHTx7clxJv+byEUdkHRX4xCOGEPdhdWvDAimp2+D5ow AYk4kkR2JvSMy5wxFC1bil2WvY7XWRBfnTYK4nhpMjvoyFLMFymZfvarUNCQWrYVChlU tNzYO3rBp65ndKUgdCMxios970JOPv0WRD5TqvOyvI1iZxlIlsnNFC7AdOu0XULvlP3l HnoOfpZ41+5Jea99Tv6fctmpbMss56DECmzAAT/419xMILczsX9g427s149XhYqKCcFp XIrw== X-Gm-Message-State: AOAM531NYxdTfep4FXwmIDI+GzCMrlX2s8nL1B4zPIkhbOpwe0U6oq/D p66IM+5s/fd8F1gE6vsrpwDceXSA6LU= X-Google-Smtp-Source: ABdhPJzTobIjOTS8I6V/9JtxWK8IiqfdsP62rj1Xgb7XlHuCOJeZ44X6dJmjDuWPuQppvG+yKuGwHQ== X-Received: by 2002:a05:600c:4ed2:: with SMTP id g18mr16217077wmq.25.1638971100609; Wed, 08 Dec 2021 05:45:00 -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 x1sm2772460wru.40.2021.12.08.05.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Dec 2021 05:45:00 -0800 (PST) Date: Wed, 8 Dec 2021 14:46:01 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: "James Pang (chaolpan)" Cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #17326: Postgres crashed when pg_reload_conf() with ssl certificate parameters Message-ID: <20211208134601.gauysdttc65aoeze@localhost> References: <17326-d40bbb1386b6c9c3@postgresql.org> 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 > The following bug has been logged on the website: > > Bug reference: 17326 > Logged by: James Pang > Email address: chaolpan@cisco.com > PostgreSQL version: 13.4 > Operating system: RHEL8.4 > Description: > > we need SSL enabled for our production env, when I test renew a ssl certificate , and reload_conf, it crashed. even with same certificate and ssl parameters, run reload_conf often lead to Postgres crash. For example > : > > =# select name,setting from pg_settings where name like 'ssl_%' order by name; > name | setting > ----------------------------------------+------------------------------- > ----------------------------------------+-------- > ssl_ca_file | > /var/lib/pgsql/sslcerts/awstestca.crt > ssl_cert_file | > /var/lib/pgsql/sslcerts/server.crt > ssl_ciphers | HIGH:MEDIUM:+3DES:!aNULL > ssl_crl_file | > ssl_dh_params_file | > ssl_ecdh_curve | prime256v1 > ssl_key_file | > /var/lib/pgsql/sslcerts/server.key > ssl_library | OpenSSL > ssl_max_protocol_version | > ssl_min_protocol_version | TLSv1.2 > ssl_passphrase_command | > ssl_passphrase_command_supports_reload | off > ssl_prefer_server_ciphers | on > (13 rows) > > =# select pg_reload_conf(); > pg_reload_conf > ---------------- > t > (1 row) > > =# select pg_reload_conf(); > pg_reload_conf > ---------------- > t > (1 row) > > =# select pg_reload_conf(); > FATAL: terminating connection due to unexpected postmaster exit server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > The connection to the server was lost. Attempting reset: Failed. > > On Wed, Dec 08, 2021 at 06:22:11AM +0000, James Pang (chaolpan) wrote: > From postgres logs , it show > 2021-12-08 03:57:55.826 UTC::@:[1291058]:[9-1]:2021-12-08 03:33:21 UTC:LOG: received SIGHUP, reloading configuration files > 2021-12-08 03:58:02.832 UTC::@:[1291058]:[10-1]:2021-12-08 03:33:21 UTC:LOG: received SIGHUP, reloading configuration files > 2021-12-08 03:58:03.143 UTC:10.240.212.242(58646):jamet@jamet:[1291076]:[9-1]:2021-12-08 03:33:24 UTC:testsubLOG: disconnection: session time: 0:24:38.967 user=jamet database=jamet host=10.240.212.242 port=58646 > 2021-12-08 03:58:03.147 UTC:[local]:postgres@jamet:[1291397]:[3-1]:2021-12-08 03:57:02 UTC:psqlFATAL: terminating connection due to unexpected postmaster exit > 2021-12-08 03:58:03.147 UTC:[local]:postgres@jamet:[1291397]:[4-1]:2021-12-08 03:57:02 UTC:psqlLOG: disconnection: session time: 0:01:00.405 user=postgres database=jamet host=[local] Hi, Thanks for reporting the issue. Any chance to get a stack trace corresponding to the crash, e.g. like in [1]? [1]: https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD