[strongSwan-dev] SIGPIPE makes charon restart

Tobias Brunner tobias at strongswan.org
Thu May 7 16:18:19 CEST 2015


Hi Emeric,

> It seems we have to set the signal handler for this signal before instantiating the pool of threads.
> This simple naive patch does the job:
> 
> diff --git a/src/charon/charon.c b/src/charon/charon.c
> index 081e494..cd4562e 100644
> --- a/src/charon/charon.c
> +++ b/src/charon/charon.c
> @@ -298,6 +298,12 @@ int main(int argc, char *argv[])
>         /* logging for library during initialization, as we have no bus yet */
>         dbg = dbg_stderr;
>  
> +       action.sa_flags = 0;
> +       sigemptyset(&action.sa_mask);
> +       action.sa_handler = SIG_IGN;
> +       sigaction(SIGPIPE, &action, NULL);
> +
>         /* initialize library */
>         if (!library_init(NULL, "charon"))
>         {

Hm, that's exactly what's done around line 448 in that file, just before
the thread pool is "started" (i.e. before worker threads are created).
But it happens after the plugins have been initialized by the main
thread.  How exactly does your application interact with VICI and/or
charon that it triggers this?

Regards,
Tobias



More information about the Dev mailing list