|
Zbigniew Jędrzejewski-Szmek |
e106c4 |
From cd1338b7abe6d300ce66051f3490f35c8b4d1443 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
From: Igor Zhbanov <i.zhbanov@samsung.com>
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
Date: Tue, 15 Oct 2013 14:35:13 +0400
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
Subject: [PATCH] Fix for SIGSEGV in systemd-bootchart on short-living
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
processes
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
The function svg_ps_bars() dereferencess NULL pointer in the line
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
endtime = ps->last->sampledata->sampletime;
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
because of partially initialized ps_struct (ps->last == NULL).
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
If some process terminates between scaning /proc directory in the log_sample()
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
function and reading additional information from /proc/PID/... files,
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
the files couldn't be read, the loop will be continued and partially
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
initialized structure returned.
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
src/bootchart/store.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
diff --git a/src/bootchart/store.c b/src/bootchart/store.c
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
index f8c97c2..7f86cfe 100644
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
--- a/src/bootchart/store.c
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
+++ b/src/bootchart/store.c
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
@@ -275,7 +275,7 @@ schedstat_next:
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
pscount++;
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
/* mark our first sample */
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
- ps->first = ps->sample;
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
+ ps->first = ps->last = ps->sample;
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
ps->sample->runtime = atoll(rt);
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
ps->sample->waittime = atoll(wt);
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
--
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
1.8.4.652.g0d6e0ce
|
|
Zbigniew Jędrzejewski-Szmek |
794d16 |
|