Re: FATAL: could not reattach to shared memory (Win32)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Trevor Talbot" <quension(at)gmail(dot)com>, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Shelby Cain" <alyandon(at)yahoo(dot)com>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Terry Yapt" <yapt(at)technovell(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Date: 2007-08-24 15:56:49
Message-ID: 1462.1187971009@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Trevor Talbot" <quension(at)gmail(dot)com> writes:
>> I gather postgres depends on it being at the same address, and fixing that
>> isn't trivial?

> I haven't been following the rest of the thread so I'm not sure if this is
> important. But no, fixing that should be relatively trivial as there are
> already some configurations where it's not the case (the EXEC_BACKEND case I
> believe). The rest of the system uses a shared memory base pointer and
> references everything relative to that.

That hasn't been the case for quite a few years, and we're not going back.
The pointer-to-offset-and-back gymnastics that that required were
utterly destructive to code readability and maintainability, mainly
because if everything stored in shmem data structures is an "offset"
then you can't get any useful error checking from the compiler about how
you are using the fields. It's like decreeing that every pointer
must be declared "void *" and cast to something else when it's used.

There are a few old bits of code that still use MAKE_PTR/MAKE_OFFSET,
but I think it's mostly just that no one's bothered to rewrite the code
for SHM_QUEUE linked lists. The vast majority of our shmem structures
use regular pointers, and have for years.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dimitri Fontaine 2007-08-24 16:01:13 Re: [OT - sorta] How to extract a substring using Regex
Previous Message Phoenix Kiula 2007-08-24 15:52:40 Can tsearch do some basic text mining