mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] atexit: Unlock after executing exit functions
Date: Thu, 2 Apr 2020 11:08:31 -0400	[thread overview]
Message-ID: <20200402150831.GB11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <e45b2f4e2706483f94012f5a69e540b8@huawei.com>

On Thu, Apr 02, 2020 at 03:56:58AM +0000, wangjianjian (C) wrote:
> >From 0bf59dbec10f1267419696ee5b3aa9ace1379ee2 Mon Sep 17 00:00:00 2001
> From: Wang Jianjian <wangjianjian3@huawei.com>
> Date: Thu, 2 Apr 2020 11:51:13 +0800
> Subject: [PATCH] atexit: Unlock after executing exit functions
> 
> Signed-off-by: Wang Jianjian <wangjianjian3@huawei.com>
> ---
>  src/exit/atexit.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/exit/atexit.c b/src/exit/atexit.c
> index 160d277a..d30db5df 100644
> --- a/src/exit/atexit.c
> +++ b/src/exit/atexit.c
> @@ -27,6 +27,7 @@ void __funcs_on_exit()
>  		func(arg);
>  		LOCK(lock);
>  	}
> +	UNLOCK(lock);
>  }
>  
>  void __cxa_finalize(void *dso)
> -- 
> 2.17.1

This patch is not correct and not fixing any bug; rather it introduces
a race condition whereby it's possible for atexit() to return success
adding a new handler, but the handler never runs.

On a higher level, a patch like this needs a commit message (or email
body text intended to be reworded into one) explaining what behavior
you believe is being fixed by the patch. As submitted the title
doesn't give any hint at a reason why it should be done.

Rich

      reply	other threads:[~2020-04-02 15:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02  3:56 wangjianjian (C)
2020-04-02 15:08 ` Rich Felker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200402150831.GB11469@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).