{"title":"通过测试和分类确定数据竞争","authors":"Marc Hartung, F. Schintke, T. Schütt","doi":"10.1109/ISSREW.2019.00100","DOIUrl":null,"url":null,"abstract":"Data races, i.e. the uncoordinated read/write access of threads to a shared variable resulting in unexpected program behaviour, in parallel shared memory programs occur highly dependent on the timing and scheduling of threads during execution. This makes data races hard to detect manually and automatically. Corresponding tools typically suspect too many code locations to cause data races and miss critical ones as the observed execution and timing did not raise them. We present methods and a tool chain for C/C++ codes with POSIX threads to detect data races and verify their harmfulness. We use automatic instrumentation and repeated test-case execution using a user-space thread scheduler overriding the kernel-space scheduler to intentionally generate specific thread interleavings. As the thread scheduling becomes deterministic and independent from the system in use, targeted testing of thread schedules can reveal and verify otherwise hard to find data races. For each data race we classify its harmfulness based on well-defined attributes and can in most cases identify and report its root cause, i.e. the data race which, when fixed, protects the program from crashing. This and a low false positive rate in the reports greatly reduces the overhead in fixing data races for developers.","PeriodicalId":166239,"journal":{"name":"2019 IEEE International Symposium on Software Reliability Engineering Workshops (ISSREW)","volume":"42 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":"{\"title\":\"Pinpoint Data Races via Testing and Classification\",\"authors\":\"Marc Hartung, F. Schintke, T. Schütt\",\"doi\":\"10.1109/ISSREW.2019.00100\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Data races, i.e. the uncoordinated read/write access of threads to a shared variable resulting in unexpected program behaviour, in parallel shared memory programs occur highly dependent on the timing and scheduling of threads during execution. This makes data races hard to detect manually and automatically. Corresponding tools typically suspect too many code locations to cause data races and miss critical ones as the observed execution and timing did not raise them. We present methods and a tool chain for C/C++ codes with POSIX threads to detect data races and verify their harmfulness. We use automatic instrumentation and repeated test-case execution using a user-space thread scheduler overriding the kernel-space scheduler to intentionally generate specific thread interleavings. As the thread scheduling becomes deterministic and independent from the system in use, targeted testing of thread schedules can reveal and verify otherwise hard to find data races. For each data race we classify its harmfulness based on well-defined attributes and can in most cases identify and report its root cause, i.e. the data race which, when fixed, protects the program from crashing. This and a low false positive rate in the reports greatly reduces the overhead in fixing data races for developers.\",\"PeriodicalId\":166239,\"journal\":{\"name\":\"2019 IEEE International Symposium on Software Reliability Engineering Workshops (ISSREW)\",\"volume\":\"42 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2019-10-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"2\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2019 IEEE International Symposium on Software Reliability Engineering Workshops (ISSREW)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/ISSREW.2019.00100\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 IEEE International Symposium on Software Reliability Engineering Workshops (ISSREW)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ISSREW.2019.00100","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Pinpoint Data Races via Testing and Classification
Data races, i.e. the uncoordinated read/write access of threads to a shared variable resulting in unexpected program behaviour, in parallel shared memory programs occur highly dependent on the timing and scheduling of threads during execution. This makes data races hard to detect manually and automatically. Corresponding tools typically suspect too many code locations to cause data races and miss critical ones as the observed execution and timing did not raise them. We present methods and a tool chain for C/C++ codes with POSIX threads to detect data races and verify their harmfulness. We use automatic instrumentation and repeated test-case execution using a user-space thread scheduler overriding the kernel-space scheduler to intentionally generate specific thread interleavings. As the thread scheduling becomes deterministic and independent from the system in use, targeted testing of thread schedules can reveal and verify otherwise hard to find data races. For each data race we classify its harmfulness based on well-defined attributes and can in most cases identify and report its root cause, i.e. the data race which, when fixed, protects the program from crashing. This and a low false positive rate in the reports greatly reduces the overhead in fixing data races for developers.