Dash core dump on network monitoring script

Avid Seeker <[email protected]>
Newsgroups org.kernel.vger.dash
Message-ID <WgTCSYEuzKbHuKFOr2TSJ8vLHAP7U_I8xGdY6fJP0LpGnQlFT6wVBbQIlpKZxlVnzr_7odCse-q9myZj5yjrf9XKzKVFvCJsngYL723T4Co=@protonmail.com>
systemd-coredump[65616]: [🡕] Process 65608 (sb-nettraf) of user 1000 dumped core.

                                                 Stack trace of thread 65608:
                                                 #0  0x00007c545ec90278 n/a (libc.so.6 + 0x4a278)
                                                 #1  0x00005d3418d15df2 n/a (dash + 0x9df2)
                                                 #2  0x00005d3418d16057 n/a (dash + 0xa057)
                                                 #3  0x00005d3418d162e4 n/a (dash + 0xa2e4)
                                                 #4  0x00005d3418d16395 n/a (dash + 0xa395)
                                                 #5  0x00005d3418d16413 n/a (dash + 0xa413)
                                                 #6  0x00005d3418d15ecc n/a (dash + 0x9ecc)
                                                 #7  0x00005d3418d1673d n/a (dash + 0xa73d)
                                                 #8  0x00005d3418d20693 n/a (dash + 0x14693)
                                                 #9  0x00005d3418d1d5e0 n/a (dash + 0x115e0)
                                                 #10 0x00005d3418d13f57 n/a (dash + 0x7f57)
                                                 #11 0x00005d3418d13f57 n/a (dash + 0x7f57)
                                                 #12 0x00005d3418d14318 n/a (dash + 0x8318)
                                                 #13 0x00005d3418d13f57 n/a (dash + 0x7f57)
                                                 #14 0x00005d3418d13f57 n/a (dash + 0x7f57)
                                                 #15 0x00005d3418d13f1b n/a (dash + 0x7f1b)
                                                 #16 0x00005d3418d13f1b n/a (dash + 0x7f1b)
                                                 #17 0x00005d3418d13f1b n/a (dash + 0x7f1b)
                                                 #18 0x00005d3418d13f1b n/a (dash + 0x7f1b)
                                                 #19 0x00005d3418d14564 n/a (dash + 0x8564)
                                                 #20 0x00005d3418d1dae5 n/a (dash + 0x11ae5)
                                                 #21 0x00005d3418d13f57 n/a (dash + 0x7f57)
                                                 #22 0x00005d3418d16db9 n/a (dash + 0xadb9)
                                                 #23 0x00005d3418d20693 n/a (dash + 0x14693)
                                                 #24 0x00005d3418d1d5e0 n/a (dash + 0x115e0)
                                                 #25 0x00005d3418d13f57 n/a (dash + 0x7f57)
                                                 #26 0x00005d3418d1ca6a n/a (dash + 0x10a6a)
                                                 #27 0x00005d3418d10288 n/a (dash + 0x4288)
                                                 #28 0x00007c545ec6bcd0 n/a (libc.so.6 + 0x25cd0)
                                                 #29 0x00007c545ec6bd8a __libc_start_main (libc.so.6 + 0x25d8a)
                                                 #30 0x00005d3418d10435 n/a (dash + 0x4435)
                                                 ELF object binary architecture: AMD x86-64

The script is as follows:

#!/bin/sh

# Module showing network traffic. Shows how much data has been received (RX) or
# transmitted (TX) since the previous time this script ran. So if run every
# second, gives network traffic per second.

case $BLOCK_BUTTON in
	1) setsid -f "$TERMINAL" -e bmon ;;
	3) notify-send "🌐 Network traffic module" "🔻: Traffic received
🔺: Traffic transmitted" ;;
	6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

update() {
    sum=0
    for arg; do
        read -r i < "$arg"
        sum=$(( sum + i ))
    done
    cache=/tmp/${1##*/}
    [ -f "$cache" ] && read -r old < "$cache" || old=0
    printf %d\\n "$sum" > "$cache"
    printf %d\\n $(( sum - old ))
}

rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)

# shellcheck disable=SC2046,2183,2086
printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx $tx)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.