Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: span use after finish crash #26715

Closed
andreimatei opened this issue Jun 13, 2018 · 2 comments
Closed

cli: span use after finish crash #26715

andreimatei opened this issue Jun 13, 2018 · 2 comments
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-2-temp-unavailability Temp crashes or other availability problems. Can be worked around or resolved by restarting.

Comments

@andreimatei
Copy link
Contributor

Sentry reports of the following. Must be logging with a context who's span has already been Finish()ed.

*log.safeError: panic.go:28: runtime.errorString: runtime error: index out of range
  File "github.com/cockroachdb/cockroach/vendor/golang.org/x/net/trace/trace.go", line 772, in addEvent
  File "github.com/cockroachdb/cockroach/vendor/golang.org/x/net/trace/trace.go", line 801, in LazyPrintf
  File "github.com/cockroachdb/cockroach/pkg/util/tracing/tracer_span.go", line 390, in LogFields
  File "github.com/cockroachdb/cockroach/pkg/util/log/trace.go", line 131, in eventInternal
  File "github.com/cockroachdb/cockroach/pkg/util/log/structured.go", line 153, in addStructured
  File "github.com/cockroachdb/cockroach/pkg/util/log/log.go", line 55, in logDepth
  File "github.com/cockroachdb/cockroach/pkg/util/log/log.go", line 61, in Shout
  File "github.com/cockroachdb/cockroach/pkg/cli/start.go", line 767, in runStart
  File "github.com/cockroachdb/cockroach/pkg/cli/error.go", line 39, in func1
  File "github.com/cockroachdb/cockroach/pkg/cli/error.go", line 101, in func1
  File "github.com/cockroachdb/cockroach/vendor/github.com/spf13/cobra/command.go", line 698, in execute
  File "github.com/cockroachdb/cockroach/vendor/github.com/spf13/cobra/command.go", line 783, in ExecuteC
  File "github.com/cockroachdb/cockroach/vendor/github.com/spf13/cobra/command.go", line 736, in Execute
  File "github.com/cockroachdb/cockroach/pkg/cli/cli.go", line 176, in Run
  File "github.com/cockroachdb/cockroach/pkg/cli/cli.go", line 54, in Main
  File "github.com/cockroachdb/cockroach/pkg/cmd/cockroach/main.go", line 29, in main
  File "runtime/proc.go", line 198, in main

In fact I think I see the problem. Fix incoming.

@andreimatei andreimatei added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-2-temp-unavailability Temp crashes or other availability problems. Can be worked around or resolved by restarting. A-cli labels Jun 13, 2018
@andreimatei andreimatei self-assigned this Jun 13, 2018
@andreimatei
Copy link
Contributor Author

Sentry issue: COCKROACHDB-H2

@andreimatei
Copy link
Contributor Author

Sentry issue: COCKROACHDB-G1

andreimatei added a commit to andreimatei/cockroach that referenced this issue Jun 13, 2018
We were using a long-gone context with a potentially finished span,
leading to log-after-finish crashes.

Fixes cockroachdb#26715

Release note: None
craig bot pushed a commit that referenced this issue Jun 14, 2018
26716: cli: use the right context for logging on signal r=andreimatei a=andreimatei

We were using a long-gone context with a potentially finished span,
leading to log-after-finish crashes.

Fixes #26715

Release note: None

Co-authored-by: Andrei Matei <[email protected]>
@craig craig bot closed this as completed in #26716 Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-2-temp-unavailability Temp crashes or other availability problems. Can be worked around or resolved by restarting.
Projects
None yet
Development

No branches or pull requests

1 participant