pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-hackers@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Craig Ringer <craig.ringer@enterprisedb.com>
Subject: Re: Windows crash / abort handling
Date: Tue, 11 Jan 2022 13:13:03 -0800
Message-ID: <20220111211303.34vr25whig76srza@alap3.anarazel.de> (raw)
In-Reply-To: <f7baca77-af9c-51da-dc1c-0e3fcc16ca94@dunslane.net>
References: <20211005193033.tg4pqswgvu3hcolm@alap3.anarazel.de>
	<56014fa7-be7f-86f4-9f25-e8341342d5f5@dunslane.net>
	<20220111075119.6ri6msoxv4z7fu73@alap3.anarazel.de>
	<f7baca77-af9c-51da-dc1c-0e3fcc16ca94@dunslane.net>

Hi,

On 2022-01-11 12:01:42 -0500, Andrew Dunstan wrote:
> On 1/11/22 02:51, Andres Freund wrote:
> > It'd be a bit of a fight with cdb's awfully documented and quirky
> > scripting [1], but the best solution would probably be to just use an
> > environment variable from the target process to determine the dump
> > location. Then each buildfarm config could set a BF_BACKTRACE_LOCATION
> > variable or such...
> >
> > [1] So there's !envvar. But that yields a string like
> > BF_BACKTRACE_LOCATION = value of environment variable when set to an
> > alias.  And I haven't found an easy way to get rid of the "variablename
> > = ". There is .foreach /pS [2] which could be used to skip over the
> > varname =, but that then splits on all whitespaces. Gah.
> >
> > [2] https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/-foreach
> >
> 
> Ugly as heck.

Indeed. I think I figured it out:

0:000> !envvar frak
        frak = C:\Program Files\Application Verifier\
0:000> ad /q path; .foreach /pS 2 (component {!envvar frak}){ .if (${/d:path}) {aS ${/v:path} ${/f:path} ${component}} .else {aS ${/v:path} ${component}}}; .block {.echo ${path}}
C:\Program Files\Application Verifier\

I mean, no explanation needed, right?


> But in theory these animals could be running in parallel, and in theory
> each animal could have more than one branch being run concurrently. In
> fact locking them against each other can be difficult/impossible.

The environment variable solution directing dumps for each animal / branch to
different directories should take care of that, right?


Do you have a preference where a script file implementing the necessary
cdb.exe commands would reside? It's getting too long to comfortably implement
it inside the registry setting itself... That script would be used by all
branches, rather than be branch specific.

Greetings,

Andres Freund





view thread (12+ messages)  latest in thread

Message-ID: <20220111211303.34vr25whig76srza@alap3.anarazel.de>
Permalink:  ../20220111211303.34vr25whig76srza@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20220111211303.34vr25whig76srza@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andres@anarazel.de, andrew@dunslane.net, tgl@sss.pgh.pa.us, craig.ringer@enterprisedb.com
  Subject: Re: Windows crash / abort handling
  In-Reply-To: <20220111211303.34vr25whig76srza@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox