SlideShare a Scribd company logo
1 of 28
Download to read offline
Outline

          Deadlock Detection




USI-CMU summer school 2007   Natasha Sharygina   1
Actual Goal
 Deadlock for concurrent message-passing blocking
C programs


 Tackle complexity using automated abstraction and
compositional reasoning


 Obtain precise answers using automated iterative
abstraction refinement




 USI-CMU summer school 2007   Natasha Sharygina      2
For this part of the lecture
 Focus on finite state machines
  Labeled transition systems (LTSs)



 Parallel composition of state machines
  Synchronous communication
  Asynchronous execution
  Natural for modeling blocking message-passing C
  programs




USI-CMU summer school 2007   Natasha Sharygina      3
Finite LTS
      P=(Q,I, Σ,T)
        Q ≡ non-empty set of states
        I ∈ Q ≡ initial state
         Σ ≡ set of actions ≡ alphabet
        T ⊆ Q × Σ × Q ≡ transition relation

                                                       e
                             a                b


                             a                 c       d
                                            P
                             Σ(P) = {a,b,c,d,e,f}
USI-CMU summer school 2007         Natasha Sharygina       4
Concurrency


         Components communicate by handshaking (synchronizing)
         over shared actions
         Else proceed independently (asynchronously)
         Essentially CSP semantics



         Composition of A1 & A2 ≡ A1 || A2




USI-CMU summer school 2007     Natasha Sharygina            5
Deadlock

                                            d                                                    d

               a             b         c                                 a          c        b
       1                 2       3          4                       1’         2’       3’       4’

     M1 Σ = {a,b,c,d}                                          M2 Σ = {a,b,c,d}


                                            a
                                     1,1’            2,2’                    Deadlock


                                     M1 k M2
      Deadlock ⇔ a reachable state cannot perform any actions at all
USI-CMU summer school 2007                      Natasha Sharygina                                     6
Deadlock and Composition


                                                                     Deadlock
             c                                              c

                       a          b                             b        c

                                           c
                             M1                                     M2

                                                                     No Deadlock
                                      M1 || M2


USI-CMU summer school 2007              Natasha Sharygina                       7
Deadlock and Composition


                                                          No Deadlock
                                  b                           a

                             a                            b


                             M1                           M1
                                                              Deadlock
                                      M1 || M2


USI-CMU summer school 2007            Natasha Sharygina                  8
Conservative Abstraction


                                     1                                       [1]
                                 a       b                               a           b

                                 2           3                               [2,3]

                             c   d       e       f                   c       d     e     f

                       4         5       6        7                  [4,5]           [6,7]

                                     P                                       A
USI-CMU summer school 2007                       Natasha Sharygina                           9
Conservative Abstraction

          Every trace of P is a trace of A
            Preserves safety properties: A ² φ ⇒ P ² φ
            A over-approximates what P can do


          Some traces of A may not be traces of P
            May yield spurious counterexamples - h a, e i


          Eliminated via abstraction refinement
             Splitting some clusters in smaller ones
             Refinement can be automated



USI-CMU summer school 2007        Natasha Sharygina         10
Original Abstraction


                                     1                                       [1]
                                 a       b                               a           b

                                 2           3                               [2,3]

                             c   d       e       f                   c       d     e     f

                       4         5       6        7                  [4,5]           [6,7]

                                     P                                       A
USI-CMU summer school 2007                       Natasha Sharygina                           11
Refined Abstraction


                                     1                                         [1]
                                 a       b                               a             b

                                 2           3                           [2]               [3]

                             c   d       e       f                   c         d       e         f

                       4         5       6        7                  [4,5]             [6,7]

                                     P                                             A
USI-CMU summer school 2007                       Natasha Sharygina                                   12
Deadlock : Problem


          Deadlock is not preserved by abstraction



                        a              b                                      b        a
               1                2          3                             1’       2’       3’

                               M1                                                 M2


     a,b                     [1,2,3]                               a,b        [1’,2’,3’]

USI-CMU summer school 2007                     Natasha Sharygina                                13
Deadlock Detection : Insight


          Deadlock ⇔ a reachable state cannot perform any
          actions at all
                 Deadlock depends on the set of actions that a
                 reachable state cannot perform


          In order to preserve deadlock A must over-
          approximate not just what P can do but also what P
          refuses




USI-CMU summer school 2007          Natasha Sharygina            14
Refusal & Deadlock

      Ref(s) = set of actions s cannot perform

              {b}                {a}       {a,b}                               {}
                             a         b
                 1                2          3                         a,b   [1,2,3]

      M deadlocks iff there is a reachable state s such
      that Ref(s) = Σ
             Denote by DLock(M)


      Ref([s1 .. sn]) = Ref(s1) Å .. Å Ref(sn)


USI-CMU summer school 2007                         Natasha Sharygina                   15
Abstract Refusal


          AR([s1 .. sn]) = Ref(s1) ∪ .. ∪ Ref(sn)


                  {b}            {a}       {a,b}                        [a,b]
                             a         b
                     1            2          3                    a,b   [1,2,3]


          AR([M1] .. [Mn]) = AR([M1]) ∪ .. ∪ AR([Mn])




USI-CMU summer school 2007                    Natasha Sharygina                   16
Abstract Deadlock
   M abstractly deadlocks iff there is a reachable state
   s such that AR(s) = Σ
          Denote by ADLock(M)




        ¬ ADLock([M1] || .. || [Mn])
                  ⇒
          ¬ DLock(M1 || .. || Mn)
USI-CMU summer school 2007   Natasha Sharygina             17
Iterative Deadlock Detection

                        a              b                                      b           a
               1                2          3                             1’         2’        3’


                             [a,b]                                                [a,b]
     a,b                     [1,2,3]                               a,b        [1’,2’,3’]

                                                              [a,b]
     Counterexample to
         Abstract                                   [1,2,3],[1’,2’,3’]
         Deadlock
USI-CMU summer school 2007                     Natasha Sharygina                                   18
Counterexample Validation

                                                    [a,b]

                                            [1,2,3],[1’,2’,3’]


                             [a,b]                                            [a,b]
                         [1,2,3]                                             [1’,2’,3’]



             {b}
                ×               {a}       {a,b}                    {a}       {b}
                                                                                      ×   {a,b}
                        a             b                                  b         a
               1                2          3                       1’         2’           3’
USI-CMU summer school 2007                     Natasha Sharygina                                19
Refinement


                        a                 b                                         b        a
               1                   2             3                             1’       2’        3’



                       a                 b
              1                   2              3


                [b]              [a,b]           b                                        [a,b]
                             a
            [1]                          [2,3]                           a,b        [1’,2’,3’]


USI-CMU summer school 2007                           Natasha Sharygina                                 20
Counterexample Validation

                                                  [1],[1’,2’,3’]

                                                        [a,b]
                             [b]                                                 [a,b]
                              [1]                                               [1’,2’,3’]



             {b}                   {a}       {a,b}                    {a}       {b}
                                                                                         ×   {a,b}
                        a                b                                  b         a
               1                   2          3                       1’         2’           3’

        Another spurious counterexample
USI-CMU summer school 2007                        Natasha Sharygina                                21
Refinement


                        a                 b                                      b           a
               1                   2             3                        1’          2’         3’



                       a                 b                                       b           a
              1                   2              3                        1’          2’         3’


                [b]              [a,b]           b                         [a]       [a,b]       a
                             a                                                   b
            [1]                          [2,3]                           [1’]              [2’,3’]


USI-CMU summer school 2007                           Natasha Sharygina                                22
Counterexample Validation

                                                      [1],[1’]

                                                        [a,b]
                             [b]                                                [a]
                              [1]                                                [1’]



             {b}                   {a}       {a,b}                    {a}       {b}       {a,b}
                        a                b                                  b         a
               1                   2          3                       1’        2’         3’

                               Real Deadlock Detected
USI-CMU summer school 2007                        Natasha Sharygina                             23
Iterative Deadlock

                              ☺
  System                                              Model                No Abstract    Yes
                          Abstraction
Abstraction                                                                Deadlock?
                                                                                          System OK
 Guidance                                                                  No


                               Improved                                         Counterexample
                              Abstraction
                               Guidance

                                 ☺                                               ☺
                         Abstraction                                No   Counterexample    Yes
                         Refinement                                          Valid?
                                               Spurious
                                            Counterexample

 USI-CMU summer school 2007                     Natasha Sharygina                                24
Case Studies
          MicroC/OS-II
             Real-time OS for embedded applications
             Widely used (cell phones, medical devices, routers,
             washing machines…)
             6000+ LOC
  •ABB IPC Module
     –Deployed by a world leader in
     robotics
     –15000+ LOC
     –4 components
     –Over 30 billion states after
     predicate abstraction


USI-CMU summer school 2007        Natasha Sharygina                25
Results

                                  Plain                               IterDeadlock

     Name                    St    T      Mem                  St    It          T     Mem


      ABB                    *      *     162             1973      861        1446    33.3

       SSL              25731      44     43.5                 16   16          31.9   40.8

     μCD-3                   *      *     58.6            4930      120        221.8   15

     μCN-6                   *      *     219.3          71875      44          813    30.8

     DPN-6                   *      *     203            62426      48          831    26.1

    DPD-10              38268     87.6    17.3           44493      51          755    18.4



    * indicates out of time limit (1500s)
USI-CMU summer school 2007                 Natasha Sharygina                             26
Results

                                  Plain                               IterDeadlock

     Name                    St    T      Mem                  St    It          T     Mem


      ABB                    *      *     162             1973      861        1446    33.3

       SSL              25731      44     43.5                 16   16          31.9   40.8

     μCD-3                   *      *     58.6            4930      120        221.8   15

     μCN-6                   *      *     219.3          71875      44          813    30.8

     DPN-6                   *      *     203            62426      48          831    26.1

    DPD-10              38268     87.6    17.3           44493      51          755    18.4




USI-CMU summer school 2007                 Natasha Sharygina                             27
References
    Sagar Chaki, Edmund M. Clarke, Joël Ouaknine,
    Natasha Sharygina: Concurrent software verification
    with states, events, and deadlocks. Formal Aspects
    of Computing 17(4): 461-483 (2005)


    Chiara Braghin, Natasha Sharygina, Katerina Barone-
    Adesi: Automated Verification of Security Policies in
    Mobile Code, In Proc. of Integrated Formal Methods
    2007 conf., LNCS 4591:37 - 54 (2007)




USI-CMU summer school 2007   Natasha Sharygina          28

More Related Content

Viewers also liked

20111202 machine learning_nikolenko_lecture08
20111202 machine learning_nikolenko_lecture0820111202 machine learning_nikolenko_lecture08
20111202 machine learning_nikolenko_lecture08Computer Science Club
 
20111023 computer graphics_galinsky_lecture06_curves
20111023 computer graphics_galinsky_lecture06_curves20111023 computer graphics_galinsky_lecture06_curves
20111023 computer graphics_galinsky_lecture06_curvesComputer Science Club
 
20080502 software verification_sharygina_lecture03
20080502 software verification_sharygina_lecture0320080502 software verification_sharygina_lecture03
20080502 software verification_sharygina_lecture03Computer Science Club
 
20101017 program analysis_for_security_livshits_lecture04_nozzle
20101017 program analysis_for_security_livshits_lecture04_nozzle20101017 program analysis_for_security_livshits_lecture04_nozzle
20101017 program analysis_for_security_livshits_lecture04_nozzleComputer Science Club
 
20101017 program analysis_for_security_livshits_lecture03_security
20101017 program analysis_for_security_livshits_lecture03_security20101017 program analysis_for_security_livshits_lecture03_security
20101017 program analysis_for_security_livshits_lecture03_securityComputer Science Club
 
20080302 cryptography hirsch_lecture03
20080302 cryptography hirsch_lecture0320080302 cryptography hirsch_lecture03
20080302 cryptography hirsch_lecture03Computer Science Club
 
20100307 virtualization igotti_lecture04
20100307 virtualization igotti_lecture0420100307 virtualization igotti_lecture04
20100307 virtualization igotti_lecture04Computer Science Club
 
20091129 algorithmsfornphardproblems kulikov_lecture10
20091129 algorithmsfornphardproblems kulikov_lecture1020091129 algorithmsfornphardproblems kulikov_lecture10
20091129 algorithmsfornphardproblems kulikov_lecture10Computer Science Club
 
20100314 virtualization igotti_lecture07
20100314 virtualization igotti_lecture0720100314 virtualization igotti_lecture07
20100314 virtualization igotti_lecture07Computer Science Club
 
20091101 algorithmsfornphardproblems kulikov_lecture06
20091101 algorithmsfornphardproblems kulikov_lecture0620091101 algorithmsfornphardproblems kulikov_lecture06
20091101 algorithmsfornphardproblems kulikov_lecture06Computer Science Club
 
20090315 hardnessvsrandomness itsykson_lecture03
20090315 hardnessvsrandomness itsykson_lecture0320090315 hardnessvsrandomness itsykson_lecture03
20090315 hardnessvsrandomness itsykson_lecture03Computer Science Club
 
20120415 videorecognition konushin_lecture05
20120415 videorecognition konushin_lecture0520120415 videorecognition konushin_lecture05
20120415 videorecognition konushin_lecture05Computer Science Club
 
20110306 systems of_typed_lambda_calculi_moskvin_lecture04
20110306 systems of_typed_lambda_calculi_moskvin_lecture0420110306 systems of_typed_lambda_calculi_moskvin_lecture04
20110306 systems of_typed_lambda_calculi_moskvin_lecture04Computer Science Club
 
20110409 quantum algorithms_vyali_lecture07
20110409 quantum algorithms_vyali_lecture0720110409 quantum algorithms_vyali_lecture07
20110409 quantum algorithms_vyali_lecture07Computer Science Club
 

Viewers also liked (15)

20111202 machine learning_nikolenko_lecture08
20111202 machine learning_nikolenko_lecture0820111202 machine learning_nikolenko_lecture08
20111202 machine learning_nikolenko_lecture08
 
20111023 computer graphics_galinsky_lecture06_curves
20111023 computer graphics_galinsky_lecture06_curves20111023 computer graphics_galinsky_lecture06_curves
20111023 computer graphics_galinsky_lecture06_curves
 
20080502 software verification_sharygina_lecture03
20080502 software verification_sharygina_lecture0320080502 software verification_sharygina_lecture03
20080502 software verification_sharygina_lecture03
 
20101017 program analysis_for_security_livshits_lecture04_nozzle
20101017 program analysis_for_security_livshits_lecture04_nozzle20101017 program analysis_for_security_livshits_lecture04_nozzle
20101017 program analysis_for_security_livshits_lecture04_nozzle
 
20101003 ontology konev_lecture09
20101003 ontology konev_lecture0920101003 ontology konev_lecture09
20101003 ontology konev_lecture09
 
20101017 program analysis_for_security_livshits_lecture03_security
20101017 program analysis_for_security_livshits_lecture03_security20101017 program analysis_for_security_livshits_lecture03_security
20101017 program analysis_for_security_livshits_lecture03_security
 
20080302 cryptography hirsch_lecture03
20080302 cryptography hirsch_lecture0320080302 cryptography hirsch_lecture03
20080302 cryptography hirsch_lecture03
 
20100307 virtualization igotti_lecture04
20100307 virtualization igotti_lecture0420100307 virtualization igotti_lecture04
20100307 virtualization igotti_lecture04
 
20091129 algorithmsfornphardproblems kulikov_lecture10
20091129 algorithmsfornphardproblems kulikov_lecture1020091129 algorithmsfornphardproblems kulikov_lecture10
20091129 algorithmsfornphardproblems kulikov_lecture10
 
20100314 virtualization igotti_lecture07
20100314 virtualization igotti_lecture0720100314 virtualization igotti_lecture07
20100314 virtualization igotti_lecture07
 
20091101 algorithmsfornphardproblems kulikov_lecture06
20091101 algorithmsfornphardproblems kulikov_lecture0620091101 algorithmsfornphardproblems kulikov_lecture06
20091101 algorithmsfornphardproblems kulikov_lecture06
 
20090315 hardnessvsrandomness itsykson_lecture03
20090315 hardnessvsrandomness itsykson_lecture0320090315 hardnessvsrandomness itsykson_lecture03
20090315 hardnessvsrandomness itsykson_lecture03
 
20120415 videorecognition konushin_lecture05
20120415 videorecognition konushin_lecture0520120415 videorecognition konushin_lecture05
20120415 videorecognition konushin_lecture05
 
20110306 systems of_typed_lambda_calculi_moskvin_lecture04
20110306 systems of_typed_lambda_calculi_moskvin_lecture0420110306 systems of_typed_lambda_calculi_moskvin_lecture04
20110306 systems of_typed_lambda_calculi_moskvin_lecture04
 
20110409 quantum algorithms_vyali_lecture07
20110409 quantum algorithms_vyali_lecture0720110409 quantum algorithms_vyali_lecture07
20110409 quantum algorithms_vyali_lecture07
 

More from Computer Science Club

20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugsComputer Science Club
 
20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugsComputer Science Club
 
20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugsComputer Science Club
 
20140511 parallel programming_kalishenko_lecture12
20140511 parallel programming_kalishenko_lecture1220140511 parallel programming_kalishenko_lecture12
20140511 parallel programming_kalishenko_lecture12Computer Science Club
 
20140427 parallel programming_zlobin_lecture11
20140427 parallel programming_zlobin_lecture1120140427 parallel programming_zlobin_lecture11
20140427 parallel programming_zlobin_lecture11Computer Science Club
 
20140420 parallel programming_kalishenko_lecture10
20140420 parallel programming_kalishenko_lecture1020140420 parallel programming_kalishenko_lecture10
20140420 parallel programming_kalishenko_lecture10Computer Science Club
 
20140413 parallel programming_kalishenko_lecture09
20140413 parallel programming_kalishenko_lecture0920140413 parallel programming_kalishenko_lecture09
20140413 parallel programming_kalishenko_lecture09Computer Science Club
 
20140329 graph drawing_dainiak_lecture02
20140329 graph drawing_dainiak_lecture0220140329 graph drawing_dainiak_lecture02
20140329 graph drawing_dainiak_lecture02Computer Science Club
 
20140329 graph drawing_dainiak_lecture01
20140329 graph drawing_dainiak_lecture0120140329 graph drawing_dainiak_lecture01
20140329 graph drawing_dainiak_lecture01Computer Science Club
 
20140310 parallel programming_kalishenko_lecture03-04
20140310 parallel programming_kalishenko_lecture03-0420140310 parallel programming_kalishenko_lecture03-04
20140310 parallel programming_kalishenko_lecture03-04Computer Science Club
 
20140216 parallel programming_kalishenko_lecture01
20140216 parallel programming_kalishenko_lecture0120140216 parallel programming_kalishenko_lecture01
20140216 parallel programming_kalishenko_lecture01Computer Science Club
 

More from Computer Science Club (20)

20141223 kuznetsov distributed
20141223 kuznetsov distributed20141223 kuznetsov distributed
20141223 kuznetsov distributed
 
Computer Vision
Computer VisionComputer Vision
Computer Vision
 
20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs
 
20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs
 
20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs
 
20140511 parallel programming_kalishenko_lecture12
20140511 parallel programming_kalishenko_lecture1220140511 parallel programming_kalishenko_lecture12
20140511 parallel programming_kalishenko_lecture12
 
20140427 parallel programming_zlobin_lecture11
20140427 parallel programming_zlobin_lecture1120140427 parallel programming_zlobin_lecture11
20140427 parallel programming_zlobin_lecture11
 
20140420 parallel programming_kalishenko_lecture10
20140420 parallel programming_kalishenko_lecture1020140420 parallel programming_kalishenko_lecture10
20140420 parallel programming_kalishenko_lecture10
 
20140413 parallel programming_kalishenko_lecture09
20140413 parallel programming_kalishenko_lecture0920140413 parallel programming_kalishenko_lecture09
20140413 parallel programming_kalishenko_lecture09
 
20140329 graph drawing_dainiak_lecture02
20140329 graph drawing_dainiak_lecture0220140329 graph drawing_dainiak_lecture02
20140329 graph drawing_dainiak_lecture02
 
20140329 graph drawing_dainiak_lecture01
20140329 graph drawing_dainiak_lecture0120140329 graph drawing_dainiak_lecture01
20140329 graph drawing_dainiak_lecture01
 
20140310 parallel programming_kalishenko_lecture03-04
20140310 parallel programming_kalishenko_lecture03-0420140310 parallel programming_kalishenko_lecture03-04
20140310 parallel programming_kalishenko_lecture03-04
 
20140223-SuffixTrees-lecture01-03
20140223-SuffixTrees-lecture01-0320140223-SuffixTrees-lecture01-03
20140223-SuffixTrees-lecture01-03
 
20140216 parallel programming_kalishenko_lecture01
20140216 parallel programming_kalishenko_lecture0120140216 parallel programming_kalishenko_lecture01
20140216 parallel programming_kalishenko_lecture01
 
20131106 h10 lecture6_matiyasevich
20131106 h10 lecture6_matiyasevich20131106 h10 lecture6_matiyasevich
20131106 h10 lecture6_matiyasevich
 
20131027 h10 lecture5_matiyasevich
20131027 h10 lecture5_matiyasevich20131027 h10 lecture5_matiyasevich
20131027 h10 lecture5_matiyasevich
 
20131027 h10 lecture5_matiyasevich
20131027 h10 lecture5_matiyasevich20131027 h10 lecture5_matiyasevich
20131027 h10 lecture5_matiyasevich
 
20131013 h10 lecture4_matiyasevich
20131013 h10 lecture4_matiyasevich20131013 h10 lecture4_matiyasevich
20131013 h10 lecture4_matiyasevich
 
20131006 h10 lecture3_matiyasevich
20131006 h10 lecture3_matiyasevich20131006 h10 lecture3_matiyasevich
20131006 h10 lecture3_matiyasevich
 
20131006 h10 lecture3_matiyasevich
20131006 h10 lecture3_matiyasevich20131006 h10 lecture3_matiyasevich
20131006 h10 lecture3_matiyasevich
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

20080502 software verification_sharygina_lecture04

  • 1. Outline Deadlock Detection USI-CMU summer school 2007 Natasha Sharygina 1
  • 2. Actual Goal Deadlock for concurrent message-passing blocking C programs Tackle complexity using automated abstraction and compositional reasoning Obtain precise answers using automated iterative abstraction refinement USI-CMU summer school 2007 Natasha Sharygina 2
  • 3. For this part of the lecture Focus on finite state machines Labeled transition systems (LTSs) Parallel composition of state machines Synchronous communication Asynchronous execution Natural for modeling blocking message-passing C programs USI-CMU summer school 2007 Natasha Sharygina 3
  • 4. Finite LTS P=(Q,I, Σ,T) Q ≡ non-empty set of states I ∈ Q ≡ initial state Σ ≡ set of actions ≡ alphabet T ⊆ Q × Σ × Q ≡ transition relation e a b a c d P Σ(P) = {a,b,c,d,e,f} USI-CMU summer school 2007 Natasha Sharygina 4
  • 5. Concurrency Components communicate by handshaking (synchronizing) over shared actions Else proceed independently (asynchronously) Essentially CSP semantics Composition of A1 & A2 ≡ A1 || A2 USI-CMU summer school 2007 Natasha Sharygina 5
  • 6. Deadlock d d a b c a c b 1 2 3 4 1’ 2’ 3’ 4’ M1 Σ = {a,b,c,d} M2 Σ = {a,b,c,d} a 1,1’ 2,2’ Deadlock M1 k M2 Deadlock ⇔ a reachable state cannot perform any actions at all USI-CMU summer school 2007 Natasha Sharygina 6
  • 7. Deadlock and Composition Deadlock c c a b b c c M1 M2 No Deadlock M1 || M2 USI-CMU summer school 2007 Natasha Sharygina 7
  • 8. Deadlock and Composition No Deadlock b a a b M1 M1 Deadlock M1 || M2 USI-CMU summer school 2007 Natasha Sharygina 8
  • 9. Conservative Abstraction 1 [1] a b a b 2 3 [2,3] c d e f c d e f 4 5 6 7 [4,5] [6,7] P A USI-CMU summer school 2007 Natasha Sharygina 9
  • 10. Conservative Abstraction Every trace of P is a trace of A Preserves safety properties: A ² φ ⇒ P ² φ A over-approximates what P can do Some traces of A may not be traces of P May yield spurious counterexamples - h a, e i Eliminated via abstraction refinement Splitting some clusters in smaller ones Refinement can be automated USI-CMU summer school 2007 Natasha Sharygina 10
  • 11. Original Abstraction 1 [1] a b a b 2 3 [2,3] c d e f c d e f 4 5 6 7 [4,5] [6,7] P A USI-CMU summer school 2007 Natasha Sharygina 11
  • 12. Refined Abstraction 1 [1] a b a b 2 3 [2] [3] c d e f c d e f 4 5 6 7 [4,5] [6,7] P A USI-CMU summer school 2007 Natasha Sharygina 12
  • 13. Deadlock : Problem Deadlock is not preserved by abstraction a b b a 1 2 3 1’ 2’ 3’ M1 M2 a,b [1,2,3] a,b [1’,2’,3’] USI-CMU summer school 2007 Natasha Sharygina 13
  • 14. Deadlock Detection : Insight Deadlock ⇔ a reachable state cannot perform any actions at all Deadlock depends on the set of actions that a reachable state cannot perform In order to preserve deadlock A must over- approximate not just what P can do but also what P refuses USI-CMU summer school 2007 Natasha Sharygina 14
  • 15. Refusal & Deadlock Ref(s) = set of actions s cannot perform {b} {a} {a,b} {} a b 1 2 3 a,b [1,2,3] M deadlocks iff there is a reachable state s such that Ref(s) = Σ Denote by DLock(M) Ref([s1 .. sn]) = Ref(s1) Å .. Å Ref(sn) USI-CMU summer school 2007 Natasha Sharygina 15
  • 16. Abstract Refusal AR([s1 .. sn]) = Ref(s1) ∪ .. ∪ Ref(sn) {b} {a} {a,b} [a,b] a b 1 2 3 a,b [1,2,3] AR([M1] .. [Mn]) = AR([M1]) ∪ .. ∪ AR([Mn]) USI-CMU summer school 2007 Natasha Sharygina 16
  • 17. Abstract Deadlock M abstractly deadlocks iff there is a reachable state s such that AR(s) = Σ Denote by ADLock(M) ¬ ADLock([M1] || .. || [Mn]) ⇒ ¬ DLock(M1 || .. || Mn) USI-CMU summer school 2007 Natasha Sharygina 17
  • 18. Iterative Deadlock Detection a b b a 1 2 3 1’ 2’ 3’ [a,b] [a,b] a,b [1,2,3] a,b [1’,2’,3’] [a,b] Counterexample to Abstract [1,2,3],[1’,2’,3’] Deadlock USI-CMU summer school 2007 Natasha Sharygina 18
  • 19. Counterexample Validation [a,b] [1,2,3],[1’,2’,3’] [a,b] [a,b] [1,2,3] [1’,2’,3’] {b} × {a} {a,b} {a} {b} × {a,b} a b b a 1 2 3 1’ 2’ 3’ USI-CMU summer school 2007 Natasha Sharygina 19
  • 20. Refinement a b b a 1 2 3 1’ 2’ 3’ a b 1 2 3 [b] [a,b] b [a,b] a [1] [2,3] a,b [1’,2’,3’] USI-CMU summer school 2007 Natasha Sharygina 20
  • 21. Counterexample Validation [1],[1’,2’,3’] [a,b] [b] [a,b] [1] [1’,2’,3’] {b} {a} {a,b} {a} {b} × {a,b} a b b a 1 2 3 1’ 2’ 3’ Another spurious counterexample USI-CMU summer school 2007 Natasha Sharygina 21
  • 22. Refinement a b b a 1 2 3 1’ 2’ 3’ a b b a 1 2 3 1’ 2’ 3’ [b] [a,b] b [a] [a,b] a a b [1] [2,3] [1’] [2’,3’] USI-CMU summer school 2007 Natasha Sharygina 22
  • 23. Counterexample Validation [1],[1’] [a,b] [b] [a] [1] [1’] {b} {a} {a,b} {a} {b} {a,b} a b b a 1 2 3 1’ 2’ 3’ Real Deadlock Detected USI-CMU summer school 2007 Natasha Sharygina 23
  • 24. Iterative Deadlock ☺ System Model No Abstract Yes Abstraction Abstraction Deadlock? System OK Guidance No Improved Counterexample Abstraction Guidance ☺ ☺ Abstraction No Counterexample Yes Refinement Valid? Spurious Counterexample USI-CMU summer school 2007 Natasha Sharygina 24
  • 25. Case Studies MicroC/OS-II Real-time OS for embedded applications Widely used (cell phones, medical devices, routers, washing machines…) 6000+ LOC •ABB IPC Module –Deployed by a world leader in robotics –15000+ LOC –4 components –Over 30 billion states after predicate abstraction USI-CMU summer school 2007 Natasha Sharygina 25
  • 26. Results Plain IterDeadlock Name St T Mem St It T Mem ABB * * 162 1973 861 1446 33.3 SSL 25731 44 43.5 16 16 31.9 40.8 μCD-3 * * 58.6 4930 120 221.8 15 μCN-6 * * 219.3 71875 44 813 30.8 DPN-6 * * 203 62426 48 831 26.1 DPD-10 38268 87.6 17.3 44493 51 755 18.4 * indicates out of time limit (1500s) USI-CMU summer school 2007 Natasha Sharygina 26
  • 27. Results Plain IterDeadlock Name St T Mem St It T Mem ABB * * 162 1973 861 1446 33.3 SSL 25731 44 43.5 16 16 31.9 40.8 μCD-3 * * 58.6 4930 120 221.8 15 μCN-6 * * 219.3 71875 44 813 30.8 DPN-6 * * 203 62426 48 831 26.1 DPD-10 38268 87.6 17.3 44493 51 755 18.4 USI-CMU summer school 2007 Natasha Sharygina 27
  • 28. References Sagar Chaki, Edmund M. Clarke, Joël Ouaknine, Natasha Sharygina: Concurrent software verification with states, events, and deadlocks. Formal Aspects of Computing 17(4): 461-483 (2005) Chiara Braghin, Natasha Sharygina, Katerina Barone- Adesi: Automated Verification of Security Policies in Mobile Code, In Proc. of Integrated Formal Methods 2007 conf., LNCS 4591:37 - 54 (2007) USI-CMU summer school 2007 Natasha Sharygina 28