Porting dmtcp mac_slides

Preview:

Citation preview

Porting DMTCP to Mac OS X

Liang Yu College of Computer and Information Science

Northeastern University Boston MA 02215

Email: liangyu@ccs.neu.edu

Xiang Gong College of Electrical and Computer Engineering

Northeastern University Boston MA 02215

Email: gong.xi@ece.neu.edu

•  DMTCP  (Distributed  Mul2Threaded  Checkpoin2ng)    

•  A  tool  to  transparently  checkpoint  the  state  of  mul2ple  simultaneous  applica2ons,  including  mul2-­‐threaded  and  distributed  applica2ons.  

•  hCp://dmtcp.sourceforge.net/  

What is the DMTCP?

• Mac  is  used  extensively   • No  DMTCP  in  Mac  recently  

Why porting to Mac

What  informa2on  of  a  process  we    should  pay  aCen2on  to:    •  libraries  •  data  •  stack  •  heap  •  threads  •  open  file  descriptors  •  signal  status  •  mutexes  •  process  envrionment  

How to do that?

How implemented in Linux and some Unix

But when it comes to Mac OS X ...

In Mac Distinction in Some Commands

In Mac Distinction in System Construction

WHAT SHOULD WE DO?

Option One :

How to Construct a Linux-like Procfs in Mac OS X:

•  Is  MacFUSE  the  perfect  solu2on  for  us?  

•  MacFUSE  is  a  Mac  OS  X  implementa2on              of  the  FUSE  (File  System  in  User  Space)              mechanism.

We feel less hope, then we try another method.

Then, we roll back to the previous problem, thinking an alternative.

Option Two:

The VMA of a Process in Details

•  Find the Memory Range for the stack

A Demo

•  Signal  Func2on  

•  Sigac2on  Func2on          -­‐-­‐  If  you  use  a  global  variable  to  flag  a  signal  from                            a  signal-­‐handler  func2on,  it  should  be  of  the  special                            type  sig_atomic_t.  

•  System  Call  Abuse          -­‐-­‐  e.g.  access()  system  call.  

Different mechanisms when it comes the memory boundary

Quick Video Demo – Find Heap

•  Considerably  Complicated  

•  Right  now,  we  choose  “libc”  as  a  beginning,          and  we  make  it.  

Probing the Libraries

VS  

What discovered during the work

Enhanced Access() Usage

Result of Enhanced Access()

FUTURE WORK …

•  Using  access()  call  to  replace  sigac2on()  call  successes  in  Linux,  but  crashes  on  Mac,  need  

       to  figure  out.  

•  Enhanced  Access()  can  only  get  all  the  valid          addresses  in  a  vague  way,  without  showing          which  does  a  segment  of  memory  address                should  belongs  to.  

•  We  can  only  find  the  memory  range  of  libc,          con2nued  work  is  needed  to  find  other  libs,          if  existed.      •  The  access  right  of  each  memory  segment  is            is  also  unknown.  

•  We  would  like  to  thank  Prof.  Gene  Cooperman          for  every  instruc2ons  he  gave  to  us  and  for  the            research  spirit  he  conveyed  to  us.  

•  We  would  like  to  acknowledge  Kapil  and  Vlad,  for          the  system  knowledge  they  taught  us.  

•  Finally,  I’d  like  to  thank  Mr.  Rick,  a  classmate          in  my  another  course,  for  introducing  me  such          a  wonderful  tool  to  depict  the  sketch.  

Acknowledgments