1 motivation
play

1. Motivation The present state of the art in software engineering - PowerPoint PPT Presentation

Bugs Now Show-Up in Everyday Life Vrification de labsence derreurs Bugs now appear frequently in everyday life (banks, lexcution dans des logiciels industriels cars, telephones, . . . ) Example (HSBC bank ATM 1 at 19


  1. Bugs Now Show-Up in Everyday Life « Vérification de l’absence d’erreurs à – Bugs now appear frequently in everyday life (banks, l’exécution dans des logiciels industriels cars, telephones, . . . ) – Example (HSBC bank ATM 1 at 19 Boulevard Sébas- critiques de contrôle/commande par topol in Paris, failure on Nov. 21 st 2006 at 8:30 am): interprétation abstraite » Patrick Cousot École normale supérieure 45 rue d’Ulm, 75230 Paris cedex 05, France Patrick.Cousot@ens.fr www.di.ens.fr/~cousot XIVes Rencontres INRIA – Industrie, Confiance et Sécurité — Rocquencourt — Jeudi 11 octobre 2007 1 cash machine, cash dispenser, automatic teller machine. Rencontres INRIA–Industrie, 11/10/2007 — 1 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 3 — ľ P. Cousot A Strong Need for Software Better Quality – Poor software quality is not acceptable in safety and mission critical software applications. 1. Motivation – The present state of the art in software engineering does not offer sufficient quality garantees Rencontres INRIA–Industrie, 11/10/2007 — 2 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 4 — ľ P. Cousot

  2. Tool-Based Software Design Methods Abstract Interpretation There are two fundamental concepts in computer science – New tool-based software design methods will have to (and in sciences in general) : emerge to face the unprecedented growth and complex- – Abstraction : to reason on complex systems ification of critical software – Approximation : to make effective undecidable com- – E.g. FCPC (Flight Control Primary Computer) putations - A220: 20 000 LOCs, These concepts are formalized by abstract interpretation - A340: 130 000 LOCS (V1), References 250 000 LOCS (V2), [POPL ’77] P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In 4 th ACM POPL . - A380: 1.000.000 LOCS [Thesis ’78] P. Cousot. Méthodes itératives de construction et d’approximation de points fixes d’opérateurs monotones sur un treillis, analyse sémantique de programmes. Thèse ès sci. math. Grenoble, march 1978. P. Cousot & R. Cousot. Systematic design of program analysis frameworks. In 6 th ACM POPL . [POPL ’79] Rencontres INRIA–Industrie, 11/10/2007 — 5 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 7 — ľ P. Cousot 2. Informal Introduction to Ab- stract Interpretation Principle of Abstraction Rencontres INRIA–Industrie, 11/10/2007 — 6 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 8 — ľ P. Cousot

  3. Operational semantics Test/Debugging is Unsafe x ( t ) x ( t ) t t Rencontres INRIA–Industrie, 11/10/2007 — 9 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 11 — ľ P. Cousot Safety property Bounded Model Checking is Unsafe x ( t ) x ( t ) t t Rencontres INRIA–Industrie, 11/10/2007 — 10 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 12 — ľ P. Cousot

  4. Over-Approximation (Cont’d) x ( t ) Soundness and Incompleteness t Rencontres INRIA–Industrie, 11/10/2007 — 13 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 15 — ľ P. Cousot Abstract Interpretation is Sound Soundness Requirement: Erroneous Abstraction 2 x ( t ) x ( t ) t t 2 This situation is always excluded in static analysis by abstract interpretation. Rencontres INRIA–Industrie, 11/10/2007 — 14 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 16 — ľ P. Cousot

  5. Soundness Requirement: Erroneous Abstraction 3 x ( t ) 3. The Astrée static analyzer http://www.astree.ens.fr/ t 3 This situation is always excluded in static analysis by abstract interpretation. Rencontres INRIA–Industrie, 11/10/2007 — 17 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 19 — ľ P. Cousot Project Members Imprecision ) False Alarms x ( t ) Bruno Blanchet 4 Patrick Cousot Radhia Cousot Jérôme Feret David Monniaux 5 Laurent Mauborgne Antoine Miné Xavier Rival t 4 Nov. 2001 —– Nov. 2003. 5 Nov. 2001 —– Aug. 2007. Rencontres INRIA–Industrie, 11/10/2007 — 18 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 20 — ľ P. Cousot

  6. – with (cont’d) - union [Min06a] NEW - pointer arithmetics & casts [Min06a] NEW – without Programs Analyzed by Astrée - dynamic memory allocation and their Semantics - recursive function calls - unstructured/backward branching - conflicting side effects - C libraries, system calls (parallelism) Such limitations are quite common for embedded safety-critical software. Rencontres INRIA–Industrie, 11/10/2007 — 21 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 23 — ľ P. Cousot Programs analysed by Astrée The Class of Considered Periodic Synchronous Programs declare volatile input, state and output variables; – Application Domain: large safety critical embedded initialize state and output variables; real-time synchronous software for non-linear control loop forever of very complex control/command systems. - read volatile input variables, - compute output and state variables, – C programs: - write to output variables; - with __ASTREE_wait_for_clock () ; ´ basic numeric datatypes, structures and arrays end loop ´ pointers (including on functions), Task scheduling is static: ´ floating point computations – Requirements: the only interrupts are clock ticks; ´ tests, loops and function calls – Execution time of loop body less than a clock tick, ´ limited branching (forward goto , break , continue ) as verified by the aiT WCET Analyzers [FHL + 01]. Rencontres INRIA–Industrie, 11/10/2007 — 22 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 24 — ľ P. Cousot

  7. Concrete Operational Semantics – International norm of C (ISO/IEC 9899:1999) – restricted by implementation-specific behaviors depend- ing upon the machine and compiler (e.g. representa- tion and size of integers, IEEE 754-1985 norm for floats Specification Proved by Astrée and doubles) – restricted by user-defined programming guidelines (such as no modular arithmetic for signed integers, even though this might be the hardware choice) – restricted by program specific user requirements (e.g. assert , execution stops on first runtime error 6 ) 6 semantics of C unclear after an error, equivalent if no alarm Rencontres INRIA–Industrie, 11/10/2007 — 25 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 27 — ľ P. Cousot Different Classes of Run-time Errors Implicit Specification: Absence of Runtime Errors 1. Errors terminating the execution 7 . Astrée warns and continues by taking into account only the executions that – No violation of the norm of C (e.g. array index out of did not trigger the error. bounds, division by zero) 2. Errors not terminating the execution with predictable outcome 8 . – No implementation-specific undefined behaviors (e.g. Astrée warns and continues with worst-case assumptions. maximum short integer is 32767, NaN) 3. Errors not terminating the execution with unpredictable outcome 9 . Astrée warns and continues by taking into ac- – No violation of the programming guidelines (e.g. static count only the executions that did not trigger the error. variables cannot be assumed to be initialized to 0) ) Astrée is sound with respect to C standard, unsound with – No violation of the programmer assertions (must all respect to C implementation, unless no false alarm. be statically verified). 7 floating-point exceptions e.g. (invalid operations, overflows, etc.) when traps are activated 8 e.g. overflows over signed integers resulting in some signed integer. 9 e.g. memory corruptionss. Rencontres INRIA–Industrie, 11/10/2007 — 26 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 28 — ľ P. Cousot

  8. Static Analysis with Astrée % cat -n modulo.c 1 int main () { 2 int x,y; 3 x = -2147483647 / -1; 4 y = ((-x) -1) / -1; 5 __ASTREE_log_vars((x,y)); Modular Arithmetic 6 } 7 % astree –exec-fn main –unroll 0 modulo.c\ |& egrep -A 1 "(<integers)|(WARN)" modulo.c:4.4-18::[call#main@1:]: WARN: signed int arithmetic range {2147483648} not included in [-2147483648, 2147483647] <integers (intv+cong+bitfield+set): y in [-2147483648, 2147483647] /\ Top, x in {2147483647} /\ {2147483647} > Astrée signals the overflow and goes on with an unkown value. Rencontres INRIA–Industrie, 11/10/2007 — 29 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 31 — ľ P. Cousot Modular arithmetics is not very intuitive In C: % cat -n modulo-c.c 1 #include <stdio.h> 2 int main () { 3 int x,y; Float Overflow 4 x = -2147483647 / -1; 5 y = ((-x) -1) / -1; 6 printf("x = %i, y = %i\n",x,y); 7 } 8 % gcc modulo-c.c % ./a.out x = 2147483647, y = -2147483648 Rencontres INRIA–Industrie, 11/10/2007 — 30 — ľ P. Cousot Rencontres INRIA–Industrie, 11/10/2007 — 32 — ľ P. Cousot

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend