[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Solaris problem w/ SIGCHLD



On Thu, Jan 23, 2003 at 08:39:23PM -0600, Mark Hatle wrote:
> I encounted a deadlock on solaris when a post install script ran.
> 
> I finally tracked it down to the sighandler being improperly initialized.
> 
> In lib/psm.c the "satbl" default initialization failed because it makes an 
> assumption on the order of items in struct sigaction.  On Linux the handler is 
> the first item in the struct, on solaris sigaction is the second item in the struct.
> 
> A very "poor" patch is included below..  This was created out of time pressure, 
> so I'm not sure if it's the right fix (probably isn't) so I will leave it up to 
> the people who better understand this stuff!  (FYI the patch does fix the 
> problem, or at least the symptoms...)
> 

Hmmm, time to not statically initialize methinks.

Same problem/patch is needed in rpmdb/rpmdb.c if you haven't found already.

> --- rpm-4.1.orig/lib/psm.c      Thu Jan 23 20:29:35 2003
> +++ rpm-4.1/lib/psm.c   Thu Jan 23 20:29:16 2003
> @@ -675,8 +675,13 @@
>       struct sigaction act;
>       struct sigaction oact;
>   } satbl[] = {
> +#if defined(sun)
> +    { SIGCHLD,  0, { ._funcptr = {handler} } },
> +    { -1,       0, { 0    } },
> +#else
>       { SIGCHLD, 0, { {handler} } },
>       { -1,      0, { {NULL}    } },
> +#endif
>   };
>   /*@=fullinitblock@*/
> 

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []