首页> 外文会议>Principles of programming languages >Dynamically Checking Ownership Policies in Concurrent C/C++ Programs
【24h】

Dynamically Checking Ownership Policies in Concurrent C/C++ Programs

机译:在并行C / C ++程序中动态检查所有权策略

获取原文
获取原文并翻译 | 示例

摘要

Concurrent programming errors arise when threads share data incorrectly. Programmers often avoid these errors by using synchronization to enforce a simple ownership policy: data is either owned exclusively by a thread that can read or write the data, or it is read owned by a set of threads that can read but not write the data. Unfortunately, incorrect synchronization often fails to enforce these policies and memory errors in languages like C and C++ can violate these policies even when synchronization is correct.rnIn this paper, we present a dynamic analysis for checking ownership policies in concurrent C and C++ programs despite memory errors. The analysis can be used to find errors in commodity multi-threaded programs and to prevent attacks that exploit these errors. We require programmers to write ownership assertions that describe the sharing policies used by different parts of the program. These policies may change over time, as may the policies' means of enforcement, whether it be locks, barriers, thread joins, etc. Our compiler inserts checks in the program that signal an error if these policies are violated at runtime. We evaluated our tool on several benchmark programs. The run-time overhead was reasonable: between 0 and 49% with an average of 26%. We also found the tool easy to use: the total number of ownership assertions is small, and the asserted specification and implementation can be debugged together by running the instrumented program and addressing the errors that arise. Our approach enjoys a pleasing modular soundness property: if a thread executes a sequence of statements on variables it owns, the statements are serializable within a valid execution, and thus their effects can be reasoned about in isolation from other threads in the program.
机译:当线程不正确地共享数据时,会出现并发编程错误。程序员通常通过使用同步来执行简单的所有权策略来避免这些错误:数据要么由可以读取或写入数据的线程专有拥有,要么由一组可以读取但不能写入数据的线程拥有。不幸的是,不正确的同步通常无法强制执行这些策略,即使同步正确,诸如C和C ++之类的语言中的内存错误也可能违反这些策略。在本文中,我们提出了一种动态分析,用于检查并发C和C ++程序中的所有权策略,尽管存在内存错误。该分析可用于查找商品多线程程序中的错误,并防止利用这些错误的攻击。我们要求程序员编写所有权声明,以描述程序不同部分使用的共享策略。这些策略可能会随时间而变化,策略的实施方式也可能会变化,无论是锁,屏障,线程联接等。我们的编译器都会在程序中插入检查,如果这些策略在运行时被违反,则会发出错误信号。我们在几个基准程序上评估了我们的工具。运行时开销是合理的:介于0到49%之间,平均为26%。我们还发现该工具易于使用:所有权声明的总数很小,并且可以通过运行检测程序并解决出现的错误来一起调试声明的规范和实现。我们的方法具有令人愉悦的模块化健全性:如果线程在其拥有的变量上执行一系列语句,则这些语句可在有效执行中序列化,因此可以将其影响与程序中的其他线程隔离开来。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号