[lxc-devel] lxc on ia64

Vadym S. Khondar vadym.khondar at hpcc.kpi.ua
Thu Dec 1 21:59:07 UTC 2011


01.12.11 23:30, Greg Kurz написав(ла):
> On Thu, 2011-12-01 at 18:23 +0200, Vadym S. Khondar wrote:
>> Hello everybody.
>>
>
> Hi,
>

>
> This sounds like you're on the right list. :)
>

>
> Heh, ia64 is a rare and strange beast

Absolutely agree!

> that uses the stack upward from
> the bottom address and downward from the upper one... Hence you must
> pass the kernel a range and not just a single address when cloning a new
> task. This is done with the clone2() syscall.
>
> As stated in clone(2):
>
> "The  __clone2() system call operates in the same way as clone(), except
>   that child_stack_base points to the lowest address of the child's stack
>   area,  and  stack_size  specifies  the  size of the stack pointed to by
>   child_stack_base."
>
> I guess something like this should fix the issue:
>
> --- a/src/lxc/namespace.c
> +++ b/src/lxc/namespace.c
> @@ -71,7 +71,7 @@ pid_t lxc_clone(int (*fn)(void *), void *arg, int
> flags)
>   	pid_t ret;
>
>   #ifdef __ia64__
> -	ret = __clone2(do_clone, stack,
> +	ret = __clone2(do_clone, stack - stack_size,
>   		       stack_size, flags | SIGCHLD,&clone_arg);
>   #else
>   	ret = clone(do_clone, stack, flags | SIGCHLD,&clone_arg);
>

Yep. I actually tried this one right after reading clone man but decided 
not to bear readers with potentially erroneous experiments :)

With such a correction my lxc dumps core somewhere in vnprinf of 
standard c library. Without any clues from actual lxc code to know at 
least from where this call happened.

Besides I tried to replace alloca() right above code snippet you've 
posted with malloc() (again after reading of manual as soon as it states 
that allocated chunk will be freed when calling function returns) with 
no luck (same core dump in vnprintf).

Also it seems that lxc-start can gdb'd only if comment out following check:

   if (lxc_check_inherited(-1))
     return -1;

within lxc_start() at start.c:631

After playing that around I've decided to write to list.

>
> Cc'ing Daniel who will be pleased to see that lxc is also being used on
> ia64 ! :)

Indeed, I'm trying to use it. It would be handy on still rather powerful 
although not new ia64 servers.

> Cheers.
>

Thanks for response.
-- 
Vadym S. Khondar,
Engineer @ HPCC




More information about the lxc-devel mailing list