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

bug: chalk hanging on chalking jar files with cosign #225

Closed
indecisivedragon opened this issue Feb 28, 2024 · 0 comments · Fixed by #229
Closed

bug: chalk hanging on chalking jar files with cosign #225

indecisivedragon opened this issue Feb 28, 2024 · 0 comments · Fixed by #229
Assignees
Labels
bug Something isn't working P0 Priority 0 (lower is higher)

Comments

@indecisivedragon
Copy link
Contributor

indecisivedragon commented Feb 28, 2024

Description

Initially reported by @thc202, debugging with @miki725 and @indecisivedragon. @miki725 was unable to reproduce locally but I was.

Running chalk insert on a .jar file with cosign enabled results in chalk hanging, suspected cause is file descriptor issue on read but not sure exactly.

Impact

Chalking java projects is def broken, so holding up all the zap work. Also may be some bigger bugs in the underlying file descriptor code that we are passing around when we call cosign.

Steps to Reproduce

  1. build chalk latest
  2. run chalk setup to generate keypairs (+ copy down the password)
  3. CHALK_PASSWORD=[password] ./chalk insert --trace --config-file=cosign.c4m test_zap/zap-2.15.0-SNAPSHOT.jar (or whatever .jar file you happen to have handy. The files that I tested against were too large to be uploaded to github so ping me on slack if you need them because slack doesn't care.
  4. observe chalk hangs

Other Information

The arguments passed to cosign via chalk are:

trace: @["sign-blob", "--tlog-upload=false", "--yes", "--key", "chalk.key", "-"]

with blob:

trace: 72a4f5fb2eeaa82e24302ebe2d320a1f3016be091f7690f9e538a3a6755ca22f1514536cd37096634d9582923a094d543d9941da81b4858ca023c6a9b6fc3bfb

and default cosign location found in PATH. Calling cosign manually with this input does NOT cause cosign to fail or hang, so this is not a cosign error.

After some debugging, it looks like we are hanging somewhere in sb_operate_switchboard function in nimutils/c/switchboard.c, so this looks likely to be a nimutils error. The select statement seems to be returning a -1 with bad file descriptor error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Priority 0 (lower is higher)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants