[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
«run_pending_traps: bad value in trap_list» when `jobs` is run a trap
From: |
Gioele Barabucci |
Subject: |
«run_pending_traps: bad value in trap_list» when `jobs` is run a trap |
Date: |
Mon, 1 Jul 2024 22:45:54 +0200 |
User-agent: |
Mozilla Thunderbird |
Hi,
the following script (reduced from <https://bugs.debian.org/417946>)
#!/bin/bash
childfinished () { echo "jobs: $(jobs)"; }
trap childfinished SIGCHLD
sleep 1 &
wait
causes bash 5.2.21 to output
./par.sh: line 2: warning: run_pending_traps:
bad value in trap_list[17]: 0x5625e6fa43d0
Does this warning hint at something like a dangling reference that
should be fixed, or can it be safely ignored?
Modifying the trap to call `jobs` directly instead of in a subshell
makes the warning go away.
Regards,
--
Gioele Barabucci
- «run_pending_traps: bad value in trap_list» when `jobs` is run a trap,
Gioele Barabucci <=