Segmenation fault when a process resumed with checkpt exits

Antonio Huete Jimenez tuxillo at quantumachine.net
Sun Jun 12 04:11:47 PDT 2022


Hi,

Would you mind opening a bugtracker issue for this one?
If you don't have an account you can mail me directly to get one.

Cheers,
Antonio Huete

On 12/6/22 12:02, Stanislav Syekirin wrote:
> Hi,
> 
> I'm experimenting with process checkpointing in DragonFly 6.2.1 and 
> don't know how to exit a resumed process correclty. The man page for 
> sys_checkpoint doesn't address the question, as far as I can see: the 
> example loops forever and only exits if there is an error.
> 
> I have the following code (error handling omitted for brevity):
> 
>      #include <stdio.h>
>      #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");
>      }
> 
> This is the output I get:
> 
> % 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)
> 
> This is the backtrace I get 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 ()
> 
> Help would be appreciated.
> 
> Regards
> Stanislav



More information about the Users mailing list