Re: Copyovering on SIG{SEGV,BUS,..}

From: Erwin S. Andreasen (erwin@PIP.DKNET.DK)
Date: 05/01/98


On 30 Apr 1998, James Turner wrote:

> > Well, how to detect when is the shared memory not valid? Set a dirty flag
> > each time before modifying it and clear it afterwards?
>
> Nah, detect it bad by crashing.  It would break the crash

I crash more often than reboot :)

> loops... however, more subtle corruption issues might not be so easily
> avoided.  Setting a bit would work fine as well.  Can mprotect be used
> on shared memory regions?

I'm not sure - but you can detach yourself from the memory and reattach
the segment read-only. Would be slow.

> > What I do BTW, is to have functions to acquire a "named" data area in the
> > shared memory and use that as the list head for something like notes etc.
>
> I've never used any of the shm* functions before, and as I mentioned,
> my APUE got purloined long ago.  Can you post some sample code, or
> perhaps a url to more information?  The man pages are somewhat lacking
> in explaining general use (though very detailed in the myriad of options).

I'm going to mail the code to James and Mark. It's C++ if anyone wants it.

> > PS: Anyone know what Descriptor::._53::~._53(void) is supposed to be? nm
> > will not demangle it, and I have an undefined reference to it, and I can't
> > locate the demangling reference for gcc - the unmangled name is
> > _._Q210Descriptor4._53.
>
> No idea on this one.  Maybe revert a version, see what was changed?
> Looks like a destructor of some sorts, but I assume you already knew
> that.

It happened to be a missing destructor for a nested untyped structure
inside a class that had inside it a templated Array of pionteres to
another class :) Apparently, an explicit destructor was required.

 =============================================================================
Erwin Andreasen   Herlev, Denmark <erwin@pip.dknet.dk>  UNIX System Programmer
<URL:http://www.abandoned.org/drylock/>     <*>         (not speaking for) DDE
 =============================================================================


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST