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 1C02445DCF; Fri, 29 Nov 2024 18:01:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1C95402AE; Fri, 29 Nov 2024 18:01:00 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 157114014F for ; Fri, 29 Nov 2024 18:01:00 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21207f0d949so19543225ad.2 for ; Fri, 29 Nov 2024 09:01:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1732899659; x=1733504459; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=N8mvJgabVVYpMfBxdpAlNzObyNU1H5AOdLsRQuhTcfw=; b=seMR3qT3ze7H4ZArSmTUvH/NVxRTpZjsghEJRcIzh5VZjNrpMgtfIqv8hOzM30PANY 3/glvrrHFT2UMf3f1pcjCVDo+kFysTNqtnmLjlKZ9215+5f4eZWWmlFur5+rV/7zCquk bQekvntnc0ufSsSLznvA0V4zDWA5n02mK0OI1xMa7im8ZfArt7RiedA2QHsICZ0+xueB lY5nm6h2Uiw1eMB43naxmn5YrL9XZPFgu63EPZ/wsja07Cw9bBdb46ianFvlvZ9jZ1qe EoCZuNCSJieB1DmkoxM/cbVXdn/Y5X5RCXWhwqv1UEk1BkUEyFij1Mv08RIYJHZNYmiH Ivdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732899659; x=1733504459; 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:message-id:reply-to; bh=N8mvJgabVVYpMfBxdpAlNzObyNU1H5AOdLsRQuhTcfw=; b=nijDcAwnO5Tl+6AgJ6N4AWct+J+hBLqjFasb1tGDdU39pGv1kxxXJXZmgiGYAyFtE2 tAVYYxzBVFIPHmfal9LRrO6cbHIEoenkmLAChKK1mjWvK8kHUwW0nmRYHbcgWaBKu9Lf vTOiPlvpWNH28O7ragiE9J3tn1xQTOOROwPVOHr6X/C2/HF72uweqQroP5i5UNlPQnN/ /SG80UyaTa4FaARt3Oz01CaHSd4u9OE3VZ26RWQLLmJ+r54tLVGj+WND2WGq5O3rQ71R xoYeMu5ZxBS2IG/SuSlfvsYhdv8q26QjDxS5vbhAuwsxuywDEs/mtsnl6/NqLCHNKUYj qt+w== X-Gm-Message-State: AOJu0Yz3vb97/5c+tH3iLNkJfFoA5PVnOum9WGbADkvQ/5BDGyTNjKXu RC3+lR0LjjanCb2/d7kw9dshT+4jtXMLvwihGp4pOpGA0H/y73JcF7HHCm97GKU= X-Gm-Gg: ASbGncvk2H8g70A4BJuZotQfr4zNWvxVCVmX5hvAqcLsnEFRCp1E/eq0ctPHtdJ49ac vXYedp0CbnsN1kSETUs+/E0WHgXEt+OEYq8vq9EtdeVkOi56PbMVEb96VYGaDZRbx349FEvI8sy vURPpA6Xqa0pkoEUYCtcOAbXkZTZbZ4+IJcOTb114HTtTeee0ZeRbLTMg0j6t8lhuxiTZtD47Oa 9AlbTi1Xiul0kUclitAPaCNoGkaMmULCMWCTm/XvKpQyFqWXqTgh4q1JVg1rnBP+clAPMBZPvKi 3OlaNEolZHT2IAeA2v1Ymge7ZDw= X-Google-Smtp-Source: AGHT+IHjjp4/fFYg2W/VJHBcMFp+yrpKl7GqFm97CYdgCDBui/dBdqlvX1rVuMSt0jQVL9WTq0Puzw== X-Received: by 2002:a17:903:440f:b0:20b:b238:9d02 with SMTP id d9443c01a7336-21501855ea7mr147941405ad.33.1732899658786; Fri, 29 Nov 2024 09:00:58 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2152198301fsm32969095ad.179.2024.11.29.09.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 09:00:58 -0800 (PST) Date: Fri, 29 Nov 2024 09:00:56 -0800 From: Stephen Hemminger To: Robin Jarry Cc: dev@dpdk.org, Bruce Richardson , Morten =?UTF-8?B?QnLDuHJ1cA==?= , Chengwen Feng Subject: Re: [PATCH dpdk] log: fix double free on cleanup Message-ID: <20241129090056.6ba07d39@hermes.local> In-Reply-To: <20241129161013.704859-2-rjarry@redhat.com> References: <20241129161013.704859-2-rjarry@redhat.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 Fri, 29 Nov 2024 17:10:14 +0100 Robin Jarry wrote: > Fix the following crash when closing a log file after rte_eal_cleanup(): > > double free or corruption (!prev) > > Thread 1 "grout" received signal SIGABRT, Aborted. > __pthread_kill_implementation (threadid=, > signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 > ... > #10 _IO_new_fclose (fp=0xb63090) at iofclose.c:74 > #11 0x000000000049c04e in dpdk_fini () at ../main/dpdk.c:204 > #12 0x0000000000402ab8 in main (...) at ../main/main.c:217 > (gdb) up 11 > #11 0x000000000049c04e in dpdk_fini () at ../main/dpdk.c:204 > 202 rte_eal_cleanup(); > 203 if (log_stream != NULL) > 204 fclose(log_stream); > > When the application has passed a custom file via rte_openlog_stream() > DPDK should not call fclose() on it. > > Add an internal is_internal_file field to track whether the file has > been allocated by DPDK (syslog or journald) to determine if it should be > closed or not. > > Fixes: 985130369be3 ("log: rework syslog handling") > Signed-off-by: Robin Jarry Looks good, will look into adding more test cases for this in later release. Reviewed-by: Stephen Hemminger