SlideShare a Scribd company logo
EventRacer: Finding Concurrency Errors 
in Event-Driven Applications 
Pavol Bielik
Android Errors Caused by Concurrency 
Display article twice Display wrong directory Display wrong order 1
Web Page Errors Caused by Concurrency 
Incomplete form 
jQuery version used non-deterministically 
submitted Non-operational menu 
2
Event-Driven Applications 
designed to hide latency, various asynchronous APIs 
network, disk, database, timers, UI events 
highly asynchronous and complex control flow 
scheduling non-determinism 
asynchrony is not intuitive 
3
Trouble with Asynchrony 
Background task, progress dialog, orientation change - is there any 100% working solution? 
JavaScript function sometimes called, sometimes not 
Avoiding race conditions in Google Analytics asynchronous tracking 
Ajax Call Sometimes Works, Sometime works and refreshes, Sometimes refreshes and fails …? 
Is AsyncTask really conceptually flawed or am I just missing something? 
4
“Hello World” of web page concurrency 
<html><body> 
<script> 
var v=undefined; 
</script> 
<img src="img1.png" onload="v='Hi!';"> 
<img src="img2.png" onload="alert(v);"> 
</body></html> 
Browser Server 
fetch img1.png 
fetch img2.png 
load img1.png 
load img2.png 
v:undefined 
v:’Hi!’ 
Hi! 
5
Bad interleaving 
<html><body> 
<script> 
var v=undefined; 
</script> 
<img src="img1.png" onload="v='Hi!';"> 
<img src="img2.png" onload="alert(v);"> 
</body></html> 
Browser Server 
fetch img1.png 
fetch img2.png 
load img2.png 
v:undefined 
undefined 
5
Understanding the problem 
<html><body> 
<script> 
var v=undefined; 
</script> 
<img src=”img1.png” onload=”v=’Hi!’;”> 
<img src=”img2.png” onload=”alert(v);”> 
</body></html> 
Event Actions 
6
Understanding the problem 
<html><body> 
<script> 
var v=undefined; 
</script> 
<img src=”img1.png” onload=”v=’Hi!’;”> 
<img src=”img2.png” onload=”alert(v);”> 
</body></html> 
Event Actions 
Happens-before 
6
Understanding the problem 
<html><body> 
<script> 
var v=undefined; 
</script> 
<img src=”img1.png” onload=”v=’Hi!’;”> 
<img src=”img2.png” onload=”alert(v);”> 
</body></html> 
Race 
write v 
read v 
Event Actions 
Happens-before 
6
Online Analysis 
http://www.eventracer.org 
7
EventRacer end-to-end System 
Instrumented 
System 
Execution 
Trace 
Happens-before 
Graph 
Race 
Detector 
? 
? 
? 
Race 
Explorer 
Race Filtering 
and Grouping 
Android App, 
Web Page 
7
EventRacer end-to-end System 
DOM nodes and attributes 
<img id="img1" src="img1.png" 
onload="v='Hi!';"> 
<script> 
document.getElementById("img1") 
.addEventListener("click", f); 
</script> 
↦ write(#img1) 
↦ write(#img1.onload) 
↦ read(#img1) 
↦ write(#img1.click) 
Instrumented 
System 
Execution 
Trace 
What are the memory locations on 
which asynchronous events can race? 
JS variables, functions, arrays 
<script> 
v='Hi!'; 
function f() {} 
messages[2] = 42; 
</script> 
↦ write(v) 
↦ write(f) 
↦ write(messages[2]) 
Happens-before 
Graph 
Race 
Detector 
? 
? 
? 
Race 
Explorer 
Race Filtering 
and Grouping 
Android App, 
Web Page 
8
EventRacer end-to-end System 
Instrumented 
System 
Web 
- parsing an HTML element 
- executing a script 
- handling user input 
- ... 
<script> 
var v=undefined; 
</script> 
<img src=”img1.png” onload=”v=’Hi!’;”> 
<img src=”img2.png” onload=”alert(v);”> 
Execution 
Trace 
What are the atomic events used in 
event-driven applications? 
Happens-before 
Graph 
Race 
Detector 
? 
? 
? 
Race 
Explorer 
Race Filtering 
and Grouping 
Android App, 
Web Page 
9
EventRacer end-to-end System 
Happens-before 
<script> 
var v=undefined; 
</script> 
Happens-before 
<img src=”img1.png” onload=”v=’Hi!’;”> 
<img src=”img2.png” onload=”alert(v);”> 
Instrumented 
System 
Execution 
Trace 
What is the event happens-before? 
Web 
setInterval, SetTimeout, AJAX, … 
Android 
postDelayed, postAtFront, postIdle, ... 
Graph 
Race 
Detector 
? 
? 
? 
Race 
Explorer 
Race Filtering 
and Grouping 
Android App, 
Web Page 
10
EventRacer end-to-end System 
<script> 
var v=undefined; 
</script> 
Race 
write v 
<img src=”img1.png” onload=”v=’Hi!’;”> 
<img src=”img2.png” onload=”alert(v);”> 
read v 
Instrumented 
System 
Execution 
Trace 
How to make scalable race detection in 
event-based setting? 
(Naive algorithms have asymptotic complexity O(N3) and 
require O(N2) space) 
State of the art EventRacer 
runtime TIMEOUT 2.4sec 
memory 25181MB 171MB 
Happens-before 
Graph 
Race 
Detector 
? 
? 
? 
Race 
Explorer 
Race Filtering 
and Grouping 
Android App, 
Web Page 
11
EventRacer end-to-end System 
Is the system effective at finding 
harmful races while reporting few 
benign races? 
We filter common classes of benign 
races: 
commutative operations, recycled objects, lazy 
initialization, local reads, ... 
Web Android 
# races found 646 1328 
# races reported 17.3 13 
reduction 37x 100x 
Instrumented 
System 
Execution 
Trace 
Happens-before 
Graph 
Race 
Detector 
? 
? 
? 
Race 
Explorer 
Race Filtering 
and Grouping 
Android App, 
Web Page 
13
Manual evaluation 
Fortune 100 Web Pages 
25% 
17.3% 
synchronization races 
various idioms: 
✓ if (ready) … 
✓ try { … } catch { retry } 
✓ array of callbacks 
✓ etc. 
harmless races 
✓ commutative 
operations 
✓ benign races 
✓ framework related 
Web (314 reports) 
Harmful bugs 
✓ unhandled exceptions 
✓ UI glitches 
✓ broken analytics 
✓ page needs refresh to 
work normally 
Android (104 reports) 
8 Play Store Applications 
14 
24.6% 
58.4% 
17% 57.7%
Simple GPS Tracker 
protected void onCreate() { 
locationManager.requestLocationUpdates(GPS_PROVIDER, 0, 0, mListener); 
mDbHelper = new SQLiteOpenHelper(this, DB_NAME, DB_VERSION); 
} 
LocationListener mListener = new LocationListener() { 
public void onLocationChanged(Location location) { 
//show location on map 
mDbHelper.getWritableDatabase().insert(loc); 
} }; 
protected void onStop() { 
locationManager.removeUpdates(mListener); 
mDbHelper.close(); 
} 
15
Simple GPS Tracker 
protected void onCreate() { 
locationManager.requestLocationUpdates(GPS_PROVIDER, 0, 0, mListener); 
mDbHelper = new SQLiteOpenHelper(this, DB_NAME, DB_VERSION); 
} 
LocationListener mListener = new LocationListener() { 
public void onLocationChanged(Location location) { 
//show location on map 
mDbHelper.getWritableDatabase().insert(loc); 
} }; 
protected void onStop() { 
locationManager.removeUpdates(mListener); 
mDbHelper.close(); 
} 
15 
public void removeUpdates (LocationListener listener) 
Added in API level 1 
Removes all location updates for the specified LocationListener. 
Following this call, updates will no longer occur for this listener.
http://www.eventracer.org/android 
16
Analysis Results 
onLocationChanged and onStop are reported as not ordered 
event 1 source 
async IPC, interface(android.location.ILocationListener), 
code(onLocationChanged)) 
event 2 source 
async IPC, interface(android.app.IApplicationThread), code 
(SCHEDULE_STOP_ACTIVITY)) 
→calling context 
Landroid/database/sqlite/SQLiteDatabase;.insert(...) 
→calling context 
Landroid/database/sqlite/SQLiteClosable;.close(...) 
→ UPDATE-UPDATE - 63568 Landroid/database/sqlite/SQLiteConnectionPool;.mAvailablePrimaryConnection 
→ READ-UPDATE - 63568 Landroid/database/sqlite/SQLiteConnectionPool;.mIsOpen 
→ READ-UPDATE - 63576 Landroid/database/sqlite/SQLiteConnection;.mConnectionPtr 
→ READ-UPDATE - 63576 Landroid/database/sqlite/SQLiteConnection;.mPreparedStatementPool 
16
Is the Alternative Interleaving Feasible? 
D/GPS: onCreate 
D/GPS: insert: Location[gps 47.284646,8.632389 acc=10 et=0 vel=2.0 mock] 
D/GPS: insert: Location[gps 47.284656,8.632598 acc=10 et=0 vel=2.0 mock] 
D/GPS: insert: Location[gps 47.284712,8.632722 acc=10 et=0 vel=2.0 mock] 
D/GPS: insert: Location[gps 47.284832,8.632837 acc=10 et=0 vel=2.0 mock] 
D/GPS: onStop 
D/GPS: insert: Location[gps 47.285022,8.633205 acc=10 et=0 vel=2.0 mock] 
E/AndroidRuntime: FATAL EXCEPTION: main 
E/AndroidRuntime: Process: com.example.gps, PID: 2249 
E/AndroidRuntime: java.lang.IllegalStateException: attempt to re-open an 
already-closed object: SQLiteDatabase: /data/data/com.example.gps/test.db 
16
Current Directions 
Google Chromium port 
V8 javascript engine instrumentation 
Testing tools based on EventRacer 
Integration with Selenium 
PhantomJS 
Application for Parallelization 
Other Application Domains (beyond Web Pages, Android) 
Node.js 
17
www.eventracer.org 
Martin Vechev, Veselin Raychev, Pavol Bielik 
Anders Møller, Casper Jensen 
Manu Sridharan 
Boris Petrov, Yasen Trifonov 
Julian Dolby 
Instrumented 
System 
Execution 
Trace 
Happens-before 
Graph 
Race 
Detector 
? 
? 
? 
Race 
Explorer 
Race Filtering 
and Grouping 
Android App, 
Web Page
Ad

More Related Content

Viewers also liked (7)

Geolocalización
GeolocalizaciónGeolocalización
Geolocalización
Jimmy Atocza Ledesma
 
Device
DeviceDevice
Device
YAMANE Toshiaki
 
Geolocalización v2
Geolocalización v2Geolocalización v2
Geolocalización v2
Jimmy Atocza Ledesma
 
Fundamentos de la ciencia e ingeniería de materiales 3ra edición - william ...
Fundamentos de la ciencia e ingeniería de materiales   3ra edición - william ...Fundamentos de la ciencia e ingeniería de materiales   3ra edición - william ...
Fundamentos de la ciencia e ingeniería de materiales 3ra edición - william ...
Wiłłiam Garcia
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
Post Planner
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
Kirsty Hulse
 
Fundamentos de la ciencia e ingeniería de materiales 3ra edición - william ...
Fundamentos de la ciencia e ingeniería de materiales   3ra edición - william ...Fundamentos de la ciencia e ingeniería de materiales   3ra edición - william ...
Fundamentos de la ciencia e ingeniería de materiales 3ra edición - william ...
Wiłłiam Garcia
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
Post Planner
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
Kirsty Hulse
 

Similar to Finding Concurrency Errors in Event-Driven Applications - Strangeloop'14 (20)

Oracle APEX migration to 5.1 - Our experience
Oracle APEX migration to 5.1 - Our experienceOracle APEX migration to 5.1 - Our experience
Oracle APEX migration to 5.1 - Our experience
Lino Schildenfeld
 
A framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediationA framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediation
Jürgen Etzlstorfer
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
Justin Cataldo
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
Greg Whalin
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOS
fpatton
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
Revanth Mca
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
rajkamal560066
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
Massimo Oliviero
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
Aarti Parikh
 
Tyler Wright - Undo History with Flight
Tyler Wright - Undo History with FlightTyler Wright - Undo History with Flight
Tyler Wright - Undo History with Flight
360|Conferences
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web
pjcozzi
 
From Ruby to Node.js
From Ruby to Node.jsFrom Ruby to Node.js
From Ruby to Node.js
jubilem
 
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
Robert Nyman
 
Vlad Nedomovniy "Navigation with less pain"
Vlad Nedomovniy "Navigation with less pain"Vlad Nedomovniy "Navigation with less pain"
Vlad Nedomovniy "Navigation with less pain"
Provectus
 
PhD Dissertation Defense (April 2015)
PhD Dissertation Defense (April 2015)PhD Dissertation Defense (April 2015)
PhD Dissertation Defense (April 2015)
Shauvik Roy Choudhary, Ph.D.
 
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Jung Kim
 
"Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap...
"Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap..."Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap...
"Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap...
Fwdays
 
ユニバーサル Windows アプリ開発
ユニバーサル Windows アプリ開発ユニバーサル Windows アプリ開発
ユニバーサル Windows アプリ開発
Akira Onishi
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom components
Jeremy Grancher
 
Shape12 6
Shape12 6Shape12 6
Shape12 6
pslulli
 
Oracle APEX migration to 5.1 - Our experience
Oracle APEX migration to 5.1 - Our experienceOracle APEX migration to 5.1 - Our experience
Oracle APEX migration to 5.1 - Our experience
Lino Schildenfeld
 
A framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediationA framework for self-healing applications – the path to enable auto-remediation
A framework for self-healing applications – the path to enable auto-remediation
Jürgen Etzlstorfer
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
Greg Whalin
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOS
fpatton
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
rajkamal560066
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
Massimo Oliviero
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
Aarti Parikh
 
Tyler Wright - Undo History with Flight
Tyler Wright - Undo History with FlightTyler Wright - Undo History with Flight
Tyler Wright - Undo History with Flight
360|Conferences
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web
pjcozzi
 
From Ruby to Node.js
From Ruby to Node.jsFrom Ruby to Node.js
From Ruby to Node.js
jubilem
 
WebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla LondonWebAPIs & Apps - Mozilla London
WebAPIs & Apps - Mozilla London
Robert Nyman
 
Vlad Nedomovniy "Navigation with less pain"
Vlad Nedomovniy "Navigation with less pain"Vlad Nedomovniy "Navigation with less pain"
Vlad Nedomovniy "Navigation with less pain"
Provectus
 
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
Jung Kim
 
"Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap...
"Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap..."Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap...
"Micro-frontends from A to Z. How and Why we use Micro-frontends in Namecheap...
Fwdays
 
ユニバーサル Windows アプリ開発
ユニバーサル Windows アプリ開発ユニバーサル Windows アプリ開発
ユニバーサル Windows アプリ開発
Akira Onishi
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom components
Jeremy Grancher
 
Shape12 6
Shape12 6Shape12 6
Shape12 6
pslulli
 
Ad

Recently uploaded (20)

Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Ad

Finding Concurrency Errors in Event-Driven Applications - Strangeloop'14

  • 1. EventRacer: Finding Concurrency Errors in Event-Driven Applications Pavol Bielik
  • 2. Android Errors Caused by Concurrency Display article twice Display wrong directory Display wrong order 1
  • 3. Web Page Errors Caused by Concurrency Incomplete form jQuery version used non-deterministically submitted Non-operational menu 2
  • 4. Event-Driven Applications designed to hide latency, various asynchronous APIs network, disk, database, timers, UI events highly asynchronous and complex control flow scheduling non-determinism asynchrony is not intuitive 3
  • 5. Trouble with Asynchrony Background task, progress dialog, orientation change - is there any 100% working solution? JavaScript function sometimes called, sometimes not Avoiding race conditions in Google Analytics asynchronous tracking Ajax Call Sometimes Works, Sometime works and refreshes, Sometimes refreshes and fails …? Is AsyncTask really conceptually flawed or am I just missing something? 4
  • 6. “Hello World” of web page concurrency <html><body> <script> var v=undefined; </script> <img src="img1.png" onload="v='Hi!';"> <img src="img2.png" onload="alert(v);"> </body></html> Browser Server fetch img1.png fetch img2.png load img1.png load img2.png v:undefined v:’Hi!’ Hi! 5
  • 7. Bad interleaving <html><body> <script> var v=undefined; </script> <img src="img1.png" onload="v='Hi!';"> <img src="img2.png" onload="alert(v);"> </body></html> Browser Server fetch img1.png fetch img2.png load img2.png v:undefined undefined 5
  • 8. Understanding the problem <html><body> <script> var v=undefined; </script> <img src=”img1.png” onload=”v=’Hi!’;”> <img src=”img2.png” onload=”alert(v);”> </body></html> Event Actions 6
  • 9. Understanding the problem <html><body> <script> var v=undefined; </script> <img src=”img1.png” onload=”v=’Hi!’;”> <img src=”img2.png” onload=”alert(v);”> </body></html> Event Actions Happens-before 6
  • 10. Understanding the problem <html><body> <script> var v=undefined; </script> <img src=”img1.png” onload=”v=’Hi!’;”> <img src=”img2.png” onload=”alert(v);”> </body></html> Race write v read v Event Actions Happens-before 6
  • 12. EventRacer end-to-end System Instrumented System Execution Trace Happens-before Graph Race Detector ? ? ? Race Explorer Race Filtering and Grouping Android App, Web Page 7
  • 13. EventRacer end-to-end System DOM nodes and attributes <img id="img1" src="img1.png" onload="v='Hi!';"> <script> document.getElementById("img1") .addEventListener("click", f); </script> ↦ write(#img1) ↦ write(#img1.onload) ↦ read(#img1) ↦ write(#img1.click) Instrumented System Execution Trace What are the memory locations on which asynchronous events can race? JS variables, functions, arrays <script> v='Hi!'; function f() {} messages[2] = 42; </script> ↦ write(v) ↦ write(f) ↦ write(messages[2]) Happens-before Graph Race Detector ? ? ? Race Explorer Race Filtering and Grouping Android App, Web Page 8
  • 14. EventRacer end-to-end System Instrumented System Web - parsing an HTML element - executing a script - handling user input - ... <script> var v=undefined; </script> <img src=”img1.png” onload=”v=’Hi!’;”> <img src=”img2.png” onload=”alert(v);”> Execution Trace What are the atomic events used in event-driven applications? Happens-before Graph Race Detector ? ? ? Race Explorer Race Filtering and Grouping Android App, Web Page 9
  • 15. EventRacer end-to-end System Happens-before <script> var v=undefined; </script> Happens-before <img src=”img1.png” onload=”v=’Hi!’;”> <img src=”img2.png” onload=”alert(v);”> Instrumented System Execution Trace What is the event happens-before? Web setInterval, SetTimeout, AJAX, … Android postDelayed, postAtFront, postIdle, ... Graph Race Detector ? ? ? Race Explorer Race Filtering and Grouping Android App, Web Page 10
  • 16. EventRacer end-to-end System <script> var v=undefined; </script> Race write v <img src=”img1.png” onload=”v=’Hi!’;”> <img src=”img2.png” onload=”alert(v);”> read v Instrumented System Execution Trace How to make scalable race detection in event-based setting? (Naive algorithms have asymptotic complexity O(N3) and require O(N2) space) State of the art EventRacer runtime TIMEOUT 2.4sec memory 25181MB 171MB Happens-before Graph Race Detector ? ? ? Race Explorer Race Filtering and Grouping Android App, Web Page 11
  • 17. EventRacer end-to-end System Is the system effective at finding harmful races while reporting few benign races? We filter common classes of benign races: commutative operations, recycled objects, lazy initialization, local reads, ... Web Android # races found 646 1328 # races reported 17.3 13 reduction 37x 100x Instrumented System Execution Trace Happens-before Graph Race Detector ? ? ? Race Explorer Race Filtering and Grouping Android App, Web Page 13
  • 18. Manual evaluation Fortune 100 Web Pages 25% 17.3% synchronization races various idioms: ✓ if (ready) … ✓ try { … } catch { retry } ✓ array of callbacks ✓ etc. harmless races ✓ commutative operations ✓ benign races ✓ framework related Web (314 reports) Harmful bugs ✓ unhandled exceptions ✓ UI glitches ✓ broken analytics ✓ page needs refresh to work normally Android (104 reports) 8 Play Store Applications 14 24.6% 58.4% 17% 57.7%
  • 19. Simple GPS Tracker protected void onCreate() { locationManager.requestLocationUpdates(GPS_PROVIDER, 0, 0, mListener); mDbHelper = new SQLiteOpenHelper(this, DB_NAME, DB_VERSION); } LocationListener mListener = new LocationListener() { public void onLocationChanged(Location location) { //show location on map mDbHelper.getWritableDatabase().insert(loc); } }; protected void onStop() { locationManager.removeUpdates(mListener); mDbHelper.close(); } 15
  • 20. Simple GPS Tracker protected void onCreate() { locationManager.requestLocationUpdates(GPS_PROVIDER, 0, 0, mListener); mDbHelper = new SQLiteOpenHelper(this, DB_NAME, DB_VERSION); } LocationListener mListener = new LocationListener() { public void onLocationChanged(Location location) { //show location on map mDbHelper.getWritableDatabase().insert(loc); } }; protected void onStop() { locationManager.removeUpdates(mListener); mDbHelper.close(); } 15 public void removeUpdates (LocationListener listener) Added in API level 1 Removes all location updates for the specified LocationListener. Following this call, updates will no longer occur for this listener.
  • 22. Analysis Results onLocationChanged and onStop are reported as not ordered event 1 source async IPC, interface(android.location.ILocationListener), code(onLocationChanged)) event 2 source async IPC, interface(android.app.IApplicationThread), code (SCHEDULE_STOP_ACTIVITY)) →calling context Landroid/database/sqlite/SQLiteDatabase;.insert(...) →calling context Landroid/database/sqlite/SQLiteClosable;.close(...) → UPDATE-UPDATE - 63568 Landroid/database/sqlite/SQLiteConnectionPool;.mAvailablePrimaryConnection → READ-UPDATE - 63568 Landroid/database/sqlite/SQLiteConnectionPool;.mIsOpen → READ-UPDATE - 63576 Landroid/database/sqlite/SQLiteConnection;.mConnectionPtr → READ-UPDATE - 63576 Landroid/database/sqlite/SQLiteConnection;.mPreparedStatementPool 16
  • 23. Is the Alternative Interleaving Feasible? D/GPS: onCreate D/GPS: insert: Location[gps 47.284646,8.632389 acc=10 et=0 vel=2.0 mock] D/GPS: insert: Location[gps 47.284656,8.632598 acc=10 et=0 vel=2.0 mock] D/GPS: insert: Location[gps 47.284712,8.632722 acc=10 et=0 vel=2.0 mock] D/GPS: insert: Location[gps 47.284832,8.632837 acc=10 et=0 vel=2.0 mock] D/GPS: onStop D/GPS: insert: Location[gps 47.285022,8.633205 acc=10 et=0 vel=2.0 mock] E/AndroidRuntime: FATAL EXCEPTION: main E/AndroidRuntime: Process: com.example.gps, PID: 2249 E/AndroidRuntime: java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/data/com.example.gps/test.db 16
  • 24. Current Directions Google Chromium port V8 javascript engine instrumentation Testing tools based on EventRacer Integration with Selenium PhantomJS Application for Parallelization Other Application Domains (beyond Web Pages, Android) Node.js 17
  • 25. www.eventracer.org Martin Vechev, Veselin Raychev, Pavol Bielik Anders Møller, Casper Jensen Manu Sridharan Boris Petrov, Yasen Trifonov Julian Dolby Instrumented System Execution Trace Happens-before Graph Race Detector ? ? ? Race Explorer Race Filtering and Grouping Android App, Web Page