From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58AAFA054A for ; Tue, 6 Sep 2022 17:03:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5120C40143; Tue, 6 Sep 2022 17:03:41 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 5CD4C400D6 for ; Tue, 6 Sep 2022 17:03:40 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id x23so11582510pll.7 for ; Tue, 06 Sep 2022 08:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=ExpqQoqH8iUumbhiaBQCc/NcFRkPxW+tjRmwR++lI48=; b=3zEgCerQbqZZWR2UNe7X/IiGsODhosnPdapah0L/lm4sD9kLKIONzc40f42ubmIZWh cJw6VmhvVxzvhDudGThF/5kAKcE0k29kjhnTyBs0M8iFOlSFYc6CFMFIW20kovaEYCpA 3xSUzdNx5a0/Qqw00UtqNJWf3uearMkawJSFAN7I2s5wYQAbRvTUukjrBcO5gt6hWfYN kaIPGM2OSAfMG+pbFPEAWQPnPk7innhRVYzCn4yENfmAheUg0RRopzRdE+GDwmvhoxtS k4TRcKhGRycezEg4gIoEyDQ7hRSysQcbpm4/ib9K2s1ppKgOd3b+EzrXavWjdJzaGuqz 2/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=ExpqQoqH8iUumbhiaBQCc/NcFRkPxW+tjRmwR++lI48=; b=ng4afH5MGj4QGcJrAVIwwop8D5ynX/BX6TtvafzltZOKmRwpuKzNi34SN2mOvFbp7i evTTLutc0RT+8F1DvyqUkZM3x18bDZPelXUv7b+T8aOfOaj/aitKQPLDziTgHAYRBEWk KM0FKoQ5RoA+SoMaKcJUITeWbuAPmD56ol0H9n0H6z/eU5sNxYjdjVeS35HqFCkH9wEr FxFDUFRPKzxIhumrcuYdQtPfNOF5sLwSRe6+V4/A1dvP2FuuDnRUNOtIkyUZbJtfenZm ELKdl3qwHHC5uinoyrPQN+UPTt5YX8mbB8eTd6QytPJb7RX3peQvcudyEpfl6jM49cse dQDw== X-Gm-Message-State: ACgBeo3BGK4twj9kKYhU2XagGSTGrXSQxsSRk0dSoPeIep3ImxVz36+g 0s7Y2up4pZeJX4BtcLeBWuWxrg== X-Google-Smtp-Source: AA6agR7SoGb1EAv+ZdpsaOIYNWfI5hs0h0iZAIr0NsMZ4Nnkoza6k7tTa3YXFw1CW2h1U4v0/iUZag== X-Received: by 2002:a17:902:aa8c:b0:173:4137:55c4 with SMTP id d12-20020a170902aa8c00b00173413755c4mr55485674plr.108.1662476619517; Tue, 06 Sep 2022 08:03:39 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u16-20020a170902e81000b00174d9bbeda4sm10026953plg.197.2022.09.06.08.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:03:39 -0700 (PDT) Date: Tue, 6 Sep 2022 08:03:37 -0700 From: Stephen Hemminger To: Zhichao Zeng Cc: dev@dpdk.org, david.marchand@redhat.com, qiming.yang@intel.com, yidingx.zhou@intel.com, stable@dpdk.org, Bruce Richardson , Harman Kalra Subject: Re: [PATCH v5] lib/eal: fix segfaults in exiting Message-ID: <20220906080337.25dc426d@hermes.local> In-Reply-To: <20220906025132.160801-1-zhichaox.zeng@intel.com> References: <20220615060154.6905-1-zhichaox.zeng@intel.com> <20220906025132.160801-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Tue, 6 Sep 2022 10:51:31 +0800 Zhichao Zeng wrote: > > +static void mark_forked(void) > +{ > + is_forked++; > +} > + This will end up counting application threads as well. Also, it would need to be atomic. > /* Launch threads, called at application init(). */ > int > rte_eal_init(int argc, char **argv) > @@ -1324,6 +1331,8 @@ rte_eal_init(int argc, char **argv) > > eal_mcfg_complete(); > > + pthread_atfork(NULL, NULL, mark_forked); > + > return fctret; > } > int > rte_eal_cleanup(void) > { > + if (is_forked) > + return 0; > + rte_eal_cleanup is supposed to be called only once by application.