cbmc-starter-kit
cbmc-starter-kit copied to clipboard
aws-c-common - run_cbmc_proofs failing at "Install latest CBMC" stage
The step install latest CBMC
in aws-c-common
's run_cbmc_proofs
CI workflow seems to be failing sporadically. Sometimes the failure disappears when the CI job is re-run but sometimes the failure does not disappear.
The error looks like:
jq: error (at <stdin>:1): Cannot index string with string "assets"
Error: Process completed with exit code 1.
Here's a link to a failed run: https://github.com/awslabs/aws-c-common/actions/runs/6043368449/job/16400257070?pr=1054
Currently, the latest CBMC is being installed this way:
https://github.com/model-checking/cbmc-starter-kit/blob/master/src/cbmc_starter_kit/template-for-ci-workflow/proof_ci.yaml#L64-L70
# Search within 5 most recent releases for latest available package
CBMC_REL="https://api.github.com/repos/diffblue/cbmc/releases?page=1&per_page=5"
CBMC_DEB=$(curl -s $CBMC_REL | jq -r '.[].assets[].browser_download_url' | grep -e 'ubuntu-20.04' | head -n 1)
CBMC_ARTIFACT_NAME=$(basename $CBMC_DEB)
curl -o $CBMC_ARTIFACT_NAME -L $CBMC_DEB
sudo dpkg -i $CBMC_ARTIFACT_NAME
rm ./$CBMC_ARTIFACT_NAME
The latest CBMC release can be fetched by sending a request to:
https://api.github.com/repos/diffblue/cbmc/releases/latest
The response needs to be parsed with jq
differently. The asset, whose name starts with/contains "ubuntu-20.04" is the asset whose browser_download_url
is needed for the subsequent curl -o
command
An attempt fix of this issue: https://github.com/awslabs/aws-c-common/pull/1057.
The same failure is also observed in s2n-tls: https://github.com/aws/s2n-tls/pull/4223