in reply to forked process silently dies without coredump. No clue what's going on

Your logging code is also broken. You are constructing an anonymous hash on line 11 to hold the load average information and storing a reference to that hash. You then store a new hash into the $load lexical on line 22, but the $dumper object still has a reference to the hash that was built on line 11, and will dump that hash again and again, with the old data. Line 32 correctly uses the latest information.

Either change line 22 to a slice assignment: (untested)

@{$load}{qw/avg_1 avg_5 avg_15/} = @avgs[LOADAVG_1MIN, LOADAVG_5MIN, L +OADAVG_15MIN];

... which will actually change the hash that $dumper knows about. (Also call $dumper->Reset as another monk mentioned.) Or use the same approach on line 23 as you use on line 32.

No idea why your program is bailing out; do you perhaps have a $SIG{__DIE__} handler active while this code is running that could be calling exit?

Replies are listed 'Best First'.
Re^2: forked process silently dies without coredump. No clue what's going on
by marcelser (Initiate) on Oct 31, 2019 at 12:08 UTC
    Yes you're perfectly right. I normally don't use the object oriented interface of Dumper Just the procedural one hence I missed that I passed the anonymous hash to the dumper which it still references even if I assign a new hash to $load. I actually changed the code to always use Data::Dumper->Dump() now, that's easier then updating the anonymous hash through a slice assignment As for the die handler. There is a overall die handler like this, could this be the source of the issues?
    $SIG{__DIE__} = sub { LOGDIE $@ };

      What does the sub LOGDIE do?