1 / 11

Bernd Fischer 1 , Omar Inverso 2 , Gennaro Parlato 2 1 Stellenbosch University, South Africa

CSeq : A Concurrency Pre-processor for Sequential C Verification Tools. Bernd Fischer 1 , Omar Inverso 2 , Gennaro Parlato 2 1 Stellenbosch University, South Africa 2 University of Southampton, United Kingdom. Sequentialization of Concurrent Programs. Basic Idea : General Approach:

arion
Download Presentation

Bernd Fischer 1 , Omar Inverso 2 , Gennaro Parlato 2 1 Stellenbosch University, South Africa

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSeq: A Concurrency Pre-processor for Sequential C Verification Tools • Bernd Fischer1, Omar Inverso2, Gennaro Parlato2 • 1 Stellenbosch University, South Africa • 2 University of Southampton, United Kingdom

  2. Sequentialization of Concurrent Programs Basic Idea: General Approach: • replace the program’s control non-determinismby data non-determinism • P' simulates all computations (within certain bounds) of P • P' only requires sequential analysis • source-to-source transformation: T₁ ∥ T₂ ↝ T̕₁ ;T̕₂ ; C • allows direct re-use of existing sequential verification tools • checker C resolves non-determinism convert concurrent programs into sequential programs such that reachability is preserved

  3. Lal/Reps Sequentialization • considers only round-robin scheduleswith k rounds ... ... ... ... ... T0 T1 Tn

  4. Lal/Reps Sequentialization ... • considers only round-robin scheduleswith k rounds • thread → function, run to completion ... ... ... ... ... T0 T1 Tn

  5. Lal/Reps Sequentialization ... • considers only round-robin scheduleswith k rounds • thread → function, run to completion • global memory copy for each round • scalar → array ... S0,0 S0,1 S0,n ... S1,0 S1,1 S1,n ... S2,0 S2,1 S2,n ... ... Sk,0 Sk,1 Sk,n T0 T1 Tn

  6. Lal/Reps Sequentialization ... • considers only round-robin scheduleswith k rounds • thread → function, run to completion • global memory copy for each round • scalar → array • context switch → round counter++ ... S0,0 S0,1 S0,n ... S1,0 S1,1 S1,n ... S2,0 S2,1 S2,n ... ... Sk,0 Sk,1 Sk,n T0 T1 Tn

  7. Lal/Reps Sequentialization ... • considers only round-robin scheduleswith k rounds • thread → function, run to completion • global memory copy for each round • scalar → array • context switch → round counter++ • first thread starts with non-deterministic memory contents • other threads continue with content left by predecessor ... S0,0 S0,1 S0,n ... S1,0 S1,1 S1,n ... S2,0 S2,1 S2,n ... ... Sk,0 Sk,1 Sk,n T0 T1 Tn

  8. Lal/Reps Sequentialization ... • considers only round-robin scheduleswith k rounds • thread → function, run to completion • global memory copy for each round • scalar → array • context switch → round counter++ • first thread starts with non-deterministic memory contents • other threads continue with content left by predecessor • checker prunes away inconsistent simulations • assume(Sk+1,0 ==Sk,n); • requires second set of memory copies • errors can only be checked at end of simulation • requires explicit error checks ... S0,0 S0,1 S0,n ... S1,0 S1,1 S1,n ... S2,0 S2,1 S2,n ... ... Sk,0 Sk,1 Sk,n T0 T1 Tn

  9. CSeq Tool Architecture • pycparser, AST traversal with unparsing • insert new type declarations, modify memory accesses • insert context switch simulation code at each sequence point • insert explicit error checks • insert checker and boilerplate code for pthread functions k, N sequential non-deterministic C program concurrent C program CSeq SAFE UNSAFE sequential tool P P'

  10. CSeq Tool Architecture • pycparser, AST traversal with unparsing • insert new type declarations, modify memory accesses • insert context switch simulation code at each sequence point • insert explicit error checks • insert checker and boilerplate code for pthread functions SAFE UNSAFE k, N CBMC concurrent C program CSeq SAFE UNSAFE ESBMC P SAFE UNSAFE LLBMC format

  11. Performance and Availability • overall performanceroughly equal to BMC withnative concurrency handling • typically ~30-100% penalty • varies with backends • LLBMC very slow • some benchmarks faster • faster than ESBMC’s explicit schedule exploration • much faster version alreadyunder development • CSeq download at http://users.ecs.soton.ac.uk/gp4/cseq.html

More Related