VisionSystemsInc / VisionSystemsInc/vsi_common
signal_tools.bsh:trap_chain
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 8
- Forks
- 9
- Avg merge
- 36m
- Merged PRs (30d)
- 1
Description
If I run make_temp_path TMP_DIR in a just target, this line causes a trap when run via just.
Adding set -xv right before that line produces this
trap '' "${2}"; trap -p "${2}" | { read x ; echo "${x##* }"; }
++ trap '' EXIT
++ trap -p EXIT
++ read x
print_error "${BASH_SOURCE[0]}" "${LINENO}"
+++ print_error /Users/sgrichar/terra/external/vsi_common/linux/signal_tools.bsh 76
[snip]
The fix (66291fe) is simple, although why that fixes the problem is not clear:
- last_info="$(trap '' "${2}"; trap -p "${2}" | { read x ; echo "${x##* }"; })"
+ last_info="$((trap '' "${2}"; trap -p "${2}") | { read x ; echo "${x##* }"; })"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to linux/signal_tools.bsh around line 75 and shows a reproduction through a just target. Read trap_chain and reproduce with make_temp_path TMP_DIR under just, then compare the reported trap behavior with the proposed one-line change and verify that the target no longer traps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, shell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 40/100