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 1pTOh6-0007yp-Bo for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Feb 2023 15:00:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pTOh5-0003Lh-4K for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Feb 2023 15:00:07 +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 1pTOh4-0003Kh-Op for pgsql-hackers@lists.postgresql.org; Sat, 18 Feb 2023 15:00:06 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pTOh2-0007Xw-Ao for pgsql-hackers@postgresql.org; Sat, 18 Feb 2023 15:00:05 +0000 Received: by mail-lf1-x12b.google.com with SMTP id b22so1326849lfv.5 for ; Sat, 18 Feb 2023 07:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nMbsQPYCa807yxYZu98x2yCqSEkmPENYi4/6fpW4IeE=; b=SKsSZNPa2L5JfWKkKbwvIHvK/GW/ttqK5TyjLzJm86NrHPdLbgVKG99lKtQx42D1gD 0NfFt8B0uRFBT9TUQJ+Tsi0nQfl8VTDI4aAw3dIDucY1SX+KX6qR4hOr1b52UksbEDpu Rp/OwDJTo7eF81Rd6H50HYiaRT7xqXquiW+JwndwBUbh0LcKTXwDMZbuJLwPfklRwQIX uK85zigH7UvKxCm8OlfZj7mLuO+5TwbIr9/PkBKN4OlMLNM3MZYo6RiqejfIn2gBn65l XgynwRuuz7tx2Gpqr05MNwhduvtIwwG7vzazP1wlNnDtVrIkxiZhORIeyAr03n0o2FEp XTRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nMbsQPYCa807yxYZu98x2yCqSEkmPENYi4/6fpW4IeE=; b=7rn7IK3WdXRwQjtZm+MlohW2dBzQTQKmmcki2N73jTa56/2wcHOf4pBNnibSK2L9QS RzqTjWeNiFYUex0EjhwlY9BorVuDYVLBJFSmolSuPEuJSSTA382Tz7i6QPO7z0dMVKzZ j9dOaqLqgVEzt+WF1wxveqjfyUzfknKzeeWWMfftv0AFh+LcQ+mciMapOck24aRXPRdA H3o5txsjnrTVFN6vFJyDI/DpUVJ1lCruozaEgbHotYWVQNJG6/v/5wPIOk5bKQqhGhlH L4vEKtKQ7SK+/Ob9suheoWksPwo4HWcKS4gVQu/abo4Lu0HN8oHFPgwZgoV98Ct3HqKw fl4Q== X-Gm-Message-State: AO0yUKW9wxjq5KWw/Y8r2RpyY1IPgZugIHeh3U1jTrLIS2SzOZcp4vr4 hBjkxrR6GjxRGLoXXhnBaRw= X-Google-Smtp-Source: AK7set+yOU9bWv1b/hBornwPhxxb9vas/kPIabLmwaaDwvfTt0pyT5mmcX0cJASW1xYqpVYH58b+2Q== X-Received: by 2002:ac2:4c87:0:b0:4d5:82bc:779 with SMTP id d7-20020ac24c87000000b004d582bc0779mr855090lfl.23.1676732402596; Sat, 18 Feb 2023 07:00:02 -0800 (PST) Received: from [1.0.0.7] ([178.155.5.245]) by smtp.gmail.com with ESMTPSA id c20-20020ac25314000000b004cb3a55feacsm999656lfh.100.2023.02.18.07.00.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Feb 2023 07:00:01 -0800 (PST) Message-ID: Date: Sat, 18 Feb 2023 18:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: windows CI failing PMSignalState->PMChildFlags[slot] == PM_CHILD_ASSIGNED Content-Language: en-US To: Andres Freund , Thomas Munro Cc: pgsql-hackers@postgresql.org References: <20230208012852.bvkn2am4h4iqjogq@awork3.anarazel.de> <20230218010649.vlksvn3o7jtshp4y@awork3.anarazel.de> From: Alexander Lakhin In-Reply-To: <20230218010649.vlksvn3o7jtshp4y@awork3.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, 18.02.2023 04:06, Andres Freund wrote: > Hi, > > On 2023-02-18 13:27:04 +1300, Thomas Munro wrote: >> I still have no theory for how this condition was reached despite a >> lot of time thinking about it and searching for more clues. As far as >> I can tell, the recent improvements to postmaster's signal and event >> handling shouldn't be related: the state management and logic was >> unchanged. > Yea, it's all very odd. > > If you look at the log: > > 2023-02-08 00:53:20.175 GMT client backend[5948] pg_regress/name DETAIL: No valid identifier after ".". > 2023-02-08 00:53:20.175 GMT client backend[5948] pg_regress/name STATEMENT: SELECT parse_ident('xxx.1020'); > ... > TRAP: failed Assert("PMSignalState->PMChildFlags[slot] == PM_CHILD_ASSIGNED"), File: "../src/backend/storage/ipc/pmsignal.c", Line: 329, PID: 5948 > abort() has been called > ... > 2023-02-08 00:53:27.420 GMT postmaster[872] LOG: server process (PID 5948) was terminated by exception 0xC0000354 > 2023-02-08 00:53:27.420 GMT postmaster[872] HINT: See C include file "ntstatus.h" for a description of the hexadecimal value. > 2023-02-08 00:53:27.420 GMT postmaster[872] LOG: terminating any other active server processes > 2023-02-08 00:53:27.434 GMT postmaster[872] LOG: all server processes terminated; reinitializing > > > and that it's indeed the money test that failed: > money ... FAILED (test process exited with exit code 2) 7337 ms > > it's very hard to understand how this stack can come to be: > > 00000085`f03ffa40 00007ff6`fd89faa8 ucrtbased!abort(void)+0x5a [minkernel\crts\ucrt\src\appcrt\startup\abort.cpp @ 77] > 00000085`f03ffa80 00007ff6`fd6474dc postgres!ExceptionalCondition( > char * conditionName = 0x00007ff6`fdd03ca8 "PMSignalState->PMChildFlags[slot] == PM_CHILD_ASSIGNED", > char * fileName = 0x00007ff6`fdd03c80 "../src/backend/storage/ipc/pmsignal.c", > int lineNumber = 0n329)+0x78 [c:\cirrus\src\backend\utils\error\assert.c @ 67] > 00000085`f03ffac0 00007ff6`fd676eff postgres!MarkPostmasterChildActive(void)+0x7c [c:\cirrus\src\backend\storage\ipc\pmsignal.c @ 329] > 00000085`f03ffb00 00007ff6`fd59aa3a postgres!InitProcess(void)+0x2ef [c:\cirrus\src\backend\storage\lmgr\proc.c @ 375] > 00000085`f03ffb60 00007ff6`fd467689 postgres!SubPostmasterMain( > int argc = 0n3, > char ** argv = 0x000001c6`f3814e80)+0x33a [c:\cirrus\src\backend\postmaster\postmaster.c @ 4962] > 00000085`f03ffd90 00007ff6`fda0e1c9 postgres!main( > int argc = 0n3, > char ** argv = 0x000001c6`f3814e80)+0x2f9 [c:\cirrus\src\backend\main\main.c @ 192] > > How can a process that we did notify crashing, that has already executed SQL > statements, end up in MarkPostmasterChildActive()? Maybe it's just the backend started for the money test has got the same PID (5948) that the backend for the name test had? A simple script that I've found [1] shows that the pids reused rather often (for me, approximately each 300 process starts in Windows 10 H2), buy maybe under some circumstances (many concurrent processes?) PIDs can coincide even so often to trigger that behavior. [1] https://superuser.com/questions/636497/does-windows-7-reuse-process-ids