[CRIU] [PATCH] cr-restore: align the stack on 8-byte boundary

Cyrill Gorcunov gorcunov at openvz.org
Tue Jan 29 03:57:53 EST 2013


On Tue, Jan 29, 2013 at 09:22:17AM +0400, Pavel Emelyanov wrote:
> On 01/27/2013 09:23 AM, Alexander Kartashov wrote:
> > The section 5.2.1.2 of the AAPCS says that the stack must be 8-byte aligned
> > and this rule is broken when the thread restore_task_with_children()
> > is forked by the function fork_with_pid() since the variable ca
> > and its field stack are likely to be 4-byte aligned.
> > 
> > This patch forces 8-byte alingment of the field cr_clone_arg::stack.
> > This made the following tests pass on ARM:
> > * static/shm,
> > * static/ipc_namespace.
> > 
> > Particulary the unaligned stack results in incorrect passing
> > of the 64-bit argument to the function snprintf() in the function
> > sysctl_write_u64().
> > 
> > Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> 
> Applied.
> 
> Keep me in To/Cc when sending criu patches. This will speed things up.

Hmm, while it's safe at moment to make the alignment being 8 (even
on x86-32 it will work fine) I would appreciate if we adding some
comments in code itself next time.

Actually what it needs is the __stack attribute which should be
configured depending on architecture type we're building crtools
on. That said, let it be as is I'll clean it up once finish with
make mess.

	Cyrill


More information about the CRIU mailing list