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 05C3CA0555; Thu, 9 Jun 2022 14:47:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB05240689; Thu, 9 Jun 2022 14:47:44 +0200 (CEST) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 4621040220 for ; Thu, 9 Jun 2022 14:47:44 +0200 (CEST) Received: by inbox.dpdk.org (Postfix, from userid 33) id 31F65A0557; Thu, 9 Jun 2022 14:47:44 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Subject: [Bug 1030] rte_malloc() and rte_free() get stuck when used with signal handler Date: Thu, 09 Jun 2022 12:47:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: core X-Bugzilla-Version: 22.03 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sarosh.arif@emumba.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 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 https://bugs.dpdk.org/show_bug.cgi?id=3D1030 Bug ID: 1030 Summary: rte_malloc() and rte_free() get stuck when used with signal handler Product: DPDK Version: 22.03 Hardware: All OS: Linux Status: UNCONFIRMED Severity: normal Priority: Normal Component: core Assignee: dev@dpdk.org Reporter: sarosh.arif@emumba.com Target Milestone: --- Created attachment 205 --> https://bugs.dpdk.org/attachment.cgi?id=3D205&action=3Dedit calls rte_malloc and rte_free in the handler and main code I have a dpdk based application which uses rte_malloc() and rte_free() frequently in it's main code. The general method to close the application is though sending SIGINT. The application has a signal handler written for cle= anup purposes before closing the application. The handler also uses rte_free() to release some of the memory during cleanup. The application gets stuck in a deadlock. Upon investigation I found out that both rte_free() and rte_malloc() use rte_spinlock_lock() function to place a lock on heap. While this lock is pl= aced and the application receives SIGINT, it goes into the handler without relea= sing the lock. Since the handler itself calls rte_free() which tries to acquire = the lock it gets stuck.=20 I have attached a sample application to reproduce this problem. Steps to reproduce this problem:=20 1. compile the code provided in attachment with any version of dpdk=20 2. run the compiled binary 3. press ctrl+c till the prints stop=20 Actual Results:=20 The application gets stuck in either rte_free() or rte_malloc() Expected Results:=20 Application should allocate and free the memory without getting stuck --=20 You are receiving this mail because: You are the assignee for the bug.=