Papers/Multi_Core기반 테스트

Concurrent Bug Patterns and How to Test Them

tomato13 2008. 7. 9. 09:49

pswlab.kaist.ac.kr/lab-orientation/concurrentbugpattern.ppt

 

1. Introduction

........

There can be two different types of bug patterns: those that involve an error introduced when implementing a design pattern that solves the problem well, and those that involve an error introduced when implementing an antipattern.

........ 

 

2.2 Code Assumed to Be Protected
- Nonatomic Operations Assumed to Be Atomic (atomic하다고 가정하였으나 실제 그렇지 못한 경우)
- Two-Stage Access Bug Pattern (Sequential flow 자체가 atomic하지 못한 경우)
- Wrong Lock or No Lock (lock/unlock 관계가 올바르지 못한 경우)
- Double-checked Locking (performance 향상을 위해서 double-checking방안을 사용하였으나 잠재적 오류가 있는 경우)


// Broken multithreaded version
// "Double-Checked Locking" idiom
class Foo {
    private Helper helper = null;
    public Helper getHelper() {
        if (helper == null) {
            synchronized(this) {
                if (helper == null) {
                    helper = new Helper();
                }
            }
        }
        return helper;
    }
 
    // other functions and members...
}


2.3 Interleaving Assumed Never to Occur
- The sleep() Bug Pattern (sleep에 의해서 interleaving을 determine할 수 있는 것은 아니다.)
- Losing a Notify Bug Pattern (notify이후 wait를 하는 경우가 발생할 수 있다.)
- Blocking or Dead Thread Bug Pattern
- A "Blocking" Critical Section Bug Pattern
- The Orphaned Thread Bug Pattern (master thread terminates abnormally....)

 

3. New Timing Heuristics for Finding Concurrent Bug Patterns
'ConTest'는 intercepting filter design pattern 방식으로 context switch에 대한 제어를 행할 수 있다.

 

4. Deducing Concurrent Bug Patterns from Design Pattern

 

5. Conclusion

.........

The introduction of bug taxonomies facilitated the search for new sequential program testing techniques. We hope that the concurrent bug pattern taxonomy will serve the same purpose for concurrent programs.

..........