RClassify: Classifying Race Conditions in Web Applications via Deterministic Replay

Masahiro Sakai
Masahiro SakaiSoftware Engineer at Preferred Networks, Inc.
RClassify: Classifying Race
Conditions in Web
Applications via Deterministic
Replay
著者: Lu Zhang and Chao Wang
(Virginia Tech and University of Southern California)
紹介者: 酒井 政裕 (Preferred Networks, Inc.)
@ ICSE2017勉強会 2017-08-24
要約:JavaScriptのデータ競合検査の偽陽性を、
スケジューリングしたリプレイでフィルタリング
9-2
課題
JavaScript においては処理はアトミックに実行されるので
普通の意味でのデータ競合(data race)は存在しない
が、イベントの発生順によって、意図しない結果になる不
具合はありえる
– 右図で <script> 要素の
パース前に画像がロード
されたら?
既存のデータ競合の検出
ツール(例えばEventRacer)
は誤検出が非常に多い
7
9-2
o the application itself (see Section V). This is better
sting approaches because technologies are changing
and tools implemented using a particular version of
wser will quickly become obsolete. In contrast, our
m-agnostic approach will be more robust against these
and updates.
we concretely execute the application using deter-
replay, as opposed to heuristically filtering the warn-
1], [22] or applying conservative static analysis [18],
can robustly decide if a race condition is real (i.e., if
ecution orders are feasible). The reason why existing
port many bogus race conditions in the first place is
some hidden happens-before relations between events
accounted for, and precisely capturing all happens-
elations would have been prohibitively expensive.
econd challenge is to decide, during state recording
mparison, which fields of the program state are impor-
thus should be compared. For a typical client-side web
1 <html>
2 <head> ... </head>
3 <body>
4 <img src="image1.jpg" onload="image1Loaded()"
id="image1">
5 <!-- omitted elements... -->
6 <script id="script1">
7 function image1Loaded() {
8 document.getElementById("button1")
.addEventListener("click", func);
9 }
10 function func() {
11 document.getElementById("outputField").innerHTML
= "Well done!";
12 }
13 </script>
14 <!-- omitted elements... -->
15 <button id="button1"> button1 </button>
16 <!-- omitted elements... -->
17 <div id="outputField"> </div>
18 </body>
19 </html>
Fig. 2. Example: A client-side web application with race conditions.※ Zhang et al. RClassify: Classifying Race Conditions in Web Applications
via Deterministic Replay. In Proceedings of ICSE 2017 Fig. 2より引用
提案手法: RCLASSIFY
1. サイトと既存検査ツールのwarningが入力
2. instrumentaionを施してイベント列を記録
3. 競合イベント(e1,e2)の実行順序が e1→e2 と e2→e1 とな
るようスケジュールしてリプレイ
(それ以外のイベント順序は出来るだけ保つ)
– 一方が実現不能であればデータ競合ではない (bogus)
4. 実行後に両者で状態
を比較
– 両者に本質的な違いが
あれば harmful な
データ競合
– 本質的に同じであれば
harmless なデータ競合
8
y: Classifying Race Conditions in Web
plications via Deterministic Replay
Lu Zhang
Virginia Tech
ksburg, VA, USA
Chao Wang
University of Southern California
Los Angeles, CA, USA
are common in web applications
and repair. Although there exist
web applications, they all report a
s. That is, the races they report are
n never occur in practice, or benign,
rroneous behaviors. Since manually
and error prone, reporting these
would be counter-productive. We
deterministic replay-based method
eal but also the truly harmful race
ng each pair of racing events in two
their impact on the program state:
Instrumented
Web Application
Compare the
Program States
Execution 1
URL of Web
Application
Race-condition
Warnings
Static Analysis
of HTML files
Replay the Racing
Event Pair
Execution 2
Harmful or
Harmless
Fig. 1. RCLASSIFY: Our evidence-based race-condition classification metho
017 IEEE/ACM 39th International Conference on Software Engineering017 IEEE/ACM 39th International Conference on Software Engineering
※ Zhang et al. RClassify: Classifying Race Conditions in Web Applications
via Deterministic Replay. In Proceedings of ICSE 2017 Fig. 1より引用
9-2
Instrumentation の詳細
Platform agnostic
– JavaScriptレベルのinstrumentationを頑張ることで、
プラットフォーム非依存で実現 (手をいれた特別なブラ
ウザやJavaScriptエンジンを使わなくて良い)
– 結構泥臭くやっている
面白かった例として、イベント順を強制するために
– イベント毎に「その前に起こっているべきイベントのリ
スト」を保持
– イベント発火時にまだ発火していないイベントがあった
ら、その時点では処理を実行せず、遅延して再実行
9
9-2
実験結果と所感
実験結果
– 標準的なベンチマーク50個で正確な分類結果
(R4等の既存ツールでは一部の競合しか検出できず)
– フォーチュン500企業からランダムに選んだ70サイトに適
用し、EventRacerの1903警告中、132を正しくharmful
と分類
所感
– 静的解析と動的解析の組み合わせの王道
– うまい問題を選んだ上で、実装と評価をきちんとやった
– フォーチュン500から評価対象を選んでいるのが面白い
10
9-2
1 of 5

Recommended

Data Visualization Japan Meetup 2018: 長く変化に対応する by
Data Visualization Japan Meetup 2018: 長く変化に対応するData Visualization Japan Meetup 2018: 長く変化に対応する
Data Visualization Japan Meetup 2018: 長く変化に対応するKeiichiro Ono
1.5K views100 slides
Run-time Code Generation and Modal-ML の紹介@PLDIr#2 by
Run-time Code Generation and Modal-ML の紹介@PLDIr#2Run-time Code Generation and Modal-ML の紹介@PLDIr#2
Run-time Code Generation and Modal-ML の紹介@PLDIr#2Masahiro Sakai
997 views27 slides
自然言語をラムダ式で解釈する体系PTQのHaskell実装 by
自然言語をラムダ式で解釈する体系PTQのHaskell実装自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装Masahiro Sakai
2.4K views17 slides
SAT/SMT solving in Haskell by
SAT/SMT solving in HaskellSAT/SMT solving in Haskell
SAT/SMT solving in HaskellMasahiro Sakai
3.4K views32 slides
ゼロピッチ: MOOC by
ゼロピッチ: MOOCゼロピッチ: MOOC
ゼロピッチ: MOOCMasahiro Sakai
1.1K views8 slides
Writing a SAT solver as a hobby project by
Writing a SAT solver as a hobby projectWriting a SAT solver as a hobby project
Writing a SAT solver as a hobby projectMasahiro Sakai
2K views31 slides

More Related Content

Similar to RClassify: Classifying Race Conditions in Web Applications via Deterministic Replay

NSDI2015読み会 Correctness セッション by
NSDI2015読み会 Correctness セッションNSDI2015読み会 Correctness セッション
NSDI2015読み会 Correctness セッションDaisuke Kotani
426 views20 slides
マーブル図で怖くないRxJS by
マーブル図で怖くないRxJSマーブル図で怖くないRxJS
マーブル図で怖くないRxJSbitbank, Inc. Tokyo, Japan
6.6K views36 slides
手と物体とのInteractionを検出するアプリケーションの開発 by
手と物体とのInteractionを検出するアプリケーションの開発手と物体とのInteractionを検出するアプリケーションの開発
手と物体とのInteractionを検出するアプリケーションの開発Morpho, Inc.
514 views23 slides
[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ... by
[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ...[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ...
[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ...Insight Technology, Inc.
2.2K views73 slides
Jaws2012 koshikawa by
Jaws2012 koshikawaJaws2012 koshikawa
Jaws2012 koshikawaKenji Koshikawa
885 views56 slides
Swarm Testing (ISSTA 2012) 輪講会用資料 by
Swarm Testing (ISSTA 2012) 輪講会用資料Swarm Testing (ISSTA 2012) 輪講会用資料
Swarm Testing (ISSTA 2012) 輪講会用資料nkazuki
977 views26 slides

Similar to RClassify: Classifying Race Conditions in Web Applications via Deterministic Replay(12)

NSDI2015読み会 Correctness セッション by Daisuke Kotani
NSDI2015読み会 Correctness セッションNSDI2015読み会 Correctness セッション
NSDI2015読み会 Correctness セッション
Daisuke Kotani426 views
手と物体とのInteractionを検出するアプリケーションの開発 by Morpho, Inc.
手と物体とのInteractionを検出するアプリケーションの開発手と物体とのInteractionを検出するアプリケーションの開発
手と物体とのInteractionを検出するアプリケーションの開発
Morpho, Inc.514 views
[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ... by Insight Technology, Inc.
[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ...[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ...
[db tech showcase Tokyo 2017] D15: ビッグデータ x 機械学習の高速分析をVerticaで実現!by ヒューレット・パッ...
Swarm Testing (ISSTA 2012) 輪講会用資料 by nkazuki
Swarm Testing (ISSTA 2012) 輪講会用資料Swarm Testing (ISSTA 2012) 輪講会用資料
Swarm Testing (ISSTA 2012) 輪講会用資料
nkazuki977 views
論文紹介: Value Prediction Network by Katsuki Ohto
論文紹介: Value Prediction Network論文紹介: Value Prediction Network
論文紹介: Value Prediction Network
Katsuki Ohto1.5K views
なぜ自社で脆弱性診断を行うべきなのか by Sen Ueno
なぜ自社で脆弱性診断を行うべきなのかなぜ自社で脆弱性診断を行うべきなのか
なぜ自社で脆弱性診断を行うべきなのか
Sen Ueno15.6K views
[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~ by Kenji Koshikawa
[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~
[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~
Kenji Koshikawa1.2K views
Reactive Workflow Argo Eventsの紹介 by Daisuke Taniwaki
Reactive Workflow Argo Eventsの紹介Reactive Workflow Argo Eventsの紹介
Reactive Workflow Argo Eventsの紹介
Daisuke Taniwaki1.8K views
「モダンな」可視化アプリケーション開発とはどのようなものか? by Keiichiro Ono
「モダンな」可視化アプリケーション開発とはどのようなものか?「モダンな」可視化アプリケーション開発とはどのようなものか?
「モダンな」可視化アプリケーション開発とはどのようなものか?
Keiichiro Ono3.8K views
Adversarial Networks の画像生成に迫る @WBAFLカジュアルトーク#3 by Daiki Shimada
Adversarial Networks の画像生成に迫る @WBAFLカジュアルトーク#3Adversarial Networks の画像生成に迫る @WBAFLカジュアルトーク#3
Adversarial Networks の画像生成に迫る @WBAFLカジュアルトーク#3
Daiki Shimada9.2K views

More from Masahiro Sakai

DeepXplore: Automated Whitebox Testing of Deep Learning by
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningMasahiro Sakai
1.6K views25 slides
Towards formal verification of neural networks by
Towards formal verification of neural networksTowards formal verification of neural networks
Towards formal verification of neural networksMasahiro Sakai
660 views32 slides
関数プログラマから見たPythonと機械学習 by
関数プログラマから見たPythonと機械学習関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習Masahiro Sakai
31.4K views29 slides
SAT/SMTソルバの仕組み by
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みMasahiro Sakai
36.7K views51 slides
Introduction to Max-SAT and Max-SAT Evaluation by
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationMasahiro Sakai
5.4K views42 slides
Aluminum: Principled Scenario Exploration through Minimality by
Aluminum: Principled Scenario Exploration through MinimalityAluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through MinimalityMasahiro Sakai
1.2K views7 slides

More from Masahiro Sakai(20)

DeepXplore: Automated Whitebox Testing of Deep Learning by Masahiro Sakai
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
Masahiro Sakai1.6K views
Towards formal verification of neural networks by Masahiro Sakai
Towards formal verification of neural networksTowards formal verification of neural networks
Towards formal verification of neural networks
Masahiro Sakai660 views
関数プログラマから見たPythonと機械学習 by Masahiro Sakai
関数プログラマから見たPythonと機械学習関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習
Masahiro Sakai31.4K views
SAT/SMTソルバの仕組み by Masahiro Sakai
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組み
Masahiro Sakai36.7K views
Introduction to Max-SAT and Max-SAT Evaluation by Masahiro Sakai
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT Evaluation
Masahiro Sakai5.4K views
Aluminum: Principled Scenario Exploration through Minimality by Masahiro Sakai
Aluminum: Principled Scenario Exploration through MinimalityAluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through Minimality
Masahiro Sakai1.2K views
代数的実数とCADの実装紹介 by Masahiro Sakai
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介
Masahiro Sakai3.8K views
How a CDCL SAT solver works by Masahiro Sakai
How a CDCL SAT solver worksHow a CDCL SAT solver works
How a CDCL SAT solver works
Masahiro Sakai25.2K views
萩野服部研究室 スキー合宿 2012 自己紹介(酒井) by Masahiro Sakai
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
Masahiro Sakai1K views
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P... by Masahiro Sakai
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
Masahiro Sakai839 views
“Design and Implementation of Generics for the .NET Common Language Runtime”他... by Masahiro Sakai
“Design and Implementation of Generics for the .NET Common Language Runtime”他...“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...
Masahiro Sakai907 views
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg... by Masahiro Sakai
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
Masahiro Sakai1.3K views
Whole Program Paths 等の紹介@PLDIr#3 by Masahiro Sakai
Whole Program Paths 等の紹介@PLDIr#3Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3
Masahiro Sakai1.4K views
Introduction to Categorical Programming (Revised) by Masahiro Sakai
Introduction to Categorical Programming (Revised)Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)
Masahiro Sakai6.4K views
Introduction to Categorical Programming by Masahiro Sakai
Introduction to Categorical ProgrammingIntroduction to Categorical Programming
Introduction to Categorical Programming
Masahiro Sakai1.7K views
融合変換による最適化の理論的基盤と正当性 (2006-06-27) by Masahiro Sakai
融合変換による最適化の理論的基盤と正当性 (2006-06-27)融合変換による最適化の理論的基盤と正当性 (2006-06-27)
融合変換による最適化の理論的基盤と正当性 (2006-06-27)
Masahiro Sakai2K views
融合変換による最適化の理論的基盤と正当性 (2006-06-20) by Masahiro Sakai
融合変換による最適化の理論的基盤と正当性 (2006-06-20)融合変換による最適化の理論的基盤と正当性 (2006-06-20)
融合変換による最適化の理論的基盤と正当性 (2006-06-20)
Masahiro Sakai919 views
Ruby-GNOME2におけるGC問題 by Masahiro Sakai
Ruby-GNOME2におけるGC問題Ruby-GNOME2におけるGC問題
Ruby-GNOME2におけるGC問題
Masahiro Sakai817 views

Recently uploaded

Windows 11 information that can be used at the development site by
Windows 11 information that can be used at the development siteWindows 11 information that can be used at the development site
Windows 11 information that can be used at the development siteAtomu Hidaka
88 views41 slides
光コラボは契約してはいけない by
光コラボは契約してはいけない光コラボは契約してはいけない
光コラボは契約してはいけないTakuya Matsunaga
18 views17 slides
SNMPセキュリティ超入門 by
SNMPセキュリティ超入門SNMPセキュリティ超入門
SNMPセキュリティ超入門mkoda
376 views15 slides
今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20... by
今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20...今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20...
今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20...NTT DATA Technology & Innovation
129 views42 slides
速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料) by
速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料)速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料)
速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料)NTT DATA Technology & Innovation
23 views38 slides

Recently uploaded(10)

Windows 11 information that can be used at the development site by Atomu Hidaka
Windows 11 information that can be used at the development siteWindows 11 information that can be used at the development site
Windows 11 information that can be used at the development site
Atomu Hidaka88 views
光コラボは契約してはいけない by Takuya Matsunaga
光コラボは契約してはいけない光コラボは契約してはいけない
光コラボは契約してはいけない
Takuya Matsunaga18 views
SNMPセキュリティ超入門 by mkoda
SNMPセキュリティ超入門SNMPセキュリティ超入門
SNMPセキュリティ超入門
mkoda376 views
今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20... by NTT DATA Technology & Innovation
今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20...今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20...
今、改めて考えるPostgreSQLプラットフォーム - マルチクラウドとポータビリティ -(PostgreSQL Conference Japan 20...
速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料) by NTT DATA Technology & Innovation
速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料)速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料)
速習! PostgreSQL専用HAソフトウェア: Patroni(PostgreSQL Conference Japan 2023 発表資料)
SSH応用編_20231129.pdf by icebreaker4
SSH応用編_20231129.pdfSSH応用編_20231129.pdf
SSH応用編_20231129.pdf
icebreaker4353 views
The Things Stack説明資料 by The Things Industries by CRI Japan, Inc.
The Things Stack説明資料 by The Things IndustriesThe Things Stack説明資料 by The Things Industries
The Things Stack説明資料 by The Things Industries
CRI Japan, Inc.71 views

RClassify: Classifying Race Conditions in Web Applications via Deterministic Replay

  • 1. RClassify: Classifying Race Conditions in Web Applications via Deterministic Replay 著者: Lu Zhang and Chao Wang (Virginia Tech and University of Southern California) 紹介者: 酒井 政裕 (Preferred Networks, Inc.) @ ICSE2017勉強会 2017-08-24 要約:JavaScriptのデータ競合検査の偽陽性を、 スケジューリングしたリプレイでフィルタリング 9-2
  • 2. 課題 JavaScript においては処理はアトミックに実行されるので 普通の意味でのデータ競合(data race)は存在しない が、イベントの発生順によって、意図しない結果になる不 具合はありえる – 右図で <script> 要素の パース前に画像がロード されたら? 既存のデータ競合の検出 ツール(例えばEventRacer) は誤検出が非常に多い 7 9-2 o the application itself (see Section V). This is better sting approaches because technologies are changing and tools implemented using a particular version of wser will quickly become obsolete. In contrast, our m-agnostic approach will be more robust against these and updates. we concretely execute the application using deter- replay, as opposed to heuristically filtering the warn- 1], [22] or applying conservative static analysis [18], can robustly decide if a race condition is real (i.e., if ecution orders are feasible). The reason why existing port many bogus race conditions in the first place is some hidden happens-before relations between events accounted for, and precisely capturing all happens- elations would have been prohibitively expensive. econd challenge is to decide, during state recording mparison, which fields of the program state are impor- thus should be compared. For a typical client-side web 1 <html> 2 <head> ... </head> 3 <body> 4 <img src="image1.jpg" onload="image1Loaded()" id="image1"> 5 <!-- omitted elements... --> 6 <script id="script1"> 7 function image1Loaded() { 8 document.getElementById("button1") .addEventListener("click", func); 9 } 10 function func() { 11 document.getElementById("outputField").innerHTML = "Well done!"; 12 } 13 </script> 14 <!-- omitted elements... --> 15 <button id="button1"> button1 </button> 16 <!-- omitted elements... --> 17 <div id="outputField"> </div> 18 </body> 19 </html> Fig. 2. Example: A client-side web application with race conditions.※ Zhang et al. RClassify: Classifying Race Conditions in Web Applications via Deterministic Replay. In Proceedings of ICSE 2017 Fig. 2より引用
  • 3. 提案手法: RCLASSIFY 1. サイトと既存検査ツールのwarningが入力 2. instrumentaionを施してイベント列を記録 3. 競合イベント(e1,e2)の実行順序が e1→e2 と e2→e1 とな るようスケジュールしてリプレイ (それ以外のイベント順序は出来るだけ保つ) – 一方が実現不能であればデータ競合ではない (bogus) 4. 実行後に両者で状態 を比較 – 両者に本質的な違いが あれば harmful な データ競合 – 本質的に同じであれば harmless なデータ競合 8 y: Classifying Race Conditions in Web plications via Deterministic Replay Lu Zhang Virginia Tech ksburg, VA, USA Chao Wang University of Southern California Los Angeles, CA, USA are common in web applications and repair. Although there exist web applications, they all report a s. That is, the races they report are n never occur in practice, or benign, rroneous behaviors. Since manually and error prone, reporting these would be counter-productive. We deterministic replay-based method eal but also the truly harmful race ng each pair of racing events in two their impact on the program state: Instrumented Web Application Compare the Program States Execution 1 URL of Web Application Race-condition Warnings Static Analysis of HTML files Replay the Racing Event Pair Execution 2 Harmful or Harmless Fig. 1. RCLASSIFY: Our evidence-based race-condition classification metho 017 IEEE/ACM 39th International Conference on Software Engineering017 IEEE/ACM 39th International Conference on Software Engineering ※ Zhang et al. RClassify: Classifying Race Conditions in Web Applications via Deterministic Replay. In Proceedings of ICSE 2017 Fig. 1より引用 9-2
  • 4. Instrumentation の詳細 Platform agnostic – JavaScriptレベルのinstrumentationを頑張ることで、 プラットフォーム非依存で実現 (手をいれた特別なブラ ウザやJavaScriptエンジンを使わなくて良い) – 結構泥臭くやっている 面白かった例として、イベント順を強制するために – イベント毎に「その前に起こっているべきイベントのリ スト」を保持 – イベント発火時にまだ発火していないイベントがあった ら、その時点では処理を実行せず、遅延して再実行 9 9-2
  • 5. 実験結果と所感 実験結果 – 標準的なベンチマーク50個で正確な分類結果 (R4等の既存ツールでは一部の競合しか検出できず) – フォーチュン500企業からランダムに選んだ70サイトに適 用し、EventRacerの1903警告中、132を正しくharmful と分類 所感 – 静的解析と動的解析の組み合わせの王道 – うまい問題を選んだ上で、実装と評価をきちんとやった – フォーチュン500から評価対象を選んでいるのが面白い 10 9-2