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

cloud/awscloud: fix nil pointer dereference #4283

Merged
merged 1 commit into from
Aug 1, 2024

Commits on Jul 31, 2024

  1. cloud/awscloud: fix nil pointer dereference

    When the cleanup function gets called, there's a chance the Instnace
    field isn't populated yet, so store the instance ID separately and wait
    for it to be terminated in case it's present.
    
    The error would produce the following trace:
    ```
    goroutine 1 [running]:
    ...
    main.(*OSBuildJobImpl).Run.func1()
        osbuild/osbuild-composer/cmd/osbuild-worker/jobimpl-osbuild.go:404 +0xc5
    panic({0x55e2a76a1e40?, 0x55e2a906d2f0?})
        /usr/lib/golang/src/runtime/panic.go:920 +0x270
    github.com/osbuild/osbuild-composer/internal/cloud/awscloud.(*AWS).deleteFleetIfExists(0xc000faa840, 0xc0012718c0)
        osbuild/osbuild-composer/internal/cloud/awscloud/secure-instance.go:441 +0x175
    github.com/osbuild/osbuild-composer/internal/cloud/awscloud.(*AWS).TerminateSecureInstance(0x55e2a90825e0?, 0x2?)
        osbuild/osbuild-composer/internal/cloud/awscloud/secure-instance.go:192 +0x1d
    github.com/osbuild/osbuild-composer/internal/cloud/awscloud.(*AWS).RunSecureInstance.func1()
        osbuild/osbuild-composer/internal/cloud/awscloud/secure-instance.go:75 +0x69
    github.com/osbuild/osbuild-composer/internal/cloud/awscloud.(*AWS).RunSecureInstance(0xc000faa840, {0xc000afeade, 0x10}, {0x0, 0x0}, {0x0, 0x0}, {0xc001120f30, 0x24})
        osbuild/osbuild-composer/internal/cloud/awscloud/secure-instance.go:169 +0x12a7
    ...
    ```
    croissanne committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    e52fd98 View commit details
    Browse the repository at this point in the history