[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-users] Why are shared libraries loaded multiple times in a guest VM?


  • To: "Arun Babu" <arunbabu.n@xxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
  • Date: Tue, 27 Feb 2007 19:43:06 +0100
  • Delivery-date: Tue, 27 Feb 2007 10:42:53 -0800
  • List-id: Xen user discussion <xen-users.lists.xensource.com>
  • Thread-index: AcdanIBI99S6/bjTRCOjtLbyvxMKmAAAXF0g
  • Thread-topic: [Xen-users] Why are shared libraries loaded multiple times in a guest VM?

 

> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Arun Babu
> Sent: 27 February 2007 18:23
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-users] Why are shared libraries loaded multiple 
> times in a guest VM?
> 
> Hi,
>  
> I have xen 3.0.2-3 installed with linux 2.6.16.13 guests 
> running on them.
> I have a simple test program to print the address of a 
> function in a shared library (say printf) using dlopen and 
> dlsym. I ran this test on DomO and running another instance 
> of the same program (to make sure the library is still 
> loaded). Both instances print the same address (as expected). 
> But when I do this experiment on a DomU, I get different 
> addresses for the same function. Further investigation of 
> /proc/<pid>/maps shows that the same shared library is loaded 
> in different places on those two machines. Why isn't the 
> different instances of the test program refer the same shared 
> library/ why is the library loaded multiple times? 

Do I get it right that your "complaint" is that the same shared library
is loaded at different places in Dom0 and DomU? Since DomU is a
different (albeit virtual) machine, I don't see what there is to
complain about. In a real system with two different machines, you would
not complain that the shared library is in the memory of both machines,
right? Just because DomU is in the same physical machine as Dom0, it
doesn't have ANY way to actually even know that Dom0 is in the same
machine (aside from some timing aspects of running a virtual machine)
[para-virtual kernels have been modified to do things slightly
differently]. 

Obviously, if that's not what you're complaining about, sorry for
misunderstanding the "complaint"... 

The fact that the same shared library is loaded at a different address
within the virtual address range is probably something to do with what
virtual addresses are available and it may also depend on what other
shared libraries have already been loaded prior to this shared library -
shared libraries are located at "random" addresses in memory to avoid
collisions, but sometimes you get collisions anyways, and the OS will
then pick a different (free) random address. You'd probably find the
same thing if you have two different machines with slightly different
configurations and perhaps different daemons running (xend for example
will drag in a whole heap of shared libraries, both those belonging to
the python language and those built by xen). 

--
Mats
> 
> Can somebody help me reason out why this is happening in 
> guest vm? Is this because of some boot option or anything 
> specific to xen? 
> 
> Thank you
> Arun
> 
> -- 
> http://www4.ncsu.edu/~abnagara <http://www4.ncsu.edu/~abnagara>  
> 



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.