[debugsyms] Fix hang

fxrev.dev/446355 introduced a hang in the queue() function because we
allocate a channel of size N and then attempt to synchronously send 2*N
jobs on the channel, so we block when trying to send job N+1.

To fix this (and hopefully make the code more future-proof), append all
the jobs to a non-preallocated slice, and only allocate a channel
afterward using the length of the slice as the channel size.

I also added a test for the queue() function and ran debugsyms locally
to ensure this fixes the hangs.

Bug: 61846
Change-Id: Idaf18d9c4454d6f76063f3516dfa0a754d28d360
Reviewed-on: https://fuchsia-review.googlesource.com/c/tools/+/446440
Reviewed-by: Anthony Fandrianto <atyfto@google.com>
Commit-Queue: Oliver Newman <olivernewman@google.com>
4 files changed
tree: 09a45ac86ebddac433df695472a9d4d2514414de
  1. buildidtool/
  2. debugsyms/
  3. gndoc/
  4. godepfile/
  5. .gitignore
  6. go.mod
  7. go.sum
  8. manifest
  9. README.md
README.md

tools

All tools have been moved to fuchsia.git at https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/tools.