25
Porting DMTCP to Mac OS X Liang Yu College of Computer and Information Science Northeastern University Boston MA 02215 Email: [email protected] Xiang Gong College of Electrical and Computer Engineering Northeastern University Boston MA 02215 Email: [email protected]

Porting dmtcp mac_slides

Embed Size (px)

Citation preview

Page 1: Porting dmtcp mac_slides

Porting DMTCP to Mac OS X

Liang Yu College of Computer and Information Science

Northeastern University Boston MA 02215

Email: [email protected]

Xiang Gong College of Electrical and Computer Engineering

Northeastern University Boston MA 02215

Email: [email protected]

Page 2: Porting dmtcp mac_slides

•  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?

Page 3: Porting dmtcp mac_slides

• Mac  is  used  extensively   • No  DMTCP  in  Mac  recently  

Why porting to Mac

Page 4: Porting dmtcp mac_slides

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?

Page 5: Porting dmtcp mac_slides

How implemented in Linux and some Unix

Page 6: Porting dmtcp mac_slides

But when it comes to Mac OS X ...

Page 7: Porting dmtcp mac_slides

In Mac Distinction in Some Commands

Page 8: Porting dmtcp mac_slides

In Mac Distinction in System Construction

Page 9: Porting dmtcp mac_slides

WHAT SHOULD WE DO?

Page 10: Porting dmtcp mac_slides

Option One :

Page 11: Porting dmtcp mac_slides

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.

Page 12: Porting dmtcp mac_slides

We feel less hope, then we try another method.

Page 13: Porting dmtcp mac_slides

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

Page 14: Porting dmtcp mac_slides

Option Two:

Page 15: Porting dmtcp mac_slides

The VMA of a Process in Details

Page 16: Porting dmtcp mac_slides

•  Find the Memory Range for the stack

A Demo

Page 17: Porting dmtcp mac_slides

•  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

Page 18: Porting dmtcp mac_slides

Quick Video Demo – Find Heap

Page 19: Porting dmtcp mac_slides

•  Considerably  Complicated  

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

Probing the Libraries

Page 20: Porting dmtcp mac_slides

VS  

What discovered during the work

Page 21: Porting dmtcp mac_slides

Enhanced Access() Usage

Page 22: Porting dmtcp mac_slides

Result of Enhanced Access()

Page 23: Porting dmtcp mac_slides

FUTURE WORK …

Page 24: Porting dmtcp mac_slides

•  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.  

Page 25: Porting dmtcp mac_slides

•  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