dump: set pid->state for threads

Submitted by Andrei Vagin on July 17, 2017, 9:57 p.m.

Details

Message ID 20170717215709.620-1-avagin@openvz.org
State Accepted
Series "dump: set pid->state for threads"
Commit 54ad424976a6a5253c66175cb26bd27b11383a2a
Headers show

Commit Message

Andrei Vagin July 17, 2017, 9:57 p.m.
From: Andrei Vagin <avagin@virtuozzo.com>

It is cheched in dead_pid_conflict, otherwise criu may segfault:

Program terminated with signal 11, Segmentation fault.
1073				if (item->pid->real == item->threads[i].real ||
(gdb) p item
$1 = (struct pstree_item *) 0x0
(gdb) bt

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/seize.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/criu/seize.c b/criu/seize.c
index 8d3c6cc..4abc159 100644
--- a/criu/seize.c
+++ b/criu/seize.c
@@ -741,6 +741,7 @@  static int collect_threads(struct pstree_item *item)
 		item->threads[id]->real = pid;
 		item->threads[id]->item = NULL;
 		item->threads[id]->level = level;
+		item->threads[id]->state = TASK_THREAD;
 		for (j = 0; j < level; j++)
 			item->threads[id]->ns[j].virt = -1;
 

Comments

Andrey Vagin July 24, 2017, 10:36 p.m.
Applied
On Tue, Jul 18, 2017 at 12:57:09AM +0300, Andrei Vagin wrote:
> From: Andrei Vagin <avagin@virtuozzo.com>
> 
> It is cheched in dead_pid_conflict, otherwise criu may segfault:
> 
> Program terminated with signal 11, Segmentation fault.
> 1073				if (item->pid->real == item->threads[i].real ||
> (gdb) p item
> $1 = (struct pstree_item *) 0x0
> (gdb) bt
> 
> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> ---
>  criu/seize.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/criu/seize.c b/criu/seize.c
> index 8d3c6cc..4abc159 100644
> --- a/criu/seize.c
> +++ b/criu/seize.c
> @@ -741,6 +741,7 @@ static int collect_threads(struct pstree_item *item)
>  		item->threads[id]->real = pid;
>  		item->threads[id]->item = NULL;
>  		item->threads[id]->level = level;
> +		item->threads[id]->state = TASK_THREAD;
>  		for (j = 0; j < level; j++)
>  			item->threads[id]->ns[j].virt = -1;
>  
> -- 
> 2.9.4
>