All Projects → alexknvl → tracehash

alexknvl / tracehash

Licence: MIT License
Compress long exception traces down to short signatures

Programming Languages

java
68154 projects - #9 most used programming language
scala
5932 projects

Projects that are alternatives of or similar to tracehash

Bugsnag Node
[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 48 (+140%)
Mutual labels:  debugging, bugs
Bugsnag React Native
Error monitoring and reporting tool for native exceptions and JS errors in React Native apps
Stars: ✭ 374 (+1770%)
Mutual labels:  stacktrace, bugs
Bugsnag Android
Bugsnag crash monitoring and reporting tool for Android apps
Stars: ✭ 990 (+4850%)
Mutual labels:  debugging, bugs
Bugsnag Laravel
Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
Stars: ✭ 746 (+3630%)
Mutual labels:  debugging, bugs
stacktrace
Atom package to navigate stacktraces.
Stars: ✭ 35 (+75%)
Mutual labels:  stacktrace, debugging
Traceback with variables
Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
Stars: ✭ 509 (+2445%)
Mutual labels:  stacktrace, debugging
Bugsnag Ruby
Bugsnag error monitoring & reporting software for rails, sinatra, rack and ruby
Stars: ✭ 211 (+955%)
Mutual labels:  debugging, bugs
py better exchook
nice Python exception hook replacement
Stars: ✭ 35 (+75%)
Mutual labels:  stacktrace, debugging
bugsnag-java
Bugsnag error reporting for Java.
Stars: ✭ 51 (+155%)
Mutual labels:  debugging, bugs
Clarify
Remove nodecore related stack trace noise
Stars: ✭ 140 (+600%)
Mutual labels:  stacktrace, debugging
gostackparse
Package gostackparse parses goroutines stack traces as produced by panic() or debug.Stack() at ~300 MiB/s.
Stars: ✭ 88 (+340%)
Mutual labels:  stacktrace, debugging
madbomber
Backtrace-on-throw C++ exception logger
Stars: ✭ 17 (-15%)
Mutual labels:  stacktrace, debugging
VxFuzz
Some VxWorks fuzzing examples using Cisco-Kitty and WDBDbg framework
Stars: ✭ 16 (-20%)
Mutual labels:  fuzzing
papers-as-modules
Software Papers as Software Modules: Towards a Culture of Reusable Results
Stars: ✭ 18 (-10%)
Mutual labels:  fuzzing
php-stacktrace
Read stacktrace from outside PHP process
Stars: ✭ 40 (+100%)
Mutual labels:  stacktrace
UltimateCMSWordlists
📚 An ultimate collection wordlists of the best-known CMS
Stars: ✭ 54 (+170%)
Mutual labels:  fuzzing
bugsnag-symfony
Bugsnag notifier for the Symfony PHP framework. Monitor and report errors in your Symfony apps.
Stars: ✭ 42 (+110%)
Mutual labels:  bugs
es6-debug-webstorm
How to debug ES6 in Webstorm (using gulp)
Stars: ✭ 60 (+200%)
Mutual labels:  debugging
injectURLProtocol
cycript script for injecting a custom NSURLProtocol into a running application
Stars: ✭ 25 (+25%)
Mutual labels:  debugging
fuzzing
Easy fuzzing with go-fuzz
Stars: ✭ 15 (-25%)
Mutual labels:  fuzzing

TraceHash

TraceHash hashes your exceptions into exception signatures that formalize the intuitive notion of "exception sameness": exceptions with the same signature are normally considered "the same" (e.g. when filing bug reports).

Usage

tracehash.stackTraceHash(exception)
// will produce something like
// "SOE-b33ffcec6a101750802bcebecae59e6a657145aa"
// or "IOOBE-1b4035e1d5b6023ecd1ef2673278057b5a3bb44c"

Motivation

Say you are fuzzing a Java application, and find an AssertionError:

java.lang.AssertionError: assertion failed: position error: position not set for Ident(<error>) # 5299
        at scala.Predef$.assert(Predef.scala:219)
        at dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:179)
        at dotty.tools.dotc.ast.Positioned.$anonfun$checkPos$4(Positioned.scala:203)
        at dotty.tools.dotc.ast.Positioned.$anonfun$checkPos$4$adapted(Positioned.scala:203)
        at scala.collection.immutable.List.foreach(List.scala:389)
        at dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:203)
        at dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:216)
        ....

If the same AssertionError happens with a different input file, the two errors are probably related, and you should only file one issue for both of them. But what exactly do we mean by "same error"? What algorithm should we use to compare different exception traces?

Should we compare the entire stacktrace? No, folklore and experience tells us that only the last few stacktrace entries are important.

Should we compare exception messages? Unless we can inspect the code generating messages, we don't know which parts of the message stay constant and which depend on a particular fuzzer input or change non-deterministically.

Should we compare line numbers? If someone changes one of the files appearing in the stacktrace without fixing the error, line numbers might change, but the error won't. Therefore, we should not take line numbers into account.

Should we compare file names? File names are less important than class names, especially in Scala, where a single file can contain multiple classes.


TraceHash would simplify the above exception down to:

java.lang.AssertionError
        at scala.Predef$.assert
        at dotty.tools.dotc.ast.Positioned.check$1
        at dotty.tools.dotc.ast.Positioned.$anonfun$checkPos$4
        at dotty.tools.dotc.ast.Positioned.$anonfun$checkPos$4$adapted
        at scala.collection.immutable.List.foreach

and then hash it using SHA-1.

Stack overflows

Special care needs to be taken to simplify StackOverflowException, such as:

java.lang.StackOverflowError
        at dotty.tools.dotc.core.Types$TypeProxy.superType(Types.scala:1460)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:192)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:182)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:192)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:178)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:192)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:182)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:192)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:178)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:192)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:182)

We can see that this stacktrace consists of a repeating fragment of length 11:

        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:182)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:192)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1(TypeApplications.scala:178)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:171)

and a prefix of length 1:

        at dotty.tools.dotc.core.Types$TypeProxy.superType(Types.scala:1460)

Clearly, the prefix is not important, only the repeating fragment is.

Note that looking at the very end of a StackOveflowException stacktrace, we can not tell how the repeating fragment started. For instance, let's imagine that our stacktrace ends in d b a b c a b c a b c. We can not tell if the repeating fragment is a b c or b c a or c a b. In order to produce consistent signatures, TraceHash sorts all possible options in lexicographic order.

TraceHash would simplify the above exception stacktrace down to (modulo possible reordering of the entries as explained above):

java.lang.StackOverflowError
        at dotty.tools.dotc.util.Stats$.track
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1
        at dotty.tools.dotc.util.Stats$.track
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1
        at dotty.tools.dotc.util.Stats$.track
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension
        at dotty.tools.dotc.core.TypeApplications$.$anonfun$typeParams$extension$1
        at dotty.tools.dotc.util.Stats$.track
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].