Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fAs2X-0007ru-4w for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Apr 2018 07:07:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fAs2U-0007fQ-U0 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Apr 2018 07:06:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fAs2U-0007fH-FF for pgsql-hackers@lists.postgresql.org; Tue, 24 Apr 2018 07:06:58 +0000 Received: from mail-pg0-x235.google.com ([2607:f8b0:400e:c05::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fAs2P-000640-Nn for pgsql-hackers@lists.postgresql.org; Tue, 24 Apr 2018 07:06:57 +0000 Received: by mail-pg0-x235.google.com with SMTP id p10so10167086pgn.1 for ; Tue, 24 Apr 2018 00:06:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xPZ0yyq4TrpWPQHg1MxmmaWQwZJL0S7vAwrn23boauE=; b=Y1phFHpeMxL0lFGge7wdxCSJbtxfF4tcBhsforTWQMXmfVaS+WhVmV2/+tlbLQLAh0 Jt2PyJqf+Lgp0JqIkVL9gA2Uwhhe9jjWMinAFPg/krBOT5+NdbEBwLMypNG1uXtR4qe8 wB3ORz5xzSZby0Uk90+xnlKeqFrWy3zbAhR3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xPZ0yyq4TrpWPQHg1MxmmaWQwZJL0S7vAwrn23boauE=; b=iJV0kPcInkTmfRAepymbotggm5sWyRntceMXQhp9foYZtWPMEhx6VDe5/uMncoqUrr rWgEBx0wAvUsaLj031k89NU8dCvznP3mThFQCW8zYIFyn/vmIGm3AP2JG/rZ8CkKeZ78 5ovYnjsDs1Zi7qw7ux9Cqs76w6+RtLOY7TSz/O4aNmjpamXjlng+4kZxetGu6PcZmwRm RXJxcEVeblEHg95ocByoqQSxvXqgiJDbX7NCT1kAGubKchTIf2TzEcUfqfZsI0ecvJjw 2NCWYRep1Q1wsJ4vlRjllpzvhZJkvvDIM3slwVTI5K5ToCta6g+7iP8dpmVElx2F7Joe DRDQ== X-Gm-Message-State: ALQs6tDjrQGVu1g9P0AS8Q7g+CtSBQ9SyGTfTVlBZBAxpqEXJL3cXFqf 92o2DSyR3anwCdZ9j6bDBZSo+g== X-Google-Smtp-Source: AIpwx48xf1B47eOXRjwYVMafvGwupkjWON598CoKd+VDhq2J9iapmmO2fnPjLoJs1TPsMiwMfDrU3w== X-Received: by 2002:a17:902:a58a:: with SMTP id az10-v6mr14880298plb.210.1524553610310; Tue, 24 Apr 2018 00:06:50 -0700 (PDT) Received: from rfd.leadboat.com (c-73-158-248-138.hsd1.ca.comcast.net. [73.158.248.138]) by smtp.gmail.com with ESMTPSA id y3sm19696481pgc.81.2018.04.24.00.06.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 00:06:48 -0700 (PDT) Date: Tue, 24 Apr 2018 07:06:46 +0000 From: Noah Misch To: Thomas Munro Cc: Stephen Frost , Tom Lane , PostgreSQL Hackers Subject: Re: "could not reattach to shared memory" on buildfarm member dory Message-ID: <20180424070646.GA2693533@rfd.leadboat.com> References: <25495.1524517820@sss.pgh.pa.us> <20180423231855.GK27724@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Apr 24, 2018 at 11:37:33AM +1200, Thomas Munro wrote: > On Tue, Apr 24, 2018 at 11:18 AM, Stephen Frost wrote: > > Greetings, > > > > * Tom Lane (tgl@sss.pgh.pa.us) wrote: > >> So far, dory has failed three times with essentially identical symptoms: > >> > >> 2018-04-23 19:57:10.624 GMT [2240] FATAL: could not reattach to shared memory (key=0000000000000190, addr=00000000018E0000): error code 487 > >> 2018-04-23 15:57:10.657 EDT [8836] ERROR: lost connection to parallel worker > >> 2018-04-23 15:57:10.657 EDT [8836] STATEMENT: select count(*) from tenk1 group by twenty; > >> 2018-04-23 15:57:10.660 EDT [3820] LOG: background worker "parallel worker" (PID 2240) exited with exit code 1 > >> > >> Now how can this be? We've successfully reserved and released the address > >> range we want to use, so it *should* be free at the instant we try to map. > > > > Yeah, that's definitely interesting. > > I wondered if another thread with the right timing could map something > between the VirtualFree() and MapViewOfFileEx() calls, but we don't > create the Windows signal handling thread until a bit later. Could > there be any any other threads active in the process? > > Maybe try asking what's mapped there with VirtualQueryEx() on failure? +1. An implementation of that: https://www.postgresql.org/message-id/20170403065106.GA2624300%40tornado.leadboat.com