Project

General

Profile

Actions

Bug #3318

open

Segmenation fault when a process resumed with checkpt exits

Added by zabolekar about 2 years ago. Updated about 2 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
06/12/2022
Due date:
% Done:

0%

Estimated time:

Description

DragonFly version: 6.2.1

Code example (error handling omitted for brevity):

#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/checkpoint.h>

void save(const char* filename)
{
    int file = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
    sys_checkpoint(CKPT_FREEZE, file, -1, -1);
    close(file);
}

int main()
{
    puts("a");
    save("a.ckpt");
    puts("b");
}

Expected output:

% gcc test.c -o test -Wall -Wextra
% ./test
a
b
% checkpt -r a.ckpt
b

Actual output:

% gcc test.c -o test -Wall -Wextra
% ./test
a
b
% checkpt -r a.ckpt
b
pid 1143 (test), uid 1001: exited on signal 11 (core dumped)
Segmentation fault (core dumped)

Backtrace with gdb test test.core:

#0  0x000000080040400f in __tls_get_addr () from /libexec/ld-elf.so.2
#1  0x000000080075648a in _thread_finalize () from /lib/libc.so.8
#2  0x0000000800756449 in exit () from /lib/libc.so.8
#3  0x00000000004007b3 in _start ()

See also: https://lists.dragonflybsd.org/pipermail/users/2022-June/405002.html

Actions

Also available in: Atom PDF