TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

CompCert – A formally verified C compiler

185 pointsby cjgover 6 years ago

9 comments

ttulover 6 years ago
So when you implement a buffer overflow in your C program, you can be assured it will overflow in the manner specified.
评论 #18972348 未加载
评论 #18970969 未加载
评论 #18970165 未加载
评论 #18973090 未加载
als0over 6 years ago
One of the really nice outcomes of this approach is that it allows you to use different optimisation levels.<p>Other approaches try to bypass the compiler by verifying the generated binary against the semantics of the source code (treating the compiler itself as a black box). The major drawback is that you had to completely disable all optimisation.
评论 #18969015 未加载
herodotusover 6 years ago
In 1983, Ken Thompson gave a Turing Award talk in which he shows how to embed a backdoor into a compiler in such a way that it would not be visible, even if you had access to the compiler source. (<a href="http:&#x2F;&#x2F;delivery.acm.org&#x2F;10.1145&#x2F;1290000&#x2F;1283940&#x2F;a1983-thompson.pdf" rel="nofollow">http:&#x2F;&#x2F;delivery.acm.org&#x2F;10.1145&#x2F;1290000&#x2F;1283940&#x2F;a1983-thomps...</a>) I wonder if the verified compiler could be altered in the same way? (A snippet from the paper so you get the idea:<p>&gt;We compile the modified source with the normal C compiler to produce a bugged binary. We install this binary as the official C compiler. We can now remove the bugs from the source of the compiler and the new binary will reinsert the bugs whenever it is compiled. Of course, the login command will remain bugged with no trace in source anywhere.)
评论 #18971710 未加载
评论 #18971958 未加载
评论 #18971513 未加载
评论 #18971752 未加载
评论 #18975029 未加载
fukliefover 6 years ago
Does anyone in the industry use it ? Does anyone knows for sure that Airbus uses it ?
评论 #18971631 未加载
kazinatorover 6 years ago
&gt; <i>Such verified compilers come with a mathematical, machine-checked proof that the generated executable code behaves exactly as prescribed by the semantics of the source program.</i><p>Which semantics? The ISO C semantics is rather lacking; &quot;undefined behavior&quot; lurks around every corner.<p>A C compiler that correctly implements all ISO C requirements is a fine thing, and certainly better than one which gets some of that semantics wrong, but doesn&#x27;t achieve all that much in the big picture.<p>If the verified compiler actually provides extended semantics beyond ISO C that eliminates much of the undefined behavior, such that programmers using this dialect can rely on a safer language, then we&#x27;re talking.
评论 #18973004 未加载
评论 #18973115 未加载
评论 #18974058 未加载
User23over 6 years ago
Sadly even a proved correct C compiler can produce incorrect behavior in a real system: <a href="https:&#x2F;&#x2F;blog.regehr.org&#x2F;archives&#x2F;482" rel="nofollow">https:&#x2F;&#x2F;blog.regehr.org&#x2F;archives&#x2F;482</a>
jacquesmover 6 years ago
How does a project like this deal with the bootstrap problem?
评论 #18968499 未加载
评论 #18968661 未加载
评论 #18968502 未加载
评论 #18968472 未加载
评论 #18968909 未加载
m4r35n357over 6 years ago
See limitations in the docs.
marinintimover 6 years ago
Going to great lengths to avoid writing Rust.
评论 #18971915 未加载
评论 #18970123 未加载