redbug
redbug copied to clipboard
redbug_dtop: don't crash when racing with process termination
If a process terminates between the list of processes is retrieved in get_prc_data/1 and its reductions are recorded in prc_info/1, then the recorded value will be [] and not a number. Later on as complete/2 is called on the recorded data, a badarith crash occurs because it multiplies a number with that [].
prcinfo/2 needs a clause for reductions which returns 0 not [] as default value for a terminated process.