1 / 18

Static Data Race detection for Concurrent Programs with Asynchronous Calls Presenter:

Static Data Race detection for Concurrent Programs with Asynchronous Calls Presenter: M. Amin Alipour Software Design Laboratory http://asd.cs.mtu.edu malipour@mtu.edu. Outline. Introduction Problem Statement Main Contribution Solution Experimental Results. Introduction. Data Race:

meda
Download Presentation

Static Data Race detection for Concurrent Programs with Asynchronous Calls Presenter:

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. Static Data Race detection for Concurrent Programs with Asynchronous Calls Presenter: M. Amin Alipour Software Design Laboratory http://asd.cs.mtu.edu malipour@mtu.edu

  2. Outline • Introduction • Problem Statement • Main Contribution • Solution • Experimental Results

  3. Introduction • Data Race: • When there is multiple threads access a shared data and at least one of them write.

  4. Static Data Race Detection • Given source code of a program determine the possible places that race may occur.

  5. Detection Criteria • Soundness • Preserving every real data race • Accuracy • Keeping the bogus warning low • Scalability • Being efficient in large programs

  6. Subtleties with Static Detection • Asynchronous Function Call • Recursion • Accuracy int h1 (int x) { return x * x; } int h2 (int y) { return y + y;} struct funcType { int (*func) (int); } void f (int x, funcType *g, int *z) { l2: if ( x > 0) { *z = *(g->func) (x); } l3: else { *z = *(g->func) (-x); } } int main () { struct funcType ft; int a, b, p1, p2, z; struct thread t1, t2; .... if (p1) { ft.func = &h1; l0: fork (t1, f, a, ft, &z); join (t1); } ... if (p2) { ft.func = &h2; l1: fork (t2, f, b, ft, &z); join (t2);

  7. Main Contribution • An improvement to • Emami, M., Ghiya, R., and Hendren, L. J. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation.

  8. Classical Approach • 1- Identify shared variables • 2- Enumerate control location • 3- Determine lockset (set of locks held on all accesses to data at the location) • 4- Determine possible race locations, by lockset analysis (Empty lockset indicates possible data races) • 5- Prune results in Step 4

  9. Concurrent Control Flow Graph

  10. Unrolled CCFG Example • Emami and et al’s CCFG

  11. Strategy to explore CCFG • Unroll CCFG until no new data flow tuple D=(A,L) visited. • A is set of aliases • L is Lockset • Would CCFG be finite? • Yes, the worst case is O(|F||P|2|P| 2|L| ) • |F| number of functions • |P| number of functions cardinality of Steensgaard’s pointers set • |L| set of locks

  12. Assumptions • The algorithm uses Steensgard’s algorithm for points-to analysis, which results possible pointers that may point to same objects (variable or function) • The algorithm assumes that number of statements affecting locks,functions and threads are small.

  13. Pruning the result • It uses a thread order analysis to remove any warning wherein the program location pairs that do not occur.

  14. Pruning algorithm

  15. Concurrent call graph int h1 (int x) { return x * x; } int h2 (int y) { return y + y;} struct funcType { int (*func) (int); } void f (int x, funcType *g, int *z) { l2: if ( x > 0) { *z = *(g->func) (x); } l3: else { *z = *(g->func) (-x); } } int main () { struct funcType ft; int a, b, p1, p2, z; struct thread t1, t2; .... if (p1) { ft.func = &h1; l0: fork (t1, f, a, ft, &z); join (t1); } ... if (p2) { ft.func = &h2; l1: fork (t2, f, b, ft, &z); join (t2);

  16. Experimental Results

  17. References • . V. Kahlon, N, Sinha, Y. Zhang and E. Kruus.“Static Data Race Detection for Concurrent Programs Asynchronous Calls” The 7th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (FSE), Amsterdam, The Netherlands. August 2009.

More Related