]> Cypherpunks repositories - gostls13.git/commitdiff
internal/fuzz: more debug logging
authorRoland Shoemaker <roland@golang.org>
Wed, 15 Mar 2023 23:44:36 +0000 (16:44 -0700)
committerRoland Shoemaker <roland@golang.org>
Thu, 16 Mar 2023 00:34:31 +0000 (00:34 +0000)
Change-Id: I2c36baf423dde419aaa940ce9308088f3bf431f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/476718
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
src/internal/fuzz/fuzz.go
src/internal/fuzz/worker.go

index ca5f82a1515ef793641f35d48b9a64b764e60913..8024ffb2b8c03344d2f29aed8d7cb557fadaf58f 100644 (file)
@@ -322,7 +322,6 @@ func CoordinateFuzzing(ctx context.Context, opts CoordinateFuzzingOpts) (err err
                                        if c.canMinimize() && result.canMinimize && c.crashMinimizing == nil {
                                                // Send back to workers to find a smaller value that preserves
                                                // at least one new coverage bit.
-
                                                c.queueForMinimization(result, keepCoverage)
                                        } else {
                                                // Update the coordinator's coverage mask and save the value.
@@ -822,8 +821,10 @@ func (c *coordinator) refillInputQueue() {
 func (c *coordinator) queueForMinimization(result fuzzResult, keepCoverage []byte) {
        if shouldPrintDebugInfo() {
                c.debugLogf(
-                       "queueing input for minimization, id: %s, crasher: %t",
+                       "queueing input for minimization, id: %s, parent: %s, keepCoverage: %t, crasher: %t",
                        result.entry.Path,
+                       result.entry.Parent,
+                       keepCoverage,
                        result.crasherMsg != "",
                )
        }
index 467c39bdc931ab936f62f56d580a953bf710ffb2..d40245a3f2f1e738a870bcfefb42b2451c36d28b 100644 (file)
@@ -216,6 +216,16 @@ func (w *worker) coordinate(ctx context.Context) error {
                                        result.crasherMsg = err.Error()
                                }
                        }
+                       if shouldPrintDebugInfo() {
+                               w.coordinator.debugLogf(
+                                       "input minimized, id: %s, original id: %s, crasher: %t, originally crasher: %t, minimizing took: %s",
+                                       result.entry.Path,
+                                       input.entry.Path,
+                                       result.crasherMsg != "",
+                                       input.crasherMsg != "",
+                                       result.totalDuration,
+                               )
+                       }
                        w.coordinator.resultC <- result
                }
        }