Skip to content

log: fix call depth for go1.12 panics#36144

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/log-failure-in-112
Mar 26, 2019
Merged

log: fix call depth for go1.12 panics#36144
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/log-failure-in-112

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

This PR fixes the following test failure on Linux:

$ make test IGNORE_GOVERS=1 PKG=./pkg/util/log
--- FAIL: TestCrashReportingPacket (0.20s)
    --- FAIL: TestCrashReportingPacket/#00 (0.00s)
        crash_reporting_packet_test.go:155: expected crash_reporting_packet_test.go:85: boom, got testing.go:865: boom
    --- FAIL: TestCrashReportingPacket/#01 (0.00s)
        crash_reporting_packet_test.go:155: expected crash_reporting_packet_test.go:93: baam, got testing.go:865: baam
FAIL

Interestingly this is not quite the same failure noted in #35792, maybe that's
MacOS specific?

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

// - panic.go // not present in go1.12
// - panic()
// so ReportPanic should pop four frames.
if ver := runtime.Version(); strings.HasPrefix(ver, "go1.12") {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could see doing something fancier here like parsing into an integer. Feedback appreciated.

Copy link
Copy Markdown
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/util/log/crash_reporting.go, line 96 at r1 (raw file):

Previously, ajwerner wrote…

I could see doing something fancier here like parsing into an integer. Feedback appreciated.

This is ugly. I don't have any better ideas, though. I suppose you could do this statically with build tags.

@ajwerner ajwerner force-pushed the ajwerner/log-failure-in-112 branch 2 times, most recently from 62a4745 to 420b4b3 Compare March 26, 2019 14:58
This PR fixes the following test failure on Linux:

```
$ make test IGNORE_GOVERS=1 PKG=./pkg/util/log
--- FAIL: TestCrashReportingPacket (0.20s)
    --- FAIL: TestCrashReportingPacket/#00 (0.00s)
        crash_reporting_packet_test.go:155: expected crash_reporting_packet_test.go:85: boom, got testing.go:865: boom
    --- FAIL: TestCrashReportingPacket/#1 (0.00s)
        crash_reporting_packet_test.go:155: expected crash_reporting_packet_test.go:93: baam, got testing.go:865: baam
FAIL
```

Interestingly this is not quite the same failure noted in cockroachdb#35792, maybe that's
MacOS specific?

Release note: None
@ajwerner ajwerner force-pushed the ajwerner/log-failure-in-112 branch from 420b4b3 to 84bd549 Compare March 26, 2019 15:00
@ajwerner
Copy link
Copy Markdown
Contributor Author

This is ugly. I don't have any better ideas, though. I suppose you could do this statically with build tags.

The build tags worked better than I had expected given "go1.12", from Go version 1.12 onward

Updated accordningly.

Copy link
Copy Markdown
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)

@ajwerner
Copy link
Copy Markdown
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Mar 26, 2019
36144: log: fix call depth for go1.12 panics r=ajwerner a=ajwerner

This PR fixes the following test failure on Linux:

```
$ make test IGNORE_GOVERS=1 PKG=./pkg/util/log
--- FAIL: TestCrashReportingPacket (0.20s)
    --- FAIL: TestCrashReportingPacket/#00 (0.00s)
        crash_reporting_packet_test.go:155: expected crash_reporting_packet_test.go:85: boom, got testing.go:865: boom
    --- FAIL: TestCrashReportingPacket/#1 (0.00s)
        crash_reporting_packet_test.go:155: expected crash_reporting_packet_test.go:93: baam, got testing.go:865: baam
FAIL
```

Interestingly this is not quite the same failure noted in #35792, maybe that's
MacOS specific?

Release note: None

Co-authored-by: Andrew Werner <ajwerner@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 26, 2019

Build succeeded

@craig craig bot merged commit 84bd549 into cockroachdb:master Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants