Skip to content

fix report concurrency crash when helm-diff used as a library #256

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

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

novas0x2a
Copy link
Contributor

@novas0x2a novas0x2a commented Jan 13, 2021

the Manifests codepath was calling setupReportFormat on a mutable global map,
which means that calling Manifests from different gothreads is an error,
and can produce a panic with this (abbreviated) traceback:

fatal error: concurrent map writes

goroutine 668 [running]:
runtime.throw(0x27cb973, 0x15)
 /usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc003a8c710 sp=0xc003a8c6e0 pc=0x437892
runtime.mapassign_faststr(0x23fc3a0, 0xc019650120, 0x27a837d, 0x6, 0xc00012f408)
 /usr/local/go/src/runtime/map_faststr.go:211 +0x3f1 fp=0xc003a8c778 sp=0xc003a8c710 pc=0x414811
github.com/databus23/helm-diff/v3/diff.setupDiffReport(...)
 /go/pkg/mod/github.com/databus23/helm-diff/v3@v3.1.3/diff/report.go:99
github.com/databus23/helm-diff/v3/diff.(*Report).setupReportFormat(0x3dafe80, 0x27a5ada, 0x4)
 /go/pkg/mod/github.com/databus23/helm-diff/v3@v3.1.3/diff/report.go:67 +0x111 fp=0xc003a8c7b0 sp=0xc003a8c778 pc=0x20e7291
github.com/databus23/helm-diff/v3/diff.Manifests(0xc009ffaf60, 0xc009ffb3e0, 0xc0061f73e0, 0x1, 0x1, 0xc0061f7300, 0x5, 0x27a5ada, 0x4, 0x2b26460, ...)

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 2, 2021
@databus23
Copy link
Owner

databus23 commented Jun 4, 2021

Ok, sorry for letting this slide. LGTM. Would you mind rebasing it so it can be merged.

@stale stale bot removed the stale label Jun 4, 2021
the Manifests codepath was calling setupReportFormat on a mutable global map,
which means that calling Manifests from different gothreads is an error,
and can produce a panic with this (abbreviated) traceback:

fatal error: concurrent map writes

goroutine 668 [running]:
runtime.throw(0x27cb973, 0x15)
 /usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc003a8c710 sp=0xc003a8c6e0 pc=0x437892
runtime.mapassign_faststr(0x23fc3a0, 0xc019650120, 0x27a837d, 0x6, 0xc00012f408)
 /usr/local/go/src/runtime/map_faststr.go:211 +0x3f1 fp=0xc003a8c778 sp=0xc003a8c710 pc=0x414811
github.com/databus23/helm-diff/v3/diff.setupDiffReport(...)
 /go/pkg/mod/github.com/databus23/helm-diff/v3@v3.1.3/diff/report.go:99
github.com/databus23/helm-diff/v3/diff.(*Report).setupReportFormat(0x3dafe80, 0x27a5ada, 0x4)
 /go/pkg/mod/github.com/databus23/helm-diff/v3@v3.1.3/diff/report.go:67 +0x111 fp=0xc003a8c7b0 sp=0xc003a8c778 pc=0x20e7291
github.com/databus23/helm-diff/v3/diff.Manifests(0xc009ffaf60, 0xc009ffb3e0, 0xc0061f73e0, 0x1, 0x1, 0xc0061f7300, 0x5, 0x27a5ada, 0x4, 0x2b26460, ...)
@novas0x2a
Copy link
Contributor Author

Rebased.

@novas0x2a
Copy link
Contributor Author

(ping @databus23)

@stale
Copy link

stale bot commented Oct 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 30, 2021
Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

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

Thanks for your patience! Merging.

@stale stale bot removed the stale label Jan 8, 2022
@mumoshu mumoshu merged commit 9f6eb58 into databus23:master Jan 8, 2022
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