rosaec clinic internals - seoul national...
TRANSCRIPT
![Page 1: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/1.jpg)
ROSAEC Clinic Internals
Jaeho Shin
ROPAS Show&Tell2011-01-14
*
* Joint work with Sungkeun Cho, Kihong Heo, Jisoo Jung, Jinyoung Kim, Seungjoon Lee, Woosuk Lee, and Hakjoo Oh
![Page 2: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/2.jpg)
Contents
1. Tour
2. Design and Implementation
3. Preprocessing Issues & Ideas
![Page 3: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/3.jpg)
Tour
![Page 4: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/4.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 5: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/5.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 6: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/6.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 7: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/7.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 8: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/8.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 9: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/9.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 10: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/10.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 11: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/11.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 12: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/12.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 13: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/13.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 14: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/14.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 15: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/15.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 16: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/16.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 17: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/17.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 18: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/18.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 19: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/19.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 20: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/20.jpg)
ROSAEC Clinic Dashboard
From OurPoint of View
![Page 21: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/21.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 22: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/22.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 23: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/23.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 24: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/24.jpg)
ROSAEC Clinic Service
From User’sPoint of View
![Page 25: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/25.jpg)
Goal of ROSAEC Clinic
• To let the public experience static analysis technology
• To collect samples of erroneous code for better research
![Page 26: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/26.jpg)
Design and Implementation
![Page 27: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/27.jpg)
Overview
Web Interface
Clinic Engine
lighttpd php
frontend
notification
analyzer
managerSparrow Workspacereporterclassifier
public internal
coreutilsbash sandbox xsltproc php Case
![Page 28: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/28.jpg)
Structure for a Case
Case
input build analysis
alarms report log*.started
alarms.**.finished*.output
.target
...
target
a unique directory for each analysis
![Page 29: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/29.jpg)
Workspace
runnew preprocessing analyzing
...classifying
archive2010 2011
...
Structure for Organizing Cases
poolCase
Case
CaseCase
Case Case
Case Case Case
Case
Case
log
etc
![Page 30: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/30.jpg)
State Transitionnew
confirmed
received
approving
preprocessing
analyzing
analyzed
classifying
reportingreported
finished
failed
failed-notified
notify owner
owner confirms
notify admin
admin approves
run preprocessors
run analyzers
notify admin
newowner submits code
admin finishes classification
notify owner
record in archive
new
wheneversomethinggoes wrong
notify admin
admin classifies alarms
generate report
![Page 31: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/31.jpg)
State Transition Tableengine/manager/clinic-process
![Page 32: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/32.jpg)
Analyzer Driverspreprocess.X
analyze.Xfor each analyzer X
Clinic Engine
frontend
analyzer
Sparrow
![Page 33: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/33.jpg)
Analyzer Driverspreprocess.X
analyze.Xfor each analyzer X
Clinic Engine
frontend
analyzer
Sparrow
X
![Page 34: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/34.jpg)
PreprocessingIssues & Ideas
![Page 35: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/35.jpg)
Preprocess?
Source code
Source code
![Page 36: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/36.jpg)
Preprocess?
Pure C code
Source code
Build ➥
Source code
![Page 37: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/37.jpg)
Preprocess?
BinPure C codeSource
code
Build ➥
Source code
![Page 38: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/38.jpg)
Preprocess?
BinPure C code
AiracStatic analyzersusually requirepure C code as input
Source code
Build ➥
Source code
![Page 39: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/39.jpg)
Pure C Extraction
Source code
Source code
![Page 40: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/40.jpg)
Pure C Extraction
Source code
Source code
![Page 41: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/41.jpg)
Pure C Extraction
Pure C code
Source code
Build ➥
Source code
Pure C code
![Page 42: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/42.jpg)
Pure C Extraction
BinPure C codeSource
code
Build ➥
Source code
Pure C code
![Page 43: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/43.jpg)
Pure C Extraction
BinPure C code
Airac
We currently observe the build process to get a copy of Pure C
Source code
Build ➥
Source code
Pure C code
![Page 44: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/44.jpg)
Security Issue
Since our service run builds,
Malicious commands uploaded by userscan cause bad things
e.g. • rm -rf ~• mail [email protected] </etc/passwd
![Page 45: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/45.jpg)
ROSAEC Clinic Service system
Sandbox for Builds
Clinic Engine
sandbox
frontend
/bin /usr/bin/usr/lib
/usr/share/lib
/etc/usr/include
/bin /usr/bin/usr/lib
/usr/share/lib
/etc /usr/include...
...
Workspace
So, we perform builds in a sandbox* with chroot(2)* a separate system created with debootstrap(8)
![Page 46: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/46.jpg)
ROSAEC Clinic Service system
Sandbox for Builds
Clinic Engine
sandbox
frontend
Sandbox system
/bin /usr/bin/usr/lib
/usr/share/lib
/etc/usr/include
/bin /usr/bin/usr/lib
/usr/share/lib
/etc /usr/include...
...
Workspace
So, we perform builds in a sandbox* with chroot(2)* a separate system created with debootstrap(8)
![Page 47: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/47.jpg)
ROSAEC Clinic Service system
Sandbox for Builds
Clinic Engine
sandbox
frontend
Sandbox system
Case
/bin /usr/bin/usr/lib
/usr/share/lib
/etc/usr/include
build
/bin /usr/bin/usr/lib
/usr/share/lib
/etc /usr/include...
...
Workspace
So, we perform builds in a sandbox* with chroot(2)* a separate system created with debootstrap(8)
![Page 48: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/48.jpg)
ROSAEC Clinic Service system
Sandbox for Builds
Clinic Engine
sandbox
frontend
Sandbox system
Case
/bin /usr/bin/usr/lib
/usr/share/lib
/etc/usr/include
build
/bin /usr/bin/usr/lib
/usr/share/lib
/etc /usr/include...
...
Workspace
So, we perform builds in a sandbox* with chroot(2)* a separate system created with debootstrap(8)
![Page 49: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/49.jpg)
Remaining Issues
Pure C code
Source code
![Page 50: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/50.jpg)
Remaining Issues
Pure C code
Source code
?GNU Make, Autotools, configure,
CMake, SCons, Visual Studio, Xcode, ...
How should we build
![Page 51: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/51.jpg)
Remaining Issues
Pure C code
Source code
External Library
?Have we got all the header files
?GNU Make, Autotools, configure,
CMake, SCons, Visual Studio, Xcode, ...
How should we build
![Page 52: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/52.jpg)
Remaining Issues
Pure C code
Source code
External Library
?Have we got all the header files
?GNU Make, Autotools, configure,
CMake, SCons, Visual Studio, Xcode, ...
How should we build
We can’t run analyzers unlessuser gives us full information
![Page 53: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/53.jpg)
Idea 1
Provide our preprocessor, andlet users collect the Pure C code themselves
![Page 54: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/54.jpg)
Exercise
int main(void) { int s = 0; for (int i=1; i<=10; i++) s += i; return s;}
a.c:
Will this compile with “gcc a.c”?
![Page 55: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/55.jpg)
Exercise
$ gcc a.ca.c: In function ‘main’:a.c:3: error: ‘for’ loop initial declarations are only allowed in C99 modea.c:3: note: use option -std=c99 or -std=gnu99 to compile your code
No.
![Page 56: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/56.jpg)
Idea 2
Recover trivial compile errors
e.g. • -std=c99• #include “X” where X exists somewhere
![Page 57: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/57.jpg)
Idea 3
*.h names ⇌ Debian *-dev packages
Index names of header files in popular open source libraries
and install them in sandbox before builds
![Page 58: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/58.jpg)
Q&A + Discussion
![Page 59: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/59.jpg)
Development
• Gitgit clone ropas.snu.ac.kr:~netj/2010/rosaec-clinic
• Fully testable with local instance
![Page 60: ROSAEC Clinic Internals - Seoul National Universityropas.snu.ac.kr/~netj/talk/2011/0114.rosaec-clinic-internals.pdf · ROSAEC Clinic Internals Jaeho Shin ROPAS Show&Tell 2011-01-14](https://reader034.vdocuments.site/reader034/viewer/2022052612/5f0f31fa7e708231d442f53f/html5/thumbnails/60.jpg)
Remaining Work
• Feedback System & UI
• Better Report