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

fix: move lockMap initialization into InitializeCloudFromConfig func to fix panic #5466

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

andyzhangx
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

fix: move lockMap initialization into InitializeCloudFromConfig func to fix panic

InitializeCloudFromConfig is more fundamental function and called by azure file driver directly, this PR fixes the panic in azure file driver:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1c0a28b]
goroutine 148 [running]:
sigs.k8s.io/cloud-provider-azure/pkg/provider.(*LockMap).LockEntry(0x0, {0xc00077083f, 0x17})
	/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go:64 +0x2b
sigs.k8s.io/cloud-provider-azure/pkg/provider.(*Cloud).RemoveStorageAccountTag(0xc000548408, {0x2965f88, 0xc000283860}, {0xc00056c9c0, 0x24}, {0xc000770800, 0x3e}, {0xc00077083f, 0x17}, {0x25edeec, ...})
	/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go:744 +0x98
sigs.k8s.io/azurefile-csi-driver/pkg/azurefile.(*Driver).RemoveStorageAccountTag(0xc00054e008, {0x2965f88, 0xc000283860}, {0xc00056c9c0, 0x24}, {0xc000770800, 0x3e}, {0xc00077083f, 0x17}, {0x25edeec, ...})
	/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/azurefile.go:1096 +0x514
sigs.k8s.io/azurefile-csi-driver/pkg/azurefile.(*Driver).DeleteVolume(0xc00054e008, {0x2965f88, 0xc000283860}, 0xc0005c9f40)
	/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/controllerserver.go:716 +0xc10
github.com/container-storage-interface/spec/lib/go/csi._Controller_DeleteVolume_Handler.func1({0x2965f88?, 0xc000283860?}, {0x245e260?, 0xc0005c9f40?})
	/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go:6438 +0xcb
sigs.k8s.io/azurefile-csi-driver/pkg/csi-common.LogGRPC({0x2965f88, 0xc000283860}, {0x245e260, 0xc0005c9f40}, 0xc0002a73e0, 0xc0006edce0)
	/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/csi-common/utils.go:103 +0x392
github.com/container-storage-interface/spec/lib/go/csi._Controller_DeleteVolume_Handler({0x25aa720, 0xc00054e008}, {0x2965f88, 0xc000283860}, 0xc000352b80, 0x2718d10)

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix: move lockMap initialization into InitializeCloudFromConfig func to fix panic

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

fix: move lockMap initialization into InitializeCloudFromConfig func to fix panic

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Feb 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 19, 2024
@andyzhangx
Copy link
Member Author

/retest

@MartinForReal
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2024
@nilo19
Copy link
Contributor

nilo19 commented Feb 20, 2024

The lockmap will be nil from newcloudfromsecret.

@MartinForReal MartinForReal removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2024
@nilo19
Copy link
Contributor

nilo19 commented Feb 20, 2024

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 20, 2024
@andyzhangx
Copy link
Member Author

The lockmap will be nil from newcloudfromsecret.

@nilo19 I have made a change to check lockMap whether it's nil, PTAL, thanks.

@nilo19
Copy link
Contributor

nilo19 commented Feb 20, 2024

/hold cancel
/lgtm

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 20, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2024
@k8s-ci-robot
Copy link
Contributor

@andyzhangx: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cloud-provider-azure-e2e-ccm-capz 5fb2085 link true /test pull-cloud-provider-azure-e2e-ccm-capz
pull-cloud-provider-azure-e2e-ccm-vmss-capz 5fb2085 link true /test pull-cloud-provider-azure-e2e-ccm-vmss-capz
pull-cloud-provider-azure-e2e-ccm-vmssflex-capz acc0b84 link true /test pull-cloud-provider-azure-e2e-ccm-vmssflex-capz

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@andyzhangx
Copy link
Member Author

/retest

@andyzhangx andyzhangx merged commit b76605c into kubernetes-sigs:master Feb 20, 2024
13 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants