Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vgWMt-00EiNX-1V for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 23:03:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vgWMr-001kBQ-1f for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 23:03:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vgWMq-001kAz-2x for pgsql-hackers@lists.postgresql.org; Thu, 15 Jan 2026 23:03:05 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vgWMj-000eFK-1n for pgsql-hackers@postgresql.org; Thu, 15 Jan 2026 23:02:59 +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 60FN2YV5934396; Thu, 15 Jan 2026 18:02:34 -0500 From: Tom Lane To: Andres Freund cc: Chao Li , Kirill Reshke , Heikki Linnakangas , Melanie Plageman , Matthias van de Meent , pgsql-hackers@postgresql.org, Thomas Munro , Noah Misch , Robert Haas , Michael Paquier Subject: Re: Buffer locking is special (hints, checksums, AIO writes) In-reply-to: References: <4csodkvvfbfloxxjlkgsnl2lgfv2mtzdl7phqzd4jxjadxm4o5@usw7feyb5bzf> <9C2494E1-F446-42DF-B070-7E231B8E6221@gmail.com> <58821140-0182-4FF3-9A4F-5B168DDB9243@gmail.com> <732580B4-962F-4EBD-8811-F4667D79747D@gmail.com> Comments: In-reply-to Andres Freund message dated "Thu, 15 Jan 2026 11:43:14 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <934394.1768518154.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 15 Jan 2026 18:02:34 -0500 Message-ID: <934395.1768518154@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Various buildfarm animals are complaining about fcb9c977a, similarly to this from calliphoridae [1]: [969/2355] ccache gcc -Isrc/backend/postgres_lib.a.p -Isrc/include -I../pg= sql/src/include -I/usr/include/libxml2 -fdiagnostics-color=3Dnever -D_FILE= _OFFSET_BITS=3D64 -Wall -Winvalid-pch -O2 -g -fno-strict-aliasing -fwrapv = -fexcess-precision=3Dstandard -D_GNU_SOURCE -Wmissing-prototypes -Wpointer= -arith -Werror=3Dvla -Wendif-labels -Wmissing-format-attribute -Wimplicit-= fallthrough=3D3 -Wcast-function-type -Wshadow=3Dcompatible-local -Wformat-= security -Wdeclaration-after-statement -Wmissing-variable-declarations -Wn= o-format-truncation -Wno-stringop-truncation -O1 -ggdb -g3 -fno-omit-frame= -pointer -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missin= g-field-initializers -DCOPY_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TES= T -fPIC -isystem /usr/include/mit-krb5 -pthread -DBUILDING_DLL -MD -MQ src= /backend/postgres_lib.a.p/storage_buffer_bufmgr.c.o -MF src/backend/postgr= es_lib.a.p/storage_buffer_bufmgr.c.o.d -o src/backend/postgres_lib.a.p/sto= rage_buffer_bufmgr.c.o -c ../pgsql/src/backend/storage/buffer/bufmgr.c In file included from ../pgsql/src/include/pgstat.h:24, from ../pgsql/src/backend/storage/buffer/bufmgr.c:52: In function \342\200\230pgstat_report_wait_start\342\200\231, inlined from \342\200\230BufferLockAcquire\342\200\231 at ../pgsql/src= /backend/storage/buffer/bufmgr.c:5833:3: ../pgsql/src/include/utils/wait_event.h:75:49: warning: \342\200\230wait_e= vent\342\200\231 may be used uninitialized [-Wmaybe-uninitialized] 75 | *(volatile uint32 *) my_wait_event_info =3D wait_event_inf= o; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ ../pgsql/src/backend/storage/buffer/bufmgr.c: In function \342\200\230Buff= erLockAcquire\342\200\231: ../pgsql/src/backend/storage/buffer/bufmgr.c:5781:33: note: \342\200\230wa= it_event\342\200\231 was declared here 5781 | uint32 wait_event; | ^~~~~~~~~~ Apparently they do not find the coding in this switch persuasive: switch (mode) { case BUFFER_LOCK_EXCLUSIVE: wait_event =3D WAIT_EVENT_BUFFER_EXCLUSIVE; break; case BUFFER_LOCK_SHARE_EXCLUSIVE: wait_event =3D WAIT_EVENT_BUFFER_SHARE_EXCLUSIVE; break; case BUFFER_LOCK_SHARE: wait_event =3D WAIT_EVENT_BUFFER_SHARED; break; case BUFFER_LOCK_UNLOCK: pg_unreachable(); } It's not clear to me whether that's more about not believing pg_unreachable() or more about the lack of a default: case. I see that this is a modification of code that existed before fcb9c977a and wasn't being complained of, which makes it even stranger. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=3Dcallip= horidae&dt=3D2026-01-15%2019%3A35%3A00&stg=3Dbuild