Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] "could not reattach to shared memory" on Windows

From: Tsutomu Yamada <tsutomu(at)sraoss(dot)co(dot)jp>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tsutomu Yamada <tsutomu(at)sraoss(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org, Dave Page <dpage(at)pgadmin(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] "could not reattach to shared memory" on Windows
Date: 2009-07-23 06:04:52
Message-ID: 5775.1248329092@srapc2360.sra.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello,

Thank you for correcting patch.
However, I think the following block have to use VirualFree*Ex*().

(yes, this should never happen, maybe there is actually no problem.
 but for logical correctness)

>+ 	if (address != UsedShmemSegAddr)
>+ 	{
>+ 		/*
>+ 		 * Should never happen - in theory if allocation granularity causes strange
>+ 		 * effects it could, so check just in case.
>+ 		 *
>+ 		 * Don't use FATAL since we're running in the postmaster.
>+ 		 */
>+ 	    elog(LOG, "reserved shared memory region got incorrect address %p, expected %p",
>+ 			 address, UsedShmemSegAddr);
>+ 		VirtualFree(address, 0, MEM_RELEASE);
		VirtualFreeEx(hChild, address, 0, MEM_RELEASE);

>+ 		return false;
>+ 	}

Regards,

-- 
Tsutomu Yamada
SRA OSS, Inc. Japan

In response to

Responses

pgsql-hackers by date

Next:From: David E. WheelerDate: 2009-07-23 06:41:22
Subject: Re: revised hstore patch
Previous:From: Tom LaneDate: 2009-07-23 04:42:37
Subject: Re: join regression failure on cygwin

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group