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 1n6x2l-0006Cc-Hj for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 15:57:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6x2k-00085L-F3 for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 15:57:10 +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 ) id 1n6x2k-00085C-5W for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 15:57:10 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6x2g-0000qn-T6 for pgsql-hackers@postgresql.org; Mon, 10 Jan 2022 15:57:09 +0000 Received: (Authenticated sender: adsend@dunslane.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A52AE240004; Mon, 10 Jan 2022 15:57:02 +0000 (UTC) Message-ID: <56014fa7-be7f-86f4-9f25-e8341342d5f5@dunslane.net> Date: Mon, 10 Jan 2022 10:57:00 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: Windows crash / abort handling Content-Language: en-US To: Andres Freund , pgsql-hackers@postgresql.org Cc: Tom Lane , Craig Ringer References: <20211005193033.tg4pqswgvu3hcolm@alap3.anarazel.de> From: Andrew Dunstan In-Reply-To: <20211005193033.tg4pqswgvu3hcolm@alap3.anarazel.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/5/21 15:30, Andres Freund wrote > > To actually get the crash reports I ended up doing the following on the OS > level [5]: > > Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug' -Name 'Debugger' -Value '\"C:\Windows Kits\10\Debuggers\x64\cdb.exe\" -p %ld -e %ld -g -kqm -c \".lines -e; .symfix+ ;.logappend c:\cirrus\crashlog.txt ; !peb; ~*kP ; .logclose ; q \"' ; ` > New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug' -Name 'Auto' -Value 1 -PropertyType DWord ; ` > Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug' -Name Debugger; ` > > This requires 'cdb' to be present, which is included in the Windows 10 SDK (or > other OS versions, it doesn't appear to have changed much). Whenever there's > an unhandled crash, cdb.exe is invoked with the parameters above, which > appends the crash report to crashlog.txt. > > Alternatively we can generate "minidumps" [6], but that doesn't appear to be more > helpful for CI purposes at least - all we'd do is to create a backtrace using > the same tool. But it might be helpful for local development, to e.g. analyze > crashes in more detail. > > The above ends up dumping all crashes into a single file, but that can > probably be improved. But cdb is so gnarly that I wanted to stop looking once > I got this far... > > > Andrew, I wonder if something like this could make sense for windows BF animals? > Very possibly. I wonder how well it will work on machines where I have more than one animal .e.g. lorikeet (cygwin) jacana (msys) and bowerbird (MSVC) are all on the same machine. Likewise drongo (MSVC) and fairywren (msys2). cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com