Skip to content

fix(get): ensure getRunCommand does not clobber ExitError's msg#4

Merged
bazaah merged 1 commit intomainfrom
fix/no-clobber-exit-err
Jun 26, 2025
Merged

fix(get): ensure getRunCommand does not clobber ExitError's msg#4
bazaah merged 1 commit intomainfrom
fix/no-clobber-exit-err

Conversation

@bazaah
Copy link

@bazaah bazaah commented Jun 26, 2025

Basically,

go-getter is masking the actual problem with incorrect handling of
program exit codes:

  1. They messed up err handling in get.go#L131-L140 1
  2. They eventually get around to calling syscall.WaitStatus.ExitStatus 2

Which returns -1 if the WaitStatus was something other than exited

So we revert to using the stdlib ProcessState.String() representation
of this error.


Internal-Id: ENG-119

@CLAassistant
Copy link

CLAassistant commented Jun 26, 2025

CLA assistant check
All committers have signed the CLA.

Basically,

go-getter is masking the actual problem with incorrect handling of
program exit codes:

1. They messed up err handling in get.go#L131-L140 [1]
2. They eventually get around to calling syscall.WaitStatus.ExitStatus [2]

Which returns -1 if the WaitStatus was something other than exited

So we revert to using the stdlib ProcessState.String() representation
of this error.

[1]: https://github.com/hashicorp/go-getter/blob/v1.7.8/get.go#L131-L140
[2]: https://cs.opensource.google/go/go/+/refs/tags/go1.24.4:src/syscall/syscall_linux.go;l=483-488
@bazaah bazaah force-pushed the fix/no-clobber-exit-err branch from 80fa662 to 79d18d3 Compare June 26, 2025 11:09
@bazaah bazaah requested review from aliscott and liamg June 26, 2025 11:25
@bazaah bazaah merged commit 31e0b36 into main Jun 26, 2025
1 of 5 checks passed
@bazaah bazaah deleted the fix/no-clobber-exit-err branch June 26, 2025 12:51
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