1 / 21

Static Analyzers for Detecting Fatal SW Errors Before Testing 제 3 세부과제

Static Analyzers for Detecting Fatal SW Errors Before Testing 제 3 세부과제. 이광근 교수 Programming Research Lab. Seoul National University 1/16/2007 @ COEX. Content. Technology: Static Program Analysis Prototypes: Airac5, Umirac, Stan Commercialization: Sparrow 1.0. Open Problem.

Download Presentation

Static Analyzers for Detecting Fatal SW Errors Before Testing 제 3 세부과제

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Static Analyzers for Detecting Fatal SW Errors Before Testing제 3 세부과제 이광근 교수 Programming Research Lab.Seoul National University 1/16/2007 @ COEX

  2. Content • Technology: Static Program Analysis • Prototypes: Airac5, Umirac, Stan • Commercialization: Sparrow 1.0

  3. Open Problem • 소프트웨어가 실행되기 전에 • 우리가 바라는대로 실행될 지를 • no core dump/segmentation fault • no buffer overrun • no memory leak • “x.s > 0 at line 321” • “notNull(y) whenever x = 0” • etc. • 엄밀하게 미리 확인해주는 기술은?

  4. Static Program Analysis 프로그램의 실행 내용을 실행전에 자동으로 안전하게 어림잡는 일반적인 기술 “static analysis” “정적분석” “프로그램분석”

  5. 테스트와 다른점 • 테스트는 SW 를 실행시킬 수 있을 때 까지 기다려야 • 테스트는 찾고자 하는 오류를 모두 찾을 수 없음 • 프로그램 분석기(static program analyzer)는 • SW를 실행시키지 않고 타겟 오류의 위치를 자동으로 찾아줌 • SW의 소스만 준비되면 됨

  6. Limitation: 허위 경보(false alarm) • inevitable • repeat if E then x = x+1 else x = x-1 until B • rule of the game • minimize false alarms • no (few) undetected errors • with a reasonable cost errors

  7. Airac5 (Sparrow) • Statically Detecting Buffer-Overrun Errors in C Programs int *c = (int *)malloc(sizeof(int)*10); c[i] = 1; c[i + f()] = 1; c[*k + (*g)()] = 1; x = c+5; x[1] = 1; z->a = c; (z->a)[i] = 1; foo(c+2); int foo(int *d) {… d[i] = 1; …}

  8. Sparrow 성능 Buffer Overrun On a Linux 2.6 box with Pentium4 3.2GHz, 4GB RAM

  9. Umirac • Statically Detecting Unused Memory Areas in C Programs void sigandsets(sigset_t *r, const sigset_t *a, const sigset_t *b) { unsigned long a0, a1, a2, a3, b0, b1, b2, b3; switch ((64 / 32)){ case 4: a3 = a->sig[3]; a2 = a->sig[2]; b3 = b->sig[3]; b2 = b->sig[2]; r->sig[3] = ((a3) & (b3)); r->sig[2] = ((a2) & (b2)); case 2: a1 = a->sig[1]; b1 = b->sig[1]; r->sig[1] = ((a1) & (b1)); case 1: a0 = a->sig[0]; b0 = b->sig[0]; r->sig[0] = ((a0) & (b0)); break; default: _NSIG_WORDS_is_unsupported_size(); } } Linux-2.6.4/include/asm/signal.h:22:1 Target buffer size: {[4,4]}, Unused intervals: {[2,3]} 22: typedef struct {unsigned long sig[4];} sigset_t;

  10. Umirac 성능 UV: unused variables UF: unused fields BB: buffer bubble

  11. Stan • Statically Estimating Stack Size Increment for Each Call Edge main 8 16 simulate 4 setup transduce 82 20 32 12 16 16 compile reset prepare 168 backtrace

  12. Stan 성능 • 함수 포인터 분석 후 call graph 생성 • call 마다 최대 스택 사용량 분석 X264 분석 결과:

  13. Come Visit Our Booth • Demo: Umirac, Stan • Product Demo: Sparrow 1.0 • Talk to us and our sales reps 감사합니다 Programming Research Laboratory Seoul National University

  14. Sparrow 1.0

  15. SW오류 검증 기술의 진화 정적분석기술 효용 및 성숙도 coverity.com polyspace.com Sparrow 1.0 테스트기술 1980s 2000s 2010s 1990s

  16. Sparrow 1.0 • 타겟 소스언어 • C, C++ • ANSI C, GNU C, G++, MS C/C++, ARM C, etc. • 타겟 오류 • buffer overrun • memory leak • uninitialized access • null dereference

  17. Other Players • coverity.com • Stanford U., 미국시장에서 활발, ’05 국내 진출시도 • polyspace.com • Ecole Polytech., 유럽시장에서 활발, ’06 국내 진출시도 • grammatech.com • U. of Wisconsin-Madison, 미국정부시장 • 기타 (분석기술 미흡: “shallow” analysis) • fortify, klocwork, secure, seque, wily • 기존의 runtime tools • 상용 • PurifyPlus, Parasoft Insure++, Trace32, WinDBG, … • 공개SW • Valgrind …

  18. Sparrow 성능 1/2 Buffer Overrun On a Linux 2.6 box with Pentium4 3.2GHz, 4GB RAM

  19. Sparrow 성능 2/2 Memory Leaks On a Linux 2.6 box with Pentium4 3.2GHz, 4GB RAM

  20. Sparrow beats Prevent for True Buffer Overrun 11 • deep call chain • function pointers • function argument • loop induction variables • C standard library – memcpy, memset, … 20 False 36

  21. Sparrow beats Prevent for Memory Leaks • arbitrary pointer aliasing • alloc/free complex data structure • linking argument pointers • infinite loop • recursion 12 True 3 7 2 16 False

More Related