Newsgroups: comp.arch Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!kithrup.com!mrs From: mrs@kithrup.com (Mike Stump) Subject: Re: The freedom that give us C++ and C Message-ID: Date: Sat, 30 Jan 2016 01:44:18 GMT References: <2016Jan28.171851@mips.complang.tuwien.ac.at> Organization: Kithrup Enterprises, Ld. X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Lines: 22 Xref: csiph.com comp.arch:33303 In article <2016Jan28.171851@mips.complang.tuwien.ac.at>, Anton Ertl wrote: >1) I don't think there are checkers for all undefined behaviour yet That's correct. And I suspect a sufficiently advanced person can prove that it is impossible for languages like C and C++, in general. >2) Undefined behaviour is a dynamic issue. It can show up with some >input data, but not with every input data. So even if they have used >a checker to detect undefined behaviour and eliminated all that they >found, there could still be undefined behaviour that they have not >detected yet, even though it would be detected if they ran gcc/LLVM >with the checker and gave it the right input; such undefined behaviour >can also still lurk in the code. Actually, there is an entire field of study called static analysis and in that field they have a technique called symbolic execution that deals with the reasoning about code that isn't executed in real life, but it is executed symbolically during analysis and that analysis can makes statements about the code's dynamic behavior that can be well beyond fascinating. http://blog.trailofbits.com/2014/04/27/using-static-analysis-and-clang-to-find-heartbleed/