mirror of
https://github.com/systemd/systemd.git
synced 2025-01-12 13:18:14 +03:00
Fix for SIGSEGV in systemd-bootchart on short-living processes
The function svg_ps_bars() dereferencess NULL pointer in the line endtime = ps->last->sampledata->sampletime; because of partially initialized ps_struct (ps->last == NULL). If some process terminates between scaning /proc directory in the log_sample() function and reading additional information from /proc/PID/... files, the files couldn't be read, the loop will be continued and partially initialized structure returned.
This commit is contained in:
parent
72f4d9669c
commit
306e665022
Notes:
Zbigniew Jędrzejewski-Szmek
2013-10-21 16:55:16 -04:00
Backport: bugfix
@ -275,7 +275,7 @@ schedstat_next:
|
||||
pscount++;
|
||||
|
||||
/* mark our first sample */
|
||||
ps->first = ps->sample;
|
||||
ps->first = ps->last = ps->sample;
|
||||
ps->sample->runtime = atoll(rt);
|
||||
ps->sample->waittime = atoll(wt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user