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

Do not segfault on hard stop #23666

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Aug 19, 2024

Podman machine on MAC can segfault on hard stop.

Fixes: #23654

Does this PR introduce a user-facing change?

None

Copy link
Contributor

openshift-ci bot commented Aug 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2024
@rhatdan
Copy link
Member Author

rhatdan commented Aug 19, 2024

@containers/podman-maintainers PTAL

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM to fix the panic but I do wonder if we do not have to check the http result here.

@baude should this check if http status is success at least?

@rhatdan rhatdan added the No New Tests Allow PR to proceed without adding regression tests label Aug 19, 2024
Podman machine on MAC can segfault on hard stop.

Fixes: 23654

Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan
Copy link
Member Author

rhatdan commented Aug 19, 2024

Since lots of tests are failing, going back to ignoring error.

@mheon
Copy link
Member

mheon commented Aug 19, 2024

LGTM

@@ -83,7 +83,9 @@ func (vf *Helper) stateChange(newState rest.StateChange) error {
}
payload := bytes.NewReader(b)
serverResponse, err := vf.post(vf.Endpoint+state, payload)
_ = serverResponse.Body.Close()
if err == nil {
_ = serverResponse.Body.Close()
Copy link
Member

Choose a reason for hiding this comment

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

do you need to check if serverResponse is nil and/or the Body?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so, unless we have to check this everywhere. v.get() as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

if vf.post() returns an error then serverResponse is nil. I would think client.Do(req) will return the correct serverResponse or nil with an err.

Copy link
Member

Choose a reason for hiding this comment

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

yeah checking the error alone should be fine

@rhatdan rhatdan added the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 426aac3 into containers:main Aug 19, 2024
91 of 92 checks passed
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 18, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine No New Tests Allow PR to proceed without adding regression tests release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman machine stop SIGSEGV when performing hard stop
4 participants