Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2016-09-20 Thread Tom Lane
Robert Haas writes: > Yeah, random() is the wrong thing. It should use PostmasterRandom(). > Fixed to do that instead. I am not very happy about this patch; have you considered the security implications of what you just did? If you haven't, I'll tell you: you just made the postmaster's selectio

[HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2016-09-20 Thread Robert Haas
On Thu, Oct 15, 2015 at 11:32 PM, Amit Kapila wrote: > On Thu, Oct 15, 2015 at 8:35 PM, Dmitry Vasilyev > wrote: >> >> I think that function dsm_impl_windows() with EACCES error should not >> do ereport() with FATAL level. It works, but it is likely to make an >> infinite loop if the user will re

Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-17 Thread Tom Lane
Amit Kapila writes: > On Sat, Oct 17, 2015 at 12:07 AM, Robert Haas wrote: >> Maybe we need to be using PostmasterRandom() rather than random() for >> the control segment name. > +1. Though I think it is better to investigate the actual cause before > doing this. BackendRun() deliberately prev

[HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-17 Thread Amit Kapila
On Sat, Oct 17, 2015 at 12:07 AM, Robert Haas wrote: > > On Thu, Oct 15, 2015 at 11:32 PM, Amit Kapila wrote: > > Another some what related point is currently we are using random() > > function to ensure a unique name for dsm and it seems to me that > > it is always going to generate same number

[HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-16 Thread Robert Haas
On Thu, Oct 15, 2015 at 11:32 PM, Amit Kapila wrote: > Another some what related point is currently we are using random() > function to ensure a unique name for dsm and it seems to me that > it is always going to generate same number on first invocation (at least > thats what happening on windows)

Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-16 Thread Dmitry Vasilyev
On Пт, 2015-10-16 at 09:02 +0530, Amit Kapila wrote: > On Thu, Oct 15, 2015 at 8:35 PM, Dmitry Vasilyev pro.ru> wrote: > > I think that function dsm_impl_windows() with EACCES error should > > not > > do ereport() with FATAL level. It works, but it is likely to make > > an > > infinite loop if th

[HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-16 Thread Amit Kapila
On Fri, Oct 16, 2015 at 12:16 PM, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > This is wrong, current code does well for this case. I should > broke the code during investigating the problem. > > > > So, to make the windows version behave as the same, > > > dsm_impl_windows should

Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-15 Thread Kyotaro HORIGUCHI
This is wrong, current code does well for this case. I should broke the code during investigating the problem. > > So, to make the windows version behave as the same, > > dsm_impl_windows should return false if GetLastError() == > > ERROR_ALREADY_EXISTS regardless of hmap is valid. The current > >

Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-15 Thread Kyotaro HORIGUCHI
Sorry, forgot to close the valid handle on return. > > Currently we are using error level as ERROR for creating dsm during > > postmaster startup which is not right and rather we should use error > > level as LOG. Can you please try with the attached patch and see > > if the issue is fixed for

Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-15 Thread Kyotaro HORIGUCHI
Hello, > Currently we are using error level as ERROR for creating dsm during > postmaster startup which is not right and rather we should use error > level as LOG. Can you please try with the attached patch and see > if the issue is fixed for you. It seems somewhat strange. Looking into the crea

[HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-15 Thread Amit Kapila
On Thu, Oct 15, 2015 at 8:35 PM, Dmitry Vasilyev wrote: > I think that function dsm_impl_windows() with EACCES error should not > do ereport() with FATAL level. It works, but it is likely to make an > infinite loop if the user will receive EACCES error. > > Currently we are using error level as E

Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-15 Thread Dmitry Vasilyev
I think that function dsm_impl_windows() with EACCES error should not do ereport() with FATAL level. It works, but it is likely to make an infinite loop if the user will receive EACCES error. On Чт, 2015-10-15 at 17:46 +0300, Dmitry Vasilyev wrote: >  I’ve created 2 unprivileged users: user1 and u

[HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”

2015-10-15 Thread Dmitry Vasilyev
 I’ve created 2 unprivileged users: user1 and user2; and registered 2 services thorough pg_ctl register respectively under these 2 users. If first service is running second could not start and vice versa. Dmitry Vasilyev Postgres Professional: http://www.postgrespro.com Russian Postgres Comp