| 研究生: |
陳之寬 Chih-Kuan Chen |
|---|---|
| 論文名稱: |
以 GDB 實作 XThreadDebugger-Linux(XTD-Linux)提供 Linux 平台之多執行緒除錯 |
| 指導教授: | 鄭永斌 |
| 口試委員: | |
| 學位類別: |
碩士 Master |
| 系所名稱: |
資訊電機學院 - 軟體工程研究所 Graduate Institute of Software Engineering |
| 論文出版年: | 2018 |
| 畢業學年度: | 106 |
| 語文別: | 中文 |
| 論文頁數: | 63 |
| 中文關鍵詞: | 多執行緒 、並行錯誤 、除錯 、測試 |
| 外文關鍵詞: | multi-thread, debugging, concurrency error, testing |
| 相關次數: | 點閱:13 下載:0 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
多執行緒程式在當前的多核世代中扮演著越來越重要的角色,其提供的方便性以及效能在軟體開發中已經成為不可或缺的一部分。然而雖然多執行緒程式有著大量優點,但它也容易發生並行性錯誤(concurrency error),這些錯誤特別難以避免,發現和修復,因為它們的發生取決於特定的執行緒交錯(interleaving)。並且由於參與其中的執行緒調度通常數量龐大,所以測試所有可能的交錯實務上是不可行的。同時,由於多執行緒程式固有的非確定性,引發並行錯誤和除錯這些多執行緒程序變得非常具有挑戰性。雖然在重現並行錯誤的領域Windows上已有諸多研究提供了他們各自的工具,然而在Linux平台上,卻少有研究提出此類工具。本實驗室已經實作一套運作於Windows下之多執行緒程式除錯與測試輔助工具,提供使用者對於交錯產生的控制能力以手動引發並行錯誤,並提供記錄和重放產生該並行錯誤之交錯的功能。此外,該工具也提供以窮舉測試方式替開發人員自動搜尋並記錄並行錯誤。本論文將移植該工具至Linux平台以提供對其多執行緒開發人員之支援,並實作測試來驗證該工具符合本論文所訂定之需求,同時作為未來擴充該工具時作為基本運行測試之一環。
Multi-threaded programs play an increasingly important role in the current multi-core generation. The convenience and performance multi-threaded programs provided have become integral for modern software development. However, although multi-threaded programs have a number of advantages, they are also prone to concurrency errors. These errors are particularly difficult to avoid, find and fix, because their occurrence depends on specific interleaving. And because of the large number of thread involved, it is not feasible to test all possible interleaving in practices. At the same time, due to the inherent non-determinism of multi-threaded programs, reproduce these concurrency errors and debugging multi-threaded programs becomes very challenging. Although many researches have provided their own tools in the field of reproducing concurrency error, there are few studies on such tools under Linux. Our colleagues have implemented a tool for debugging and testing multi-threaded programs under Windows, providing ability for user to control interleave and manually trigger concurrency errors, and record and/or replay the buggy interleaving to re-generate those concurrency errors. In addition, the tool also provides an exhaustive test module for developers to automatically search for and record buggy interleaving. This paper ports the tool to Linux to provide support for its multi-threaded developers, verifies that the tool meets the requirements through a series of tests and as a basic operating test for future expansion of this tool at the same time.
[1] S. Lu, S. Park, E. Seo, and Y. Zhou, "Learning from mistakes: a comprehensive study on real world concurrency bug characteristics," ACM SIGOPS Operating Systems Review, vol. 42, pp. 329-339, 2008.
[2] A. Zeller, Why programs fail: a guide to systematic debugging: Elsevier, 2009.
[3] (2009-02-15, 2018-06). Should we always reproduce the bugs to verify the fixes? Available: https://stackoverflow.com/questions/550242/should-we-always-reproduce-the-bugs-to-verify-the-fixes
[4] M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu, "Finding and Reproducing Heisenbugs in Concurrent Programs," in OSDI, 2008, pp. 267-280.
[5] J. Micco. (May 27, 2016, 2018-06). Flaky Tests at Google and How We Mitigate Them. Available: https://testing.googleblog.com/2016/05/flaky-tests-at-google-and-how-we.html
[6] (2018-06). GDB Online Document. Available: https://sourceware.org/gdb/current/onlinedocs/gdb/index.html#SEC_Contents
[7] (2018-06). Stopping and Starting Multi-thread Programs. Available: https://sourceware.org/gdb/current/onlinedocs/gdb/Thread-Stops.html#Thread-Stops
[8] X. Yuan, C. Wu, Z. Wang, J. Li, P.-C. Yew, J. Huang, et al., "ReCBuLC: reproducing concurrency bugs using local clocks," in Proceedings of the 37th International Conference on Software Engineering-Volume 1, 2015, pp. 824-834.
[9] N. Rungta, E. G. Mercer, and W. Visser, "Efficient testing of concurrent programs with abstraction-guided symbolic execution," in International SPIN Workshop on Model Checking of Software, 2009, pp. 174-191.
[10] L. M. Carril and W. F. Tichy, "Interleaving generation for data race and deadlock reproduction," in Proceedings of the 2nd International Workshop on Software Engineering for Parallel Systems, 2015, pp. 26-34.
[11] P. Anderson, "The use and limitations of static-analysis tools to improve software quality," CrossTalk: The Journal of Defense Software Engineering, vol. 21, pp. 18-21, 2008.
[12] D. Hutchins, A. Ballman, and D. Sutherland, "C/C++ thread safety analysis," in Source Code Analysis and Manipulation (SCAM), 2014 IEEE 14th International Working Conference on, 2014, pp. 41-46.
[13] C. Flanagan and P. Godefroid, "Dynamic partial-order reduction for model checking software," in ACM Sigplan Notices, 2005, pp. 110-121.
[14] P. Fonseca, C. Li, and R. Rodrigues, "Finding complex concurrency bugs in large multi-threaded applications," in Proceedings of the sixth conference on Computer systems, 2011, pp. 215-228.
[15] B. Kasikci, W. Cui, X. Ge, and B. Niu, "Lazy Diagnosis of In-Production Concurrency Bugs," in Proceedings of the 26th Symposium on Operating Systems Principles, 2017, pp. 582-598.
[16] M. Musuvathi and S. Qadeer, "Iterative context bounding for systematic testing of multithreaded programs," in ACM Sigplan Notices, 2007, pp. 446-455.
[17] C. Wang, M. Said, and A. Gupta, "Coverage guided systematic concurrency testing," in Proceedings of the 33rd International Conference on Software Engineering, 2011, pp. 221-230.
[18] P. Godefroid, "Model checking for programming languages using VeriSoft," in Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, 1997, pp. 174-186.
[19] J. Neystadt. (February 2008, 2018-06). Automated Penetration Testing with White-Box Fuzzing. Available: https://msdn.microsoft.com/en-us/library/cc162782.aspx
[20] S. Burckhardt, P. Kothari, M. Musuvathi, and S. Nagarakatte, "A randomized scheduler with probabilistic guarantees of finding bugs," in ACM Sigplan Notices, 2010, pp. 167-178.
[21] 楊權 and C. Yang, "A Testing and Debugging Tool for Arbitrary Interleaving on Multithreaded Programs Based on Debugger," 國立中央大學.
[22] (2018-06). Undo. Available: https://undo.io/
[23] N. Chatterjee, S. Majumdar, S. R. Sahoo, and P. P. Das, "Debugging multi-threaded applications using pin-augmented gdb (pgdb)," in Proceedings of the International Conference on Software Engineering Research and Practice (SERP), 2015, p. 109.
[24] Y. Eytani, K. Havelund, S. D. Stoller, and S. Ur, "Towards a framework and a benchmark for testing tools for multi‐threaded programs," Concurrency and Computation: Practice and Experience, vol. 19, pp. 267-279, 2007.