Download presentation
Presentation is loading. Please wait.
Published byKathryn Johnson Modified over 9 years ago
1
Exceptions and Mistakes CSE788 John Eisenlohr
2
Big Question How can we improve the quality of concurrent software?
3
Focus of this 788 Detecting concurrent program bugs automatically More Specific Question: How can we make this approach as effective as possible?
4
Two Answers 1)“Learning From Mistakes” : focus on the most common concurrency bugs. 2)“A Case for System Support”: Use Concurrency Exceptions to find more bugs and give more information when they are found.
5
“Learning” looks at three areas: 1)What should automatic bug detection systems be looking for? 2)How should we test concurrent software? 3)What are some features a good concurrent programming language should have?
6
“Learning” methodology Look at the bug report databases of four open source applications. Find the fixed concurrency bugs. Categorize them.
7
Generating the bug data Bug databases contain over 500,000 bugs.
8
Bug Sources Randomly selected 500 concurrency bug reports. Manually selected bugs that were caused by programmers' wrong assumptions about concurrent execution.
9
Categorizing the bugs Four Areas: Bug Pattern Manifestation Bug Fix Strategy Bug Avoidance
10
Bug Pattern Definitions
11
Atomicity Violation Example (CHECK THEN ACT)
12
Order Violation Example
13
Order Violation Example 2
14
Bug Patterns – results
15
Bug Patterns – findings
16
Bug Manifestation Definitions
17
Manifestation – Results 1
18
Manifestation – Results 2
19
Manifestation – Findings
20
Fix Strategy Definitions
21
Fix Strategy – Results
22
Fix Strategy – Findings
23
Bug Avoidance – Results
24
Bug Avoidance – Findings 1
25
Bug Avoidance – Findings 2
26
“Concurrency Exceptions” Concurrency errors should be treated as exceptions, like divide-by-zero. Make non-determinism in multi-threaded execution more manageable Improve the debugging process During development In the field
27
“Concurrency Exceptions” Propose to throw exceptions for three types of concurrency errors: 1)Sequential Consistency Violation 2)Locking Discipline Violation 3)Atomicity Violation
28
Sequential Consistenency Exception
29
Locking Discipline Exception
30
Atomicity Exception
31
Required Support for Concurrent Exceptions
32
Programming Language Support Sequential Consistency: Convey information about synchronization operations to the violation detection mechanism. Detection mechanism can determine whether the execution is guaranteed to be SC.
33
Programming Language Support Locking Language declares locks, shared data and the associations between them Exception is raised if data is accessed but thread does not hold appropriate lock.
34
Programming Language Support Atomicity Programmer specifies atomic sections of code. System determines if an execution violates this specification and throws exception
35
Delivering Exceptions Which thread should receive the exception? What are the guarantees of process state when exception is thrown?
36
Which thread? The one that is about to issue the memory operation that triggers the exception
37
State Guarantees Make multiprocessor execution fully deterministic Guarantee the state of only the thread which receives the exception
39
Did the authors of “A Case” make a convincing case? What are the advantages of throwing an exception in response to a concurrency bug
40
In “A Case”, how useful is the atomicity detection? Requires programmer to specify atomic sections of code, then checks whether the locking mechanism respects atomicity.
41
Does the proposal in “A Case” detect the most common programming errors? How about ordering violations? Should there be more effort put into automatically detecting ordering violations?
42
How useful are the results from “Learning” given the number and type of applications and the number of bugs? Should different types of applications be analyzed? More bugs? The bug database had over half a million entries, and they analyzed 105.
43
Does the bug fix in Figure 8 of “Learning” make sense?
44
Is there anything special about bugs that have been found and fixed; i.e., is this study biased towards a certain type of bug? Can you think of a better way to generate bug data? Automatic bug finders? Concurrency Exceptions?
45
Do you think the conclusions drawn by the authors of “Learning” make sense? Focus on atomicity violation and order violation. New bug-detection techniques to find order violation? Test pairs of threads instead of groups?
46
Was anything in “Learning” surprising? Most bugs are not fixed by adding or changing locks? The percentage of bugs that can be addressed by TM?
47
Of the following four categories, where should most effort be put? Automatic Bug Detection Testing techniques Concurrent Language Design Software Engineering Disciplines for Concurrent Programming
48
Should we strive for Deterministic Shared Memory Processing? How would that affect the conclusions drawn by “Learning”?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.