Re: pg crashing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg crashing
Date: 2008-07-02 15:17:58
Message-ID: 11759.1215011878@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

BTW, just looking at win32_shmem.c ...

retptr = malloc(bufsize + 1 + 18); /* 1 NULL and 18 for
* Global\PostgreSQL: */
if (retptr == NULL)
elog(FATAL, "could not allocate memory for shared memory name");

strcpy(retptr, "Global\\PostgreSQL:");
r = GetFullPathName(DataDir, bufsize, retptr + 11, NULL);

Surely that "11" ought to be "18". Also, since the loop immediately
below this is going to convert \ to /, wouldn't it be clearer to
describe the path prefix as Global/PostgreSQL: in the first place?

(BTW, as far as I can tell the +1 added to the malloc request is
useless: bufsize includes the trailing null, and the code would
not work if it did not.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Felipe de Jesús Molina Bravo 2008-07-02 15:19:00 Re: SRF written in C
Previous Message Gwyneth Morrison 2008-07-02 15:15:41 Delete from Join

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-07-02 15:52:19 Re: pg crashing
Previous Message Alvaro Herrera 2008-07-02 15:14:23 Re: [WIP] patch - Collation at database level