[lxc-devel] lxc on ia64

Greg Kurz gkurz at fr.ibm.com
Thu Dec 1 21:30:07 UTC 2011


On Thu, 2011-12-01 at 18:23 +0200, Vadym S. Khondar wrote:
> Hello everybody.
> 

Hi,

> Not sure if I am posting on the right list with this question.
> 
> I'm interested in project status on ia64 platform.
> 

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

> The latest tar.gzs have a check within configure concerning system where 
> package is being built and ia64 is not there. Minor hack allows to 
> bypass this limitation and build succeeds. However I'm facing problems 
> running then.
> E.g. lxc-start fails with message:
> 
> lxc-start: sync wake failure : Broken pipe
> lxc-start: failed to spawn 'devel'
> 
> This happens due to child process crash with core.
> 

Yeah, something smarter than 'broken pipe' should be printed... :-\
> 
> Program terminated with signal 11, Segmentation fault.
> Core was generated by `/opt/lxc/0.7.5/bin/lxc-start -n devel -l DEBUG'
> Program terminated with signal 11, Segmentation fault.
> #0  0x20000000000751c1 in do_clone (arg=Cannot access memory at address 
> 0x60000fffff90b2f0
> ) at namespace.c:58
> 58	{
> (gdb) bt
> #0  0x20000000000751c1 in do_clone (arg=Cannot access memory at address 
> 0x60000fffff90b2f0
> ) at namespace.c:58
> #1  0x2000000000285d00 in __clone2 () from /lib/libc.so.6.1
> #2  0x0000000000000000 in ?? ()
> 
> (This goes from version built without optimisations (no -O2))
> 
> Is this solely problem of my setup or, if no, are there plans to make it 
> run on ia64? I could help with testing.
> 

Heh, ia64 is a rare and strange beast 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);

> Test platform is: Debian 6.0.3 Linux 2.6.32-5-itanium ia64
> 
> Thanks for comments in advance!
> 

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

Cheers.

-- 
Gregory Kurz                                     gkurz at fr.ibm.com
Software Engineer @ IBM/Meiosys                  http://www.ibm.com
Tel +33 (0)534 638 479                           Fax +33 (0)561 400 420

"Anarchy is about taking complete responsibility for yourself."
        Alan Moore.





More information about the lxc-devel mailing list