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 5966C45F1F; Mon, 23 Dec 2024 10:00:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8A704068E; Mon, 23 Dec 2024 10:00:03 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 392B8402DC for ; Mon, 23 Dec 2024 10:00:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734944401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s66qYFehneWKJmbB6URsmStQ68+z7+zoKf5VVh1valA=; b=ddrkcGDNTAA89VnktBj6n744A15rJe1COGfFlDsqZl6zF0fMJGcK+zG+r5u5PnC1gsE8bD vElHvgzQclWppqzufJkTqpOGfeEM1NGaruA1Msob5fUOqUKiXJapNQ4BlhhhAHagKKmjRi 8TqoSvqJZ15ki/ErwUVwdSbGfVsuVg8= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-ev_1SKoKO5a95NjfFnQoFA-1; Mon, 23 Dec 2024 03:59:59 -0500 X-MC-Unique: ev_1SKoKO5a95NjfFnQoFA-1 X-Mimecast-MFC-AGG-ID: ev_1SKoKO5a95NjfFnQoFA Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-5401f43232cso2145498e87.1 for ; Mon, 23 Dec 2024 00:59:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734944398; x=1735549198; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s66qYFehneWKJmbB6URsmStQ68+z7+zoKf5VVh1valA=; b=jCU00apZ61/duK1APoEw0Nwn4ycx8GCOTCoGaDexZ7KgC8bfkJzK1otBZyVcpAlXwZ tpe9ndQTAma1EPI4yM8icEiI07TRnsCt7YYEciubic0dM5K3OwiA3hXyKK9+s6UnPvVU P61eaS3P+ZvtSpLpXe37cJLkBf5lQEXNW2DdX7Piqa7uesEecV9Frz7BbKTbwjl+g8dV hEgc74C03x/UTYDiYt/jWhzV+6sWkwTHrJeEjQ3DopQxtl9hVKKmBzMTj+5W8E55GZwT cD+wBWcK53auuSN8H2j5QGJuNQ5ALd9UpOkarcNYf7zywYG8uaK6MIFlRHjd19FkHqcN +fRQ== X-Forwarded-Encrypted: i=1; AJvYcCXbBJZF3U7GU9yi1wWho7ZQh/7DT2oIk3sokHL8uzZtNPhwMyCXflMT/rjiRKSzs8SiLmI=@dpdk.org X-Gm-Message-State: AOJu0Ywp/rsPqMl+puuoozSKX9VScCMsSxKuhl9Tup5go+cwQGwmZI8G 33+O8Xep656dKeccu4HyTJfYUOBpirevnYSZYJVGObKm1OIanPWIYP3AMI7mSRu31aYcJoSIV+d tdsTAxLVqz2vbLv5DFyPasGVkhxZB1cRizqv1tmeh9KoBfqUpSkY8Nubab0Qjw+oaBzIOzRaFfg lN9K7+KBLOPw2Vl4A= X-Gm-Gg: ASbGncuKm0Uw52rtIiBCh4ZuyJBP21iecKspgJuI6WWZeusD0Qy72YxBhWtEpEms2/k dRLJbiLHJEa0rCTadBuO8BVBMzXkhuTxkOJ6zjU4L X-Received: by 2002:a05:6512:3e16:b0:541:1c48:8c0d with SMTP id 2adb3069b0e04-5422959768fmr4214376e87.49.1734944398269; Mon, 23 Dec 2024 00:59:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFfY1hnAvhDnf24VZ0CuqncD1xPjA7ksBkdJ/NONBf8haIA25FBuB7oBS6VhIoRNlwKrisJ8vtJfQTb0NwDnY= X-Received: by 2002:a05:6512:3e16:b0:541:1c48:8c0d with SMTP id 2adb3069b0e04-5422959768fmr4214367e87.49.1734944397842; Mon, 23 Dec 2024 00:59:57 -0800 (PST) MIME-Version: 1.0 References: <20241129161013.704859-2-rjarry@redhat.com> <20241129090056.6ba07d39@hermes.local> In-Reply-To: <20241129090056.6ba07d39@hermes.local> From: David Marchand Date: Mon, 23 Dec 2024 09:59:47 +0100 Message-ID: Subject: Re: [PATCH dpdk] log: fix double free on cleanup To: Robin Jarry Cc: Stephen Hemminger , dev@dpdk.org, Bruce Richardson , =?UTF-8?Q?Morten_Br=C3=B8rup?= , Chengwen Feng X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OdqArMU2Gb2ML3sF1SQb5vOMUs06GlAlIZQOxDWXZg0_1734944398 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, Nov 29, 2024 at 6:01=E2=80=AFPM Stephen Hemminger wrote: > 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=3D, > > signo=3Dsigno@entry=3D6, no_tid=3Dno_tid@entry=3D0) at pthread_kill= .c:44 > > ... > > #10 _IO_new_fclose (fp=3D0xb63090) 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 !=3D 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 b= e > > closed or not. > > > > Fixes: 985130369be3 ("log: rework syslog handling") Added Cc: stable for 24.11 LTS. > > Signed-off-by: Robin Jarry > Reviewed-by: Stephen Hemminger Applied, thanks for the fix Robin. --=20 David Marchand