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 1mCCv4-0007Z8-1R for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 03:22: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 1mCCv3-0004qB-07 for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 03:22:41 +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 1mCCv2-0004q2-Qq for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 03:22:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mCCv0-0002ab-Oc for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 03:22:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1773MaV82640491; Fri, 6 Aug 2021 23:22:36 -0400 From: Tom Lane To: Andres Freund cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o In-reply-to: <2640064.1628306008@sss.pgh.pa.us> References: <2638683.1628304247@sss.pgh.pa.us> <20210807030652.qf5wsbhxk7dpsmtn@alap3.anarazel.de> <2640064.1628306008@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 06 Aug 2021 23:13:28 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2640489.1628306556.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 06 Aug 2021 23:22:36 -0400 Message-ID: <2640490.1628306556@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Guessing the common factor is "macOS", but that's just a guess. > I can poke into it tomorrow. I did try it real quick on my Mac laptop, and that fails too. Here's a more accurate backtrace, in case that helps. (lldb) bt * thread #1, stop reason =3D signal SIGSTOP * frame #0: 0x00007fff2033e92e libsystem_kernel.dylib`__pthread_kill + 1= 0 frame #1: 0x00007fff2036d5bd libsystem_pthread.dylib`pthread_kill + 26= 3 frame #2: 0x00007fff202c2406 libsystem_c.dylib`abort + 125 frame #3: 0x0000000108cdf87f postgres`ExceptionalCondition(conditionNa= me=3D, errorType=3D, fileName=3D, l= ineNumber=3D) at assert.c:69:2 [opt] frame #4: 0x0000000108b0f551 postgres`pgstat_send [inlined] pgstat_ass= ert_is_up at pgstat.c:4810:2 [opt] frame #5: 0x0000000108b0f532 postgres`pgstat_send(msg=3D,= len=3D) at pgstat.c:3032 [opt] frame #6: 0x0000000108b0fbef postgres`pgstat_report_tempfile(filesize=3D= ) at pgstat.c:1812:2 [opt] frame #7: 0x0000000108b7abfe postgres`FileClose [inlined] ReportTempor= aryFileUsage(path=3D"base/pgsql_tmp/pgsql_tmp35840.0", size=3D0) at fd.c:1= 483:2 [opt] frame #8: 0x0000000108b7abf6 postgres`FileClose(file=3D1) at fd.c:1987= [opt] frame #9: 0x0000000108b7c3b8 postgres`CleanupTempFiles(isCommit=3Dfals= e, isProcExit=3Dtrue) at fd.c:0 [opt] frame #10: 0x0000000108b82661 postgres`proc_exit_prepare(code=3D1) at = ipc.c:209:3 [opt] frame #11: 0x0000000108b8253d postgres`proc_exit(code=3D1) at ipc.c:10= 7:2 [opt] frame #12: 0x0000000108ce0201 postgres`errfinish(filename=3D, lineno=3D, funcname=3D) at elog.c:666:3 [op= t] frame #13: 0x0000000108db362b postgres`ProcessInterrupts.cold.9 at pos= tgres.c:3222:3 [opt] frame #14: 0x0000000108baa2a4 postgres`ProcessInterrupts at postgres.c= :3218:22 [opt] frame #15: 0x0000000108b49f4a postgres`sendDir(path=3D".", basepathlen= =3D1, sizeonly=3Dfalse, tablespaces=3D0x00007fb47f0719c8, sendtblspclinks=3D= true, manifest=3D, spcoid=3D0x0000000000000000) at basebackup= .c:1277:3 [opt] frame #16: 0x0000000108b48dc8 postgres`perform_base_backup(opt=3D0x000= 07ffee73ae0a0) at basebackup.c:432:5 [opt] frame #17: 0x0000000108b47bf0 postgres`SendBaseBackup(cmd=3D) at basebackup.c:949:2 [opt] frame #18: 0x0000000108b58055 postgres`exec_replication_command(cmd_st= ring=3D"BASE_BACKUP LABEL 'pg_basebackup base backup' PROGRESS NOWAIT = MANIFEST 'yes' ") at walsender.c:1625:4 [opt] frame #19: 0x0000000108bac8aa postgres`PostgresMain(argc=3D, argv=3D, dbname=3D, username=3D= ) at postgres.c:4484:12 [opt] frame #20: 0x0000000108b178db postgres`BackendRun(port=3D= ) at postmaster.c:4519:2 [opt] frame #21: 0x0000000108b17178 postgres`ServerLoop [inlined] BackendSta= rtup(port=3D) at postmaster.c:4241:3 [opt] frame #22: 0x0000000108b17154 postgres`ServerLoop at postmaster.c:1758= [opt] frame #23: 0x0000000108b1421b postgres`PostmasterMain(argc=3D4, argv=3D= 0x00007fb47ec06640) at postmaster.c:1430:11 [opt] frame #24: 0x0000000108a6ac13 postgres`main(argc=3D, argv= =3D) at main.c:199:3 [opt] frame #25: 0x00007fff20388f3d libdyld.dylib`start + 1 I see two core dumps with what seem to be this same trace after running pg_basebackup's tests. regards, tom lane