Skip to content

Improve initialization of struct for stack trace #23

@theoreticalbts

Description

@theoreticalbts

@vogel76 suggests the following:

I think initialization shall be done as follows:

   struct sigaction sigact = {0};
   sigset_t block_mask = {0};
   sigemptyset (&block_mask);
   
   sigact.sa_sigaction = segfault_handler;
   sigact.sa_flags = SA_RESTART | SA_SIGINFO;
   sigact.sa_mask = block_mask;

Valgrind complains about sa_mask field, and I think it is dangerous to leave trash there. Also I am not sure if inside this handler SIGINT shall be blocked to avoid spawning standard break handler during execution of SIGSEGV

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions