![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
FATAL: could not create shared memory segment: Cannot allocate memory Here's the code that triggers it: create function pltcl_call_handler() RETURNS LANGUAGE_HANDLER as 'pltcl.so' language 'c'; |
|
Not sure whether this is a PostgreSQL problem or a Mac OS 10.3 problem, |
#3
| |||
| |||
|
|
psql:/Users/scott/m/ops/database/sql/add_languages.sql:13: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. ...output in the log file is: LOG: server process (PID 2739) was terminated by signal 10 |
|
FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=5432001, size=3809280, 03600). |
#4
| |||
| |||
|
|
After recompiling with GCC 3.1 it fails when I'm running initdb to create the cluster -- it's a shmget error again. I believe that takes both Tcl and PostgreSQL out of the suspect pool and leaves Mac OS 10.3 as the primary culprit. |
#5
| |||
| |||
|
|
Just compiled PG 7.3.4 with GCC 3.1 on Panther and it exhibits the same problem, but generates a SIGSEGV instead of a SIGBUS. |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Here's the code that triggers it: create function pltcl_call_handler() RETURNS LANGUAGE_HANDLER as 'pltcl.so' language 'c'; I don't think so. That's a startup failure; it can not be triggered by executing a SQL command, because if the postmaster is alive enough to accept a SQL command in the first place, it's already gotten past creation of the shared memory segment. |
|
Not sure whether this is a PostgreSQL problem or a Mac OS 10.3 problem, It's a user problem. If you're going to run multiple shared-memory-using applications, it's up to you to adjust the kernel limit or the per-application requests to fit. I can't tell from this what other app is using shared memory, though. Are you trying to start more than one postmaster? If not, see whether OS X provides "ipcs" --- that would give you some data about what shared-memory requests are already present in the system. |
#8
| |||
| |||
|
|
Scott Goodwin <scott (AT) scottg (DOT) net> writes: psql:/Users/scott/m/ops/database/sql/add_languages.sql:13: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. ...output in the log file is: LOG: server process (PID 2739) was terminated by signal 10 Here's the real problem --- why are you getting a SIGBUS while trying to load the pltcl handler function? I suspect something broken in Tcl's shared library, but dunno what. You should be getting a core file from the crashed process --- can you get a stack trace from it with gdb? FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=5432001, size=3809280, 03600). This is evidently happening during attempted restart after the backend crash. I suspect it is a matter of the OS not having released the old memory segment yet, together with the SHMMAX limit being too tight to allow two such segments to exist concurrently. Are you able to start the server by hand immediately afterwards, or a few seconds afterwards? Or do you have to reboot before it will restart? regards, tom lane |
#9
| |||
| |||
|
|
Scott Goodwin <scott (AT) scottg (DOT) net> writes: psql:/Users/scott/m/ops/database/sql/add_languages.sql:13: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. ...output in the log file is: LOG: server process (PID 2739) was terminated by signal 10 Here's the real problem --- why are you getting a SIGBUS while trying to load the pltcl handler function? I suspect something broken in Tcl's shared library, but dunno what. You should be getting a core file from the crashed process --- can you get a stack trace from it with gdb? FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=5432001, size=3809280, 03600). This is evidently happening during attempted restart after the backend crash. I suspect it is a matter of the OS not having released the old memory segment yet, together with the SHMMAX limit being too tight to allow two such segments to exist concurrently. Are you able to start the server by hand immediately afterwards, or a few seconds afterwards? Or do you have to reboot before it will restart? regards, tom lane |
#10
| |||
| |||
|
|
It turns out that the "createlang pltcl" failure on OS X 10.3 was due to our ps_status code doing the wrong thing. I have committed a fix. regards, tom lane |
![]() |
| Thread Tools | |
| Display Modes | |
| |