[CRIU] [PATCH 5/8] dump: Add dumping of alternative signal stack
Cyrill Gorcunov
gorcunov at gmail.com
Tue Jun 18 06:25:55 EDT 2013
On Tue, Jun 18, 2013 at 05:04:52PM +0400, Andrew Vagin wrote:
> >
> > -static int parasite_init(struct parasite_ctl *ctl, pid_t pid, int nr_threads)
> > +static void copy_sas(ThreadSasEntry *dst, stack_t *src)
> > +{
> > + dst->ss_sp = encode_pointer(src->ss_sp);
> > + dst->ss_size = (u64)src->ss_size;
> > + dst->ss_flags = src->ss_flags;
>
> Do we really need to save flags?
>
> > SS_ONSTACK
> > The process is currently executing on the alternate signal
> > stack. (Note that it is not possible to change the alternate
> > signal stack if the process is currently executing on it.)
>
> I don't know why we may want to save this flags.
This flag is a part of abi and kernel has all rights to _extend_ the
values passed in this flag. Saving it won't cause any harm but may
serve us in future.
> > SS_DISABLE
> > The alternate signal stack is currently disabled.
>
> for this case we can say core->has_sas = false and don't allocate
> ThreadSasEntry
Look, we allocate memory for sas at moment when we don't know
yet if sas is present or not, and I would like to escape introducing
more complexity in a code. Thus, because this structure is quite small
lets allocate it always, it's one per process.
More information about the CRIU
mailing list