: A Concurrency-Agnostic Debugger An Example for Domain-Specific - - PowerPoint PPT Presentation

a concurrency agnostic debugger
SMART_READER_LITE
LIVE PREVIEW

: A Concurrency-Agnostic Debugger An Example for Domain-Specific - - PowerPoint PPT Presentation

: A Concurrency-Agnostic Debugger An Example for Domain-Specific Online Debugging C. Torres Lopez S. Marr D. Aumayr H. Mssenbck E. Gonzalez Boix IFIP WG 2.11, July 17-20, 2017, Koblenz What am I doing? A simple VM for all


slide-1
SLIDE 1

IFIP WG 2.11, July 17-20, 2017, Koblenz

Κόμπος: A Concurrency-Agnostic Debugger

An Example for Domain-Specific Online Debugging

  • H. Mössenböck
  • D. Aumayr
  • S. Marr
  • E. Gonzalez Boix
  • C. Torres Lopez
slide-2
SLIDE 2

What am I doing?

2

A simple VM for all concurrency models actors, CSP, STM, fork/join, data flow, threads+locks, … Ownership-based metaobject protocol Making dynamic languages fast, easily! (incl. metaobject protocols) Meta-Tracing vs. Par;al Evalua;on Combining Concurrency Models Tooling/Debugging

slide-3
SLIDE 3

For a brief bit of history: ENIAC’s recessive gene Marcus Mitch, and Akera Atsushi. Penn Printout (March 1996) h_p://www.upenn.edu/compu`ng/printout/archive/v12/4/pdf/gene.pdf

ENIAC's main control panel, U. S. Army Photo

slide-4
SLIDE 4

Decades of Research and Solu`ons for “Everything”

4

slide-5
SLIDE 5

But no Silver Bullet

CSP Locks, Monitors, … Fork/Join Transac;onal Memory

5

Data Flow Actors

slide-6
SLIDE 6

In Prac`ce: Concurrency Abstrac`ons are Combined

  • Uses Locks and Atomic*
  • Mul`ple async. future/

task abstrac`ons

  • Mul`ple ‘transac`on’

systems > 4500 “deadlock” bugs > 530 “race condi`on” bugs

6

Study on Scala:

  • S. Tasharofi, P. Dinges, and R. E. Johnson. Why Do Scala Developers Mix the Actor Model with other

Concurrency Models? In Proc. of ECOOP, volume 7920 of LNCS, pages 302–326. Springer, 2013.

slide-7
SLIDE 7

HOW TO DEBUG SUCH SYSTEMS?

I want to reason about actors, fork/join tasks, transac`ons… And not some implementa`on-level shared memory

7

slide-8
SLIDE 8

Demo of Kómpos

8

slide-9
SLIDE 9

Custom Debugger Features

Breakpoints Stepping Opera`ons Sequen`al 1 5 Generic 4 2 Actors 6 5 CSP 4 2 STM 3 3 Threads&Locks 4 2 22 19

(not intended to be complete)

slide-10
SLIDE 10

Debugger Architecture

10

Interpreter

Debugger Frontend

Debugger Protocol

slide-11
SLIDE 11

Kómpos Architecture

11

SOMNS Interpreter

Kómpos Debugger

Debugger Protocol

(Web Socket, JSON)

Actors CSP STM F/J Threads … Java, Truffle+Graal

slide-12
SLIDE 12

Kómpos Architecture

12

SOMNS Interpreter

Kómpos Debugger

Debugger Protocol

(Web Socket, JSON)

Actors CSP STM F/J Threads … Java, Truffle+Graal

22 Breakpoint Types 19 Stepping Opera`ons Various Visualiza`ons Breakpoint Support Stepping Support Visualiza`ons Support

How to Abstract from Concurrency Models?

slide-13
SLIDE 13

THE KÓMPOS PROTOCOL

A Concurrency-Agnos`c Debugger Protocol

13

slide-14
SLIDE 14

Abstract from Concurrency Models

14

  • Interac`ons modeled via data
  • Debugger agnos`c of concepts

SOMNS Interpreter

Kómpos Debugger

Debugger Interface

(Web Socket, JSON) Actors CSP STM F/J Threads …

  • Breakpoint Types
  • Stepping Opera`ons
  • Ac`vity Types, Dynamic scopes

Breakpoint Support Stepping Support Visualiza`ons Support

slide-15
SLIDE 15

What’s a Breakpoint?

  • Name/Type
  • Source Loca`ons

15

prom := aResult <-: get.

message send message receive promise resolver promise resolu`on Var Write Send #get Var Read

MsgSendTag

Truffle AST

§ Iden`fied by Source Tags

Debugger Requirements

§ Annotated AST

slide-16
SLIDE 16

What’s a Stepping Opera`on?

  • Name/Type
  • Source Loca`ons

– Iden`fied by Source Tags

16

prom := aResult <-: get.

Step to Receiver Step to Promise Resolver Step to Promise Resolu`on

  • Current Type of Ac`vity

– Actor, Process, Fork/Join Task, Thread

  • Current Dynamic Scope

– Held Monitor, Transac`on

Step into Return Step over

slide-17
SLIDE 17

Kómpos Protocol Metadata

17

EntityType id: typeId name: string ActivityType icon: string DynamicScopeType BreakpointType name: string label: string applicableTo: Tag[] SteppingType name: string label: string applicableTo: Tag[] activities: ActivityType[] scopes: DynamicScopeType[]

slide-18
SLIDE 18

Kómpos Protocol Messages

18

Source URI: URI sourceText: string locations: TaggedCoord[] BreakpointUpdate location: Coord type: BreakpointType Stopped activityId: id location: Coord actType: ActivityType scopes: DynamicScopeType[] Step activityId: id type: SteppingType

slide-19
SLIDE 19

tags: Atomic

Example for Transac`ons

19

atomic { int b = this.fieldB; this.fieldA = b + 1; }

before transac`on before commit awer commit to int: {BreakpointUpdate, loc: 1:1:6, type: beforeCommit} to int: {Step, actId: 1, type: afterCommit} from int: {Stopped, actId: 1, loc: 3:3:20, scopes: [tx]} resume step next step over before commit awer commit scopes: tx

slide-20
SLIDE 20

EVALUATION

How concurrency-agnos`c is the protocol design?

20

slide-21
SLIDE 21

Implemented Interac`ons No changes to frontend required!

Breakpoints Stepping Opera`ons

Sequen`al 1 5 Generic 4 2 Actors 6 5 CSP 4 2 STM 3 3 Threads&Locks 4 2 22 19

(not intended to be complete)

slide-22
SLIDE 22

CONCLUSION

22

slide-23
SLIDE 23

Too many Concepts, Too many Varia`ons

18/07/17 23

slide-24
SLIDE 24

Solu`on: Model Domain with Metadata

24

SOMNS Interpreter

Kómpos Debugger

Debugger Interface

(Web Socket, JSON) Actors CSP STM F/J Threads …

  • Breakpoint Types
  • Stepping Opera`ons
  • Ac`vity Types, Dynamic Scopes

Breakpoint Support Stepping Support Visualiza`ons Support

slide-25
SLIDE 25

25

Paper Deadline: 14 August 2017 Workshop Proposals: 1 October 2017

slide-26
SLIDE 26

Kómpos: Plaxorm for Debugging Complex Concurrent Applica`ons

  • Concurrent Debugger

– Concept-agnos`c

  • Visualiza`on,

Breakpoints, Stepping, Tracing

  • Replay, Asser`ons,…
  • For Actors, CSP,

Fork/Join, STM, Locks&Threads,…

26