question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trace exploration on the command-line

See original GitHub issue

TODOS

  • 1) Port existing trace tests (.tla/.cfg) to the old testing framework (some will have to be split into more than one test)
  • 2) No user will know what “FILTERED BY ALIAS” is. Can’t you subclass TLCStateInfo with AliasedTLCStateInfo that stores the original TLCState in addition to the TLCState that evalAlias creates. The generated spec can then be generated from the original TLCState.
\* INVARIANT definition
inv_16084900312813000 ==
~(
color = (
"FILTERED BY ALIAS"
)/\
tpos = (
"FILTERED BY ALIAS"
)/\
tcolor = (
"FILTERED BY ALIAS"
)/\
active = (
"FILTERED BY ALIAS"
)
)
  • 3) Change SpecTraceExpressionWriter to generate an module with name EWD840_TE (no timestap!) in EWD840_T_1234 that extends EWD840 and defines TraceExpression. The (root) module EWD840_T_1234 extends EWD840_TE. Users can then manually create EWD840_TE.tla that will take precedence over module EWD840_TE in EWD840_T_1234.tla and reuse the trace expressions in EWD840_TE.tla for N traces
  • 3) Change pattern for filename from Spec_EWD840_TE to EWD840_T_$SecondsSinceEpoch (perhaps milliseconds?)
  • 4) Move commas in TraceExpression alias stub to the beginning of the lines as discussed in the chat
  • 5) Meaningful example (users will wonder what x, ~y, and ENABLED actionName are) 5a) Generate a comment for ALIAS in the EWD840_T_1234.cfg similar to the one of the Toolbox. Tell the user what an ALIAS is. Mentions constant-, state-, and action-level formulas and, perhaps, warns about its current short-comings WRT error reporting (add a pointer to Github issue) 5b) Short reference in alias stub in module EWD840_TE that points the user to longer comment in EWD840_T_1234.cfg 5c) Users should also be made aware that they can remove the entries for the spec’s variables
  • 6) Prototype how well it works from a user perspective if EWD840_T_$SecondsSinceEpoch.cfg is prepended or appended to EWD840_T_$SecondsSinceEpoch.tla (monolith spec feature). Halves the number of EWD840_T_* files in the spec directory and tab-completion completes to EWD840_T_1234.tla that TLC accepts compared to EWD840_T_1234. (dangling dot) for which TLC fails
    • This would require users to pass -config EWD840_TTrace_1234.tla to TLC
    • Could be set by the VSCode extension, but we could also flip TLC’s default and let the in-spec config take precedence
  • 7) Human-readable formatting of INVARIANT definition (keep parentheses though!) Indent by at least one char to fix folding in VSCode extension
  • 8) Map TTrace action names to real/actual action names (this overlaps with/is related to adding action names to TLCExt!Trace)
  • 9) https://github.com/tlaplus/tlaplus/issues/547
  • 10) Serialize trace to json (blocked by https://github.com/tlaplus/CommunityModules/issues/29)
---- MODULE EWD840_TTrace_1608616544 ----
EXTENDS Toolbox, TLC, EWD840, Json, TLCExt

...

\* INVARIANT definition
inv_16086165457763000 ==
    ~(
        color = (
    (0 :> "white" @@ 1 :> "white" @@ 2 :> "white")
...
    )
    ) \/ /\ JsonSerialize("EWD840_TTrace_1608616544.json", Trace) \* String here generated by SpecTraceExpressionWriter
         /\ ~PrintT("Trace written to EWD840_TTrace_1608616544.json")

  • 11) Indent generated dev_of_1234 at the end of MySpec_TTrace_1234 to enable folding
  • 12) Command for VSCode extension to run the newest MySpec_TTrace_1234 spec
  • 13) Trigger deadlock instead of artificial invariant violation in MySpec_TTrace_1234 when ``MySpec` deadlocked
  • 14) Pass -noGenerateSpecTe when TLC is run from the Toolbox (Toolbox has not been ported to new trace exploration)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
lemmycommented, Aug 4, 2021

I declare victory! Thanks @quaeler, @ahelwer, and @pfeodrippe

markus@banana:~/src/TLA/_specs/models/tutorials/BlockingQueueTLA(master)$ tlc BlockingQueue
TLC2 Version 2.16 of Day Month 20?? (rev: ed11002)
Running breadth-first search Model-Checking with fp 26 and seed -3482327644467237601 with 1 worker on 16 cores with 7054MB heap and 64MB offheap memory [pid: 259327] (Linux 5.8.0-63-generic amd64, Ubuntu 11.0.11 x86_64, MSBDiskFPSet, DiskStateQueue).
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue.tla
Parsing file /tmp/Naturals.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Naturals.tla)
Parsing file /tmp/Sequences.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Sequences.tla)
Parsing file /tmp/FiniteSets.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/FiniteSets.tla)
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/TLAPS.tla
Semantic processing of module Naturals
Semantic processing of module Sequences
Semantic processing of module FiniteSets
Semantic processing of module TLAPS
Semantic processing of module BlockingQueue
Starting... (2021-08-04 15:22:10)
Implied-temporal checking--satisfiability problem has 1 branches.
Computing initial states...
Finished computing initial states: 1 distinct state generated at 2021-08-04 15:22:10.
Progress(16) at 2021-08-04 15:22:10: 12,313 states generated, 1,600 distinct states found, 0 states left on queue.
Checking temporal properties for the complete state space with 1600 total distinct states at (2021-08-04 15:22:10)
Error: Temporal properties were violated.

Error: The following behavior constitutes a counter-example:

State 1: <Initial predicate>
/\ buffer = <<>>
/\ waitSet = {}

State 2: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2>>
/\ waitSet = {}

State 3: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3>>
/\ waitSet = {}

State 4: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {}

State 5: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {p1}

State 6: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {p1, p4}

State 7: <Get line 42, col 1 to line 47, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2>>
/\ waitSet = {p1}

State 8: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1}

State 9: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1, p3}

State 10: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1, p3, p4}

State 11: <Get line 42, col 1 to line 47, col 16 of module BlockingQueue>
/\ buffer = <<p2, p2>>
/\ waitSet = {p1, p3}

State 12: <Get line 42, col 1 to line 47, col 16 of module BlockingQueue>
/\ buffer = <<p2>>
/\ waitSet = {p1}

State 13: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3>>
/\ waitSet = {p1}

Back to state 5: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>

Finished checking temporal properties in 00s at 2021-08-04 15:22:11
12313 states generated, 1600 distinct states found, 0 states left on queue.
The depth of the complete state graph search is 16.
Finished in 00s at (2021-08-04 15:22:11)
Trace exploration spec path: ./BlockingQueue_TTrace_1628115730.tla

markus@banana:~/src/TLA/_specs/models/tutorials/BlockingQueueTLA(master)$ tlc -config BlockingQueue_TTrace_1628115730.tla BlockingQueue_TTrace_1628115730.tla 
TLC2 Version 2.16 of Day Month 20?? (rev: ed11002)
Running breadth-first search Model-Checking with fp 54 and seed -3984587528130387867 with 1 worker on 16 cores with 7054MB heap and 64MB offheap memory [pid: 259473] (Linux 5.8.0-63-generic amd64, Ubuntu 11.0.11 x86_64, MSBDiskFPSet, DiskStateQueue).
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue.tla
Parsing file /tmp/Sequences.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Sequences.tla)
Parsing file /tmp/TLCExt.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/TLCExt.tla)
Parsing file /tmp/BlockingQueue_TEConstants.tla (/home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla)
Parsing file /tmp/Toolbox.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Toolbox.tla)
Parsing file /tmp/Naturals.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Naturals.tla)
Parsing file /tmp/TLC.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/TLC.tla)
Parsing file /tmp/FiniteSets.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/FiniteSets.tla)
Parsing file /tmp/BlockingQueue_TEExpression.tla (/home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla)
Parsing file /tmp/BlockingQueue_TETrace.tla (/home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla)
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/TLAPS.tla
Semantic processing of module Naturals
Semantic processing of module Sequences
Semantic processing of module FiniteSets
Semantic processing of module TLAPS
Semantic processing of module BlockingQueue
Semantic processing of module TLC
Semantic processing of module TLCExt
Semantic processing of module BlockingQueue_TEConstants
Semantic processing of module Toolbox
Semantic processing of module BlockingQueue_TEExpression
Semantic processing of module BlockingQueue_TETrace
Semantic processing of module BlockingQueue_TTrace_1628115730
Starting... (2021-08-04 15:22:34)
Implied-temporal checking--satisfiability problem has 1 branches.
Computing initial states...
Finished computing initial states: 1 distinct state generated at 2021-08-04 15:22:34.
Progress(13) at 2021-08-04 15:22:34: 14 states generated, 13 distinct states found, 0 states left on queue.
Checking temporal properties for the complete state space with 13 total distinct states at (2021-08-04 15:22:34)
Error: Temporal properties were violated.

Error: The following behavior constitutes a counter-example:

State 1: <Initial predicate>
/\ buffer = <<>>
/\ waitSet = {}

State 2: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2>>
/\ waitSet = {}

State 3: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2, p3>>
/\ waitSet = {}

State 4: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {}

State 5: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {p1}

State 6: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {p1, p4}

State 7: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p3, p2>>
/\ waitSet = {p1}

State 8: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1}

State 9: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1, p3}

State 10: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1, p3, p4}

State 11: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2, p2>>
/\ waitSet = {p1, p3}

State 12: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2>>
/\ waitSet = {p1}

State 13: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>
/\ buffer = <<p2, p3>>
/\ waitSet = {p1}

Back to state 5: <_next line 32, col 5 to line 40, col 41 of module BlockingQueue_TTrace_1628115730>

Finished checking temporal properties in 00s at 2021-08-04 15:22:34
14 states generated, 13 distinct states found, 0 states left on queue.
The depth of the complete state graph search is 13.
Finished in 00s at (2021-08-04 15:22:34)

markus@banana:~/src/TLA/_specs/models/tutorials/BlockingQueueTLA(master)$ diff BlockingQueue_TTrace_1628115730.tla BlockingQueue_TTrace_1628115730.tla.bak 
163c163
<     _init
---
>     Init
165a166,168
>     Next
> 
> ACTION_CONSTRAINT 

markus@banana:~/src/TLA/_specs/models/tutorials/BlockingQueueTLA(master)$ tlc -config BlockingQueue_TTrace_1628115730.tla BlockingQueue_TTrace_1628115730.tla 
TLC2 Version 2.16 of Day Month 20?? (rev: ed11002)
Running breadth-first search Model-Checking with fp 52 and seed 6070325493391033921 with 1 worker on 16 cores with 7054MB heap and 64MB offheap memory [pid: 259679] (Linux 5.8.0-63-generic amd64, Ubuntu 11.0.11 x86_64, MSBDiskFPSet, DiskStateQueue).
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue.tla
Parsing file /tmp/Sequences.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Sequences.tla)
Parsing file /tmp/TLCExt.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/TLCExt.tla)
Parsing file /tmp/BlockingQueue_TEConstants.tla (/home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla)
Parsing file /tmp/Toolbox.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Toolbox.tla)
Parsing file /tmp/Naturals.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/Naturals.tla)
Parsing file /tmp/TLC.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/TLC.tla)
Parsing file /tmp/FiniteSets.tla (jar:file:/opt/toolbox/tla2tools.jar!/tla2sany/StandardModules/FiniteSets.tla)
Parsing file /tmp/BlockingQueue_TEExpression.tla (/home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla)
Parsing file /tmp/BlockingQueue_TETrace.tla (/home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/BlockingQueue_TTrace_1628115730.tla)
Parsing file /home/markus/src/TLA/_specs/models/tutorials/BlockingQueueTLA/TLAPS.tla
Semantic processing of module Naturals
Semantic processing of module Sequences
Semantic processing of module FiniteSets
Semantic processing of module TLAPS
Semantic processing of module BlockingQueue
Semantic processing of module TLC
Semantic processing of module TLCExt
Semantic processing of module BlockingQueue_TEConstants
Semantic processing of module Toolbox
Semantic processing of module BlockingQueue_TEExpression
Semantic processing of module BlockingQueue_TETrace
Semantic processing of module BlockingQueue_TTrace_1628115730
Starting... (2021-08-04 15:23:14)
Implied-temporal checking--satisfiability problem has 1 branches.
Computing initial states...
Finished computing initial states: 1 distinct state generated at 2021-08-04 15:23:15.
Progress(13) at 2021-08-04 15:23:15: 93 states generated, 13 distinct states found, 0 states left on queue.
Checking temporal properties for the complete state space with 13 total distinct states at (2021-08-04 15:23:15)
Error: Temporal properties were violated.

Error: The following behavior constitutes a counter-example:

State 1: <Initial predicate>
/\ buffer = <<>>
/\ waitSet = {}

State 2: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2>>
/\ waitSet = {}

State 3: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3>>
/\ waitSet = {}

State 4: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {}

State 5: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {p1}

State 6: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3, p2>>
/\ waitSet = {p1, p4}

State 7: <Get line 42, col 1 to line 47, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2>>
/\ waitSet = {p1}

State 8: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1}

State 9: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1, p3}

State 10: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p3, p2, p2>>
/\ waitSet = {p1, p3, p4}

State 11: <Get line 42, col 1 to line 47, col 16 of module BlockingQueue>
/\ buffer = <<p2, p2>>
/\ waitSet = {p1, p3}

State 12: <Get line 42, col 1 to line 47, col 16 of module BlockingQueue>
/\ buffer = <<p2>>
/\ waitSet = {p1}

State 13: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>
/\ buffer = <<p2, p3>>
/\ waitSet = {p1}

Back to state 5: <Put line 34, col 1 to line 39, col 16 of module BlockingQueue>

Finished checking temporal properties in 00s at 2021-08-04 15:23:15
93 states generated, 13 distinct states found, 0 states left on queue.
The depth of the complete state graph search is 13.
Finished in 00s at (2021-08-04 15:23:15)
0reactions
lemmycommented, Apr 7, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use Tracert (TraceRoute) Command with Examples
The tracert (which is short for trace route) is a Windows network command-line utility used to help diagnose network routing issues.
Read more >
How to Run Traceroute on a Switch through the Command ...
This article provides instructions on how to run the traceroute command on your switch through the CLI.
Read more >
TraceView Command-Line Interface - Windows drivers
The TraceView command-line interface enables you to control the TraceView features from a Command Prompt window. The command-line interface ...
Read more >
Check-out Trace Utility Command-line Operations
In general, you can run the utility from the command line with default options as follows: CheckoutTraceDump.exe -go.
Read more >
Tracing an EXE with commandline arguments - GitHub
Sometimes you may want to trace an executable that needs some specific commandline arguments. Currently, you can set them in the Tiny Tracer ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found