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 D84F2A054A; 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 798494114A; Tue, 6 Sep 2022 17:03:41 +0200 (CEST) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id 5E1ED40143 for ; Tue, 6 Sep 2022 17:03:40 +0200 (CEST) Received: by mail-pl1-f178.google.com with SMTP id d12so11583111plr.6 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=FkQBio1UM781XM/sWH8V3Db5raYmIPR2GrRTrInw8Pna5xiw6QExx7q4wRiQE5cKpQ nei6iXsv075R1ztQOwlz4G9EkCJ/fkTqGmoaYzgeIUBrfe89mJX4y2wl/PO6wbOmSlwW O2D7MdvEChG5hvA5qQDnbVR42ZVtMhd4i94cRw6HrrprZbC/tQDIlFR7/p5Ygwt7Oamx aCUJVRp1n0yKSDlrktLhsGMJSvC9T2buDHw5SVy7qe6jp8hya4HoQdR7DOhpm6MKG0gU lr4Oa5k8+jOMPr/tMJE2bzDR8SXSlKLM8UrJozgtnlJtw1ukLnay4pKyHhz0g1vyF4Er 5/1g== X-Gm-Message-State: ACgBeo12H7DW+4lwGN6anCTq6/BysMLGufrxX6JlqZ2r4NtL08i4aE9+ ocE4/geulUsRWyU1oMaATyovmA== 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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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.