Re: [PATCH] Correctly initialize 'installed_handlers'

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

 



On Fri, May 08, 2020 at 07:05:13AM +0000, Force Charlie via GitGitGadget wrote:
> From: Force Charlie <charlieio@xxxxxxxxxxx>
> 
> Because static variables are not initialized properly,

what do you mean by "properly"?, all static variables are set to 0;
that is a warranty of the language (all the way to K&R) and any C compiler
should enforce that as part of the standard.

> temporary files may not be deleted when receive-pack receives a signal.

the way this is handled would seem to indicate otherwise

if (!installed_handlers) {
                atexit(remove_tmp_objdir);
                sigchain_push_common(remove_tmp_objdir_on_signal);
                installed_handlers++;
}

there is no explicit locking and so there might be a thread race
condition, but the code below wouldn't make a difference in that
case.

could you elaborate more on how to reproduce the problem?, I suspect
that if there was a problem then suppressing whatever signal that
was triggered before sigchain_push_common might help, but the window
is too short to be a likely issue.

Carlo



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux