Fatal error in shared memory creation
Posted in 2000
Topics: General Discussion
When I type oninit,
it said:
Fatal error in shared memory creation
Why ?
Thanks
You need to provide more information. An excerpt from the online.log would
be a good starting place.
cfbenson wrote in message <3941C7FE.873F1F04@netvigator.com>...
>When I type oninit,
>it said:
>Fatal error in shared memory creation>
>Why ?
>
>Thanks
>
cfbenson wrote:
> When I type oninit,
> it said:
> Fatal error in shared memory creation>
> Why ?
>
> Thanks
On an internal level, the oninit process had issued a shmget() system
call, which returned a value of -1, e.g. failure. The purpose of
shmget() is to obtain a shared memory identifier, which must be unique
(or to create a shared memory segment if it does not yet exist). The
prototype for shmget() is:
int shmget(key_t key, int size, int flag);
The key value passed to shmget() is the problem. Oninit must use a key
generation method that eliminates the possibility of duplicates keys.
It includes the value of the SERVNUM configuration parameter, which
means that each instance must have a unique SERVNUM, e.g. 1, 2, 3 ...
Therefore, one reason for the error you describe, is assigning the same
SERVNUM to two instances.
A second reason for the error you describe is if the shared memory
identifier *already* exists, and the size parameter in the shmget() call
is not zero (which means the segment is to be created). This can happen
in different ways. For example if the engine is in quiescent mode and
the oninit command is then issued with no arguments; this amounts to
trying to initialize shared memory when it is already initialized.
Another situation is if, because of some glitch, an instance is shutdown
but its shared memory segment is not removed.
If you are interested in learning more about shared memory this is an
excellent reference:
"Advanced Programming in the UNIX Environment", by W. Richard
Stevens.
If you want to see what shared memory segments exist on your UNIX
system, the do a man on the ipcs command and read on.
Vic