Thread: PostgreSQL 6.4 problems on Linux.

PostgreSQL 6.4 problems on Linux.

From
Kevin Lo
Date:
Hi,

I upgrade postgres to 6.4, compile and install postgres with no problems. But
when I run
postmaster -i&, I got the following messages:

% IpcMemoryCreate: shmget failed (Invalid argument) key=543200
1, size=831176, permission=600
FATAL 1:  ShmemCreate: cannot create region

I don't know what's wrong with it, would anyone tell me how to fix this problem,
thanks.
The kernel version is 2.0.35.

P.S. I run 6.3 with no problems.

Thanks in advance,
Kevin.




Re: [GENERAL] PostgreSQL 6.4 problems on Linux.

From
Fabio Mancinelli
Date:
On Sat, 7 Nov 1998, Kevin Lo wrote:

> % IpcMemoryCreate: shmget failed (Invalid argument) key=543200
> 1, size=831176, permission=600
> FATAL 1:  ShmemCreate: cannot create region
>
If I am not wrong shmem has to do with X shared memory extension from MIT.
Probably you try to run postgres not on the host you are logged on.
I've seen that postgres can be compiled with X support. Try to disable it.

Bye

P.S. : Probably I am completely wrong! :)

------------------------------------------------------------------------------
 Greetings from Fabio Mancinelli   E-Mail : mancinel@univaq.it
 Computer Science Student                   xenon@olografix.org
 University of L'Aquila               WWW : http://univaq.it/~mancinel
 (PGP Public Key available)                 http://www.olografix.org/xenon


Re: [GENERAL] PostgreSQL 6.4 problems on Linux.

From
"Oliver Elphick"
Date:
Fabio Mancinelli wrote:
  >On Sat, 7 Nov 1998, Kevin Lo wrote:
  >
  >> % IpcMemoryCreate: shmget failed (Invalid argument) key=543200
  >> 1, size=831176, permission=600
  >> FATAL 1:  ShmemCreate: cannot create region
  >>
  >If I am not wrong shmem has to do with X shared memory extension from MIT.
  >Probably you try to run postgres not on the host you are logged on.
  >I've seen that postgres can be compiled with X support. Try to disable it.
  >
  >Bye
  >
  >P.S. : Probably I am completely wrong! :)

I think so...  I am able to start the postmaster with -i in Linux 2.0.34.

The error '(Invalid argument)' is presumably from the kernel:

From the kernel code:
        if (size > shp->shm_segsz)
                return -EINVAL;

This bit of code is run if an existing shared memory segment is found;
so the problem seems to be that the segment found is too small for the
request made of it.

I suggest that he use ipcrm to clear shared memory segments and then try
again.

One puzzle for me is that ipcs does not report any shared memory in use,
even with two backends using the same database.  I thought shared memory
was used to do locking??

(This may be to do with the fact that I am not running my normal kernel
version at the moment.)
--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Let all that you do be done in love."
                                      1 Corinthians 16:14



Re: [GENERAL] PostgreSQL 6.4 problems on Linux.

From
Kevin Lo
Date:
Oliver Elphick wrote:

> Fabio Mancinelli wrote:
>   >On Sat, 7 Nov 1998, Kevin Lo wrote:
>   >
>   >> % IpcMemoryCreate: shmget failed (Invalid argument) key=543200
>   >> 1, size=831176, permission=600
>   >> FATAL 1:  ShmemCreate: cannot create region
>   >>
>   >If I am not wrong shmem has to do with X shared memory extension from MIT.
>   >Probably you try to run postgres not on the host you are logged on.
>   >I've seen that postgres can be compiled with X support. Try to disable it.
>   >
>   >Bye
>   >
>   >P.S. : Probably I am completely wrong! :)
>
> I think so...  I am able to start the postmaster with -i in Linux 2.0.34.
>
> The error '(Invalid argument)' is presumably from the kernel:
>
> >From the kernel code:
>         if (size > shp->shm_segsz)
>                 return -EINVAL;
>
> This bit of code is run if an existing shared memory segment is found;
> so the problem seems to be that the segment found is too small for the
> request made of it.
>
> I suggest that he use ipcrm to clear shared memory segments and then try
> again.

Hi, Oliver,

I don't know how to use ipcrm, would you like to teach me, thanks.
For example, I run ipcrm shm,  it displays:

ipcrm shm
usage: ipcrm [shm | msg | sem] id

What does 'id' mean?

> One puzzle for me is that ipcs does not report any shared memory in use,
> even with two backends using the same database.  I thought shared memory
> was used to do locking??
>
> (This may be to do with the fact that I am not running my normal kernel
> version at the moment.)

I think maybe that's the 6.4 problem, because I can run postmaster on 6.3 with
no problems.
Now I can't find 6.3 source code, so please help me, thank you very much!

- Kevin.


Re: [GENERAL] PostgreSQL 6.4 problems on Linux.

From
"Oliver Elphick"
Date:
Kevin Lo wrote:
  >Oliver Elphick wrote:
  >>
  >> I suggest that he use ipcrm to clear shared memory segments and then try
  >> again.
  >
  >Hi, Oliver,
  >
  >I don't know how to use ipcrm, would you like to teach me, thanks.
  >For example, I run ipcrm shm,  it displays:
  >
  >ipcrm shm
  >usage: ipcrm [shm | msg | sem] id
  >
  >What does 'id' mean?


Use ipcs to list shared resources, ipcrm to remove one.  The id is the
number listed under shmid by ipcs.

Remember the man program; that should be your first call for help on
program usage.


Example:

bash-2.01$ ipcs

------ Shared Memory Segments --------
key        shmid     owner     perms     bytes     nattch    status
0xacec9312 3         root      666       256776    0

------ Semaphore Arrays --------
key       semid     owner     perms     nsems     status

------ Message Queues --------
key       msqid     owner     perms     used-bytes  messages
0xacea0207 0         root      666       0           0

bash-2.01$ ipcrm shm 3
resource deleted

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Let all that you do be done in love."
                                      1 Corinthians 16:14