From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 2DBEE1F4B4 for ; Tue, 20 Apr 2021 22:51:58 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF3A3388A836; Tue, 20 Apr 2021 22:51:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF3A3388A836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618959117; bh=SNvmHvT/EgcePQHfR1k2FUcLLR/0G8UTnT5c7TGFg+4=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ps5dn1HY5qvyOEpQBA2NziI2d9fOIWxWuQ8w3yZ66VJD5oueKkWlEulcK+IN6m8Mq 8JbFstpO59WUDrfqiLkIl5Vjose46qZhKhIyACX3WGqqX1XSuYIxuvIN0/lRCvbhS/ YaEhp5mG4rs7SAe8QUJgAoj9IrWjytvATy4yyd+w= Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id AA51938515F1 for ; Tue, 20 Apr 2021 22:51:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA51938515F1 Received: by mail-pf1-x433.google.com with SMTP id i190so26762455pfc.12 for ; Tue, 20 Apr 2021 15:51:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P2Je6YMWSDJbdzn72Mt1EfrrYxTpF3FWFA6Pj6BzBhM=; b=d5dF9I5MJTzYcaL+2FHN7zsiqd+Il9HYPIXDkvZdTBDlscae32yZ+MFUWVj+bZ0qW1 OuGPO9VsAhSVC/YgimZcbPDTc3Qc+3hdvGZRaPAnGw6f/d5jZFBecSDLfmI1bY62fZMP t7tw0gZ0WnB40dIN92nG3IppzWCu5df22C/jT1kDxw5ZabOm0Gv3atO/y9xDUWYWGG6a oDZKo8suoE6TKWdOJxhwvncYXxZWIDqjyP0KoV8yNBJdnwwyv1wWAZVmkOKXWMkn2hBQ bFJV5au5xWlpCbQrTLrIppAVtyHuh05n4AuN0wY5dY2+rtDdDXNhQk48YnwzEaVIwy0J CdvA== X-Gm-Message-State: AOAM530N1+lRuIXOWHI9rsMkn43rFDZSJwrF5HKukiFS3R5ZwEMZCKpc 75TmuSmZnWojrq0J9qLRJ45PDh9FbiXH9KpuEh9pOA== X-Google-Smtp-Source: ABdhPJxyhZbBSwQlPgD8vpOxUBoOiSAHQitlFK0Sdkfp8i+Lz4jRT1CcSor+gijYDtd6JaDGdlmBkYdBMm5kvXKtabU= X-Received: by 2002:a17:90a:a895:: with SMTP id h21mr7575749pjq.13.1618959112668; Tue, 20 Apr 2021 15:51:52 -0700 (PDT) MIME-Version: 1.0 References: <20210417172258.2788076-1-vitalybuka@google.com> In-Reply-To: Date: Tue, 20 Apr 2021 15:51:15 -0700 Message-ID: Subject: Re: [PATCH] stdlib: Fix data race in __run_exit_handlers To: Paul Pluzhnikov Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vitaly Buka via Libc-alpha Reply-To: Vitaly Buka Cc: GLIBC Devel Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" I guess I forgot to reply to these comments. On Sat, 17 Apr 2021 at 11:02, Paul Pluzhnikov wrote: > On Sat, Apr 17, 2021 at 10:23 AM Vitaly Buka via Libc-alpha > wrote: > > > diff --git a/stdlib/test-cxa_atexit-race2.c > b/stdlib/test-cxa_atexit-race2.c > > > + This test spawns multiple threads, and check the same desctructor is > > Typo. Suggest: > > This test spawns multiple threads, and checks that the same destructor is > Done in the last patch. > > > + not called more then once. */ > > s/then/than/ > Done in the last patch. > > > +static void *cb_arg = NULL; > > +static void > > +add_handlers (void) > > +{ > > + int n = 10; > > + for (int i = 0; i < n; ++i) > > + __cxa_atexit (&atexit_cb, ++cb_arg, 0); > > add_handlers() is called from many threads. This code appears to race on > cb_arg. > We don't have a data race as add_handlers is called from a single background thread. Previous patches had more threads but they didn't help to reproduce the issues. > > > -- > Paul Pluzhnikov >