2,457 research outputs found
A concurrency semantics for relaxed atomics that permits optimisation and avoids thin-air executions
Copyright is held by the owner/author(s). Despite much research on concurrent programming languages, especially for Java and C/C++, we still do not have a satisfactory definition of their semantics, one that admits all common optimisations without also admitting undesired behaviour. Especially problematic are the "thin-Air" examples involving high-performance concurrent accesses, such as C/C++11 relaxed atomics. The C/C++11 model is in a per-candidate-execution style, and previous work has identified a tension between that and the fact that compiler optimisations do not operate over single candidate executions in isolation; rather, they operate over syntactic representations that represent all executions. In this paper we propose a novel approach that circumvents this difficulty. We define a concurrency semantics for a core calculus, including relaxed-Atomic and non-Atomic accesses, and locks, that admits a wide range of optimisation while still forbidding the classic thin-Air examples. It also addresses other problems relating to undefined behaviour. The basic idea is to use an event-structure representation of the current state of each thread, capturing all of its potential executions, and to permit interleaving of execution and transformation steps over that to reflect optimisation (possibly dynamic) of the code. These are combined with a non-multi-copy-Atomic storage subsystem, to reflect common hardware behaviour. The semantics is defined in a mechanised and executable form, and designed to be implementable above current relaxed hardware and strong enough to support the programming idioms that C/C++11 does for this fragment. It offers a potential way forward for concurrent programming language semantics, beyond the current C/C++11 and Java models.This work was partly funded by the EPSRC Programme Grant REMS:
Rigorous Engineering for Mainstream Systems, EP/K008528/
The problem of programming language concurrency semantics
Despite decades of research, we do not have a satisfactory concurrency semantics for any general-purpose programming language that aims to support concurrent systems code. The Java Memory Model has been shown to be unsound with respect to standard compiler optimisations, while the C/C++11 model is too weak, admitting undesirable thin-air executions.
Our goal in this paper is to articulate this major open problem as clearly as is currently possible, showing how it arises from the combination of multiprocessor relaxed-memory behaviour and the desire to accommodate current compiler optimisations. We make several novel contributions that each shed some light on the problem, constraining the possible solutions and identifying new difficulties.
First we give a positive result, proving in HOL4 that the existing axiomatic model for C/C++11 guarantees sequentially consistent semantics for simple race-free programs that do not use low-level atomics (DRF-SC, one of the core design goals). We then describe the thin-air problem and show that it cannot be solved, without restricting current compiler optimisations, using any per-candidate-execution condition in the style of the C/C++11 model. Thin-air executions were thought to be confined to programs using relaxed atomics, but we further show that they recur when one attempts to integrate the concurrency model with more of C, mixing atomic and nonatomic accesses, and that also breaks the DRF-SC result. We then describe a semantics based on an explicit operational construction of out-of-order execution, giving the desired behaviour for thin-air examples but exposing further difficulties with accommodating existing compiler optimisations. Finally, we show that there are major difficulties integrating concurrency semantics with the C/C++ notion of undefined behaviour.
We hope thereby to stimulate and enable research on this key issue
Recommended from our members
A no-thin-air memory model for programming languages
Many hardware and compiler optimisations introduced to speed up single-threaded programs also introduce additional, sometimes surprising, behaviours for concurrent programs with shared mutable state. How many of these extra behaviours occur in practice depends on the combination of the hardware, compiler, runtime, etc. that make up the platform. A memory model, which prescribes what values each read of a concurrent program can read, allows programmers to determine whether a program behaves as expected without having to worry about the details of the platform. However, capturing these behaviours in a memory model without also including undesirable "out-of-thin-air" behaviours that do not occur in practice has proved elusive. The memory model of C and C++ allows out-of-thin-air behaviour, while the Java memory model fails to capture some behaviours that are introduced in practice by compiler optimisations.
In this thesis, we propose a memory model that forbids out-of-thin-air behaviour, yet allows the behaviours that do occur. Our memory model follows operational intuitions of how the hardware and compilers operate. We illustrate that it behaves as desired on a series of litmus tests. We show that it captures at least some of the expected behaviours, that it forms an envelope around some common compiler optimisations, and that it is implementable on common hardware using the expected compilation schemes. We also show that it supports some established programming idioms.EPSRC Programme Grant REMS: Rigorous Engineering for Mainstream Systems, EP/K008628/1
Computer Laboratory Premium Research Studentshi
C์ ์ ์์ค ๊ธฐ๋ฅ๊ณผ ์ปดํ์ผ๋ฌ ์ต์ ํ ์กฐํ์ํค๊ธฐ
ํ์๋
ผ๋ฌธ (๋ฐ์ฌ)-- ์์ธ๋ํ๊ต ๋ํ์ : ๊ณต๊ณผ๋ํ ์ปดํจํฐ๊ณตํ๋ถ, 2019. 2. ํ์ถฉ๊ธธ.์ฃผ๋ฅ C ์ปดํ์ผ๋ฌ๋ค์ ํ๋ก๊ทธ๋จ์ ์ฑ๋ฅ์ ๋์ด๊ธฐ ์ํด ๊ณต๊ฒฉ์ ์ธ ์ต์ ํ๋ฅผ ์ํํ๋๋ฐ, ๊ทธ๋ฐ ์ต์ ํ๋ ์ ์์ค ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ํ๋ก๊ทธ๋จ์ ํ๋์ ๋ฐ๊พธ๊ธฐ๋ ํ๋ค. ๋ถํํ๋ C ์ธ์ด๋ฅผ ๋์์ธํ ๋ ์ ์์ค ๊ธฐ๋ฅ๊ณผ ์ปดํ์ผ๋ฌ ์ต์ ํ๋ฅผ ์ ์ ํ๊ฒ ์กฐํ์ํค๊ฐ ๊ต์ฅํ ์ด๋ ต๋ค๋ ๊ฒ์ด ํ๊ณ์ ์
๊ณ์ ์ค๋ก ์ด๋ค. ์ ์์ค ๊ธฐ๋ฅ์ ์ํด์๋, ๊ทธ๋ฌํ ๊ธฐ๋ฅ์ด ์์คํ
ํ๋ก๊ทธ๋๋ฐ์ ์ฌ์ฉ๋๋ ํจํด์ ์ ์ง์ํด์ผ ํ๋ค. ์ปดํ์ผ๋ฌ ์ต์ ํ๋ฅผ ์ํด์๋, ์ฃผ๋ฅ ์ปดํ์ผ๋ฌ๊ฐ ์ํํ๋ ๋ณต์กํ๊ณ ๋ ํจ๊ณผ์ ์ธ ์ต์ ํ๋ฅผ ์ ์ง์ํด์ผ ํ๋ค. ๊ทธ๋ฌ๋ ์ ์์ค ๊ธฐ๋ฅ๊ณผ ์ปดํ์ผ๋ฌ ์ต์ ํ๋ฅผ ๋์์ ์ ์ง์ํ๋ ์คํ์๋ฏธ๋ ์ค๋๋ ๊น์ง ์ ์๋ ๋ฐ๊ฐ ์๋ค.
๋ณธ ๋ฐ์ฌํ์ ๋
ผ๋ฌธ์ ์์คํ
ํ๋ก๊ทธ๋๋ฐ์์ ์๊ธดํ๊ฒ ์ฌ์ฉ๋๋ ์ ์์ค ๊ธฐ๋ฅ๊ณผ ์ฃผ์ํ ์ปดํ์ผ๋ฌ ์ต์ ํ๋ฅผ ์กฐํ์ํจ๋ค. ๊ตฌ์ฒด์ ์ผ๋ก, ์ฐ๋ฆฐ ๋ค์ ์ฑ์ง์ ๋ง์กฑํ๋ ๋์จํ ๋์์ฑ, ๋ถํ ์ปดํ์ผ, ์ ์-ํฌ์ธํฐ ๋ณํ์ ์คํ์๋ฏธ๋ฅผ ์ฒ์์ผ๋ก ์ ์ํ๋ค. ์ฒซ์งธ, ๊ธฐ๋ฅ์ด ์์คํ
ํ๋ก๊ทธ๋๋ฐ์์ ์ฌ์ฉ๋๋ ํจํด๊ณผ, ๊ทธ๋ฌํ ํจํด์ ๋
ผ์ฆํ ์ ์๋ ๊ธฐ๋ฒ์ ์ง์ํ๋ค. ๋์งธ, ์ฃผ์ํ ์ปดํ์ผ๋ฌ ์ต์ ํ๋ค์ ์ง์ํ๋ค. ์ฐ๋ฆฌ๊ฐ ์ ์ํ ์คํ์๋ฏธ์ ์์ ๊ฐ์ ์ป๊ธฐ ์ํด ์ฐ๋ฆฌ๋ ๋
ผ๋ฌธ์ ์ฃผ์ ๊ฒฐ๊ณผ๋ฅผ ๋๋ถ๋ถ Coq ์ฆ๋ช
๊ธฐ ์์์ ์ฆ๋ช
ํ๊ณ , ๊ทธ ์ฆ๋ช
์ ๊ธฐ๊ณ์ ์ด๊ณ ์๋ฐํ๊ฒ ํ์ธํ๋ค.To improve the performance of C programs, mainstream compilers perform aggressive optimizations that may change the behaviors of programs that use low-level features in unidiomatic ways. Unfortunately, despite many years of research and industrial efforts, it has proven very difficult to adequately balance the conflicting criteria for low-level features and compiler optimizations in the design of the C programming language. On the one hand, C should support the common usage patterns of the low-level features in systems programming. On the other hand, C should also support the sophisticated and yet effective optimizations performed by mainstream compilers. None of the existing proposals for C semantics, however, sufficiently support low-level features and compiler optimizations at the same time.
In this dissertation, we resolve the conflict between some of the low-level features crucially used in systems programming and major compiler optimizations. Specifically, we develop the first formal semantics of relaxed-memory concurrency, separate compilation, and cast between integers and pointers that (1) supports their common usage patterns and reasoning principles for programmers, and (2) provably validates major compiler optimizations at the same time. To establish confidence in our formal semantics, we have formalized most of our key results in the Coq theorem prover, which automatically and rigorously checks the validity of the results.Abstract
Acknowledgements
Chapter I Prologue
Chapter II Relaxed-Memory Concurrency
Chapter III Separate Compilation and Linking
Chapter IV Cast between Integers and Pointers
Chapter V Epilogue
์ด๋กDocto
Neural malware detection
At the heart of todayโs malware problem lies theoretically infinite diversity created by metamorphism. The majority of conventional machine learning techniques tackle the problem with the assumptions that a sufficiently large number of training samples exist and that the training set is independent and identically distributed. However, the lack of semantic features combined with the models under these wrong assumptions result largely in overfitting with many false positives against real world samples, resulting in systems being left vulnerable to various adversarial attacks. A key observation is that modern malware authors write a script that automatically generates an arbitrarily large number of diverse samples that share similar characteristics in program logic, which is a very cost-effective way to evade detection with minimum effort. Given that many malware campaigns follow this paradigm of economic malware manufacturing model, the samples within a campaign are likely to share coherent semantic characteristics. This opens up a possibility of one-to-many detection. Therefore, it is crucial to capture this non-linear metamorphic pattern unique to the campaign in order to detect these seemingly diverse but identically rooted variants. To address these issues, this dissertation proposes novel deep learning models, including generative static malware outbreak detection model, generative dynamic malware detection model using spatio-temporal isomorphic dynamic features, and instruction cognitive malware detection. A comparative study on metamorphic threats is also conducted as part of the thesis. Generative adversarial autoencoder (AAE) over convolutional network with global average pooling is introduced as a fundamental deep learning framework for malware detection, which captures highly complex non-linear metamorphism through translation invariancy and local variation insensitivity. Generative Adversarial Network (GAN) used as a part of the framework enables oneshot training where semantically isomorphic malware campaigns are identified by a single malware instance sampled from the very initial outbreak. This is a major innovation because, to the best of our knowledge, no approach has been found to this challenging training objective against the malware distribution that consists of a large number of very sparse groups artificially driven by arms race between attackers and defenders. In addition, we propose a novel method that extracts instruction cognitive representation from uninterpreted raw binary executables, which can be used for oneto- many malware detection via one-shot training against frequency spectrum of the Transformerโs encoded latent representation. The method works regardless of the presence of diverse malware variations while remaining resilient to adversarial attacks that mostly use random perturbation against raw binaries. Comprehensive performance analyses including mathematical formulations and experimental evaluations are provided, with the proposed deep learning framework for malware detection exhibiting a superior performance over conventional machine learning methods. The methods proposed in this thesis are applicable to a variety of threat environments here artificially formed sparse distributions arise at the cyber battle fronts.Doctor of Philosoph
Model of models -- Part 1
This paper proposes a new cognitive model, acting as the main component of an
AGI agent. The model is introduced in its mature intelligence state, and as an
extension of previous models, DENN, and especially AKREM, by including
operational models (frames/classes) and will. This model's core assumption is
that cognition is about operating on accumulated knowledge, with the guidance
of an appropriate will. Also, we assume that the actions, part of knowledge,
are learning to be aligned with will, during the evolution phase that precedes
the mature intelligence state. In addition, this model is mainly based on the
duality principle in every known intelligent aspect, such as exhibiting both
top-down and bottom-up model learning, generalization verse specialization, and
more. Furthermore, a holistic approach is advocated for AGI designing, and
cognition under constraints or efficiency is proposed, in the form of
reusability and simplicity. Finally, reaching this mature state is described
via a cognitive evolution from infancy to adulthood, utilizing a consolidation
principle. The final product of this cognitive model is a dynamic operational
memory of models and instances. Lastly, some examples and preliminary ideas for
the evolution phase to reach the mature state are presented.Comment: arXiv admin note: text overlap with arXiv:2301.1355
- โฆ