Segmenation fault when a process resumed with checkpt exits

Stanislav Syekirin stanislav.syekirin at studium.fernuni-hagen.de
Sun Jun 12 04:53:15 PDT 2022


Done, thank your for helping me create an account.
The issue is here: https://bugs.dragonflybsd.org/issues/3318

Regards
Stanislav

On So, 12 Jun 2022 13:11:47 +0200
  Antonio Huete Jimenez <tuxillo at quantumachine.net> wrote:
> 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