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 61DA643B80; Fri, 1 Mar 2024 04:36:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5135142F97; Fri, 1 Mar 2024 04:36:18 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id 4304B42E1A for ; Fri, 1 Mar 2024 04:36:17 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1dc3b4b9b62so14874825ad.1 for ; Thu, 29 Feb 2024 19:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709264176; x=1709868976; 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=RCbVtdghxmLPFdwmdPug8aUzcaXe5sVIQZatRsJEA7Y=; b=kPGp14bCX8S34YQTygzE54c79tfiLAm0o7aG6fAWFY8/qbPuQXN9Cw3j6Y7Wwk7THk ABSV0FCjrufMhHV6A1Ezn+F0uau6U+EGdDAKt5pzEPyCCd3vDzNMsrupBHQcgc+wooeU m+FovISEBGfgPkoS360nauDDf981nKj5Nb1vk3Vs11ceS+yU998vSOJkJPJQoODKLnUy GDt48K3zTlptQk1J3aIfuZQna69s4rphKGX9HRqXE9ZhJ2lGsT9zspLAoY+d0Bw8kq/h Y++fFThlQAGIfaBkqQcpWcZMtt/qScPClsVW4RmRaYHNJle1yuR9ygCb+aGK5U/Vkznh RQ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709264176; x=1709868976; 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=RCbVtdghxmLPFdwmdPug8aUzcaXe5sVIQZatRsJEA7Y=; b=alPKD6H6ZwOCjEBnKUP8V2wQwh0BimXogs7xsAvknCgzHvsZB3Zbaw7zsctH3t8wXL TATmggAGcmCyaKdWoUbL7H82kQ/uVv10zkMbBUPhYbvb3DvGCmh8MN9liq4uk0vUBw0l tVSS8DR7tZv5oV2+I7U8mkPALcpKyGsd46uOXY6ZLB1zI4O9Y3X3TmppoRpstP3MF1WR P3SkWdECYwYtV0kHhaduCiYCy3RPk0nwivl7GIqqUcN1sLan7rUnVJrJyXJFIBXplrf/ PwesfBFAzMXmiH31YsIagcUWNs0xSOCW7mejhiNBLP2svoW6aIY5P+rdfr2AlWuJOsmQ CvEA== X-Gm-Message-State: AOJu0YzT6knS4u21kA6+IT2hxj6Kzo6MpRnoNidp2/R9q8SbOccqltNO M12gaseClYiJ4DPYmqYUm43OLdQKzP7cWF3UxN754ZRUevOFONYF+Ur9cgfHnqc= X-Google-Smtp-Source: AGHT+IEopOC4CGPDDVZ3wj4Ycd2a9WPKLXjuxyEILydzn07wucgCBEdHy93kp4NVNy5acI1e28zzkQ== X-Received: by 2002:a17:903:41c8:b0:1dc:cd80:8f58 with SMTP id u8-20020a17090341c800b001dccd808f58mr819317ple.30.1709264176351; Thu, 29 Feb 2024 19:36:16 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id g1-20020a170902fe0100b001dc941f145dsm2277434plj.253.2024.02.29.19.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 19:36:16 -0800 (PST) Date: Thu, 29 Feb 2024 19:36:14 -0800 From: Stephen Hemminger To: Tianli Lai Cc: dev@dpdk.org, Reshma Pattan Subject: Re: [PATCH] app/dumpcap:fix coredump problem because pcap_dump 3th argument is null Message-ID: <20240229193614.656e7607@hermes.local> In-Reply-To: <20240301104129.3725-1-laitianli@tom.com> References: <20240301104129.3725-1-laitianli@tom.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, 1 Mar 2024 18:41:29 +0800 Tianli Lai wrote: > if rte_pktmbuf_read() return NULL, pcap_dump() would coredump. > > Signed-off-by: Tianli Lai Ok, but how is this possible. header.caplen will be min of (pktlen, 2048) So in rte_pktmbuf_read() if (likely (0 + pktlen <= rte_pktmbuf_data_len(m)) return rte_pktmbuf_mtod_offset(m, char *, 0); Maybe the packet is really big and the packet is multi-segment. But in that case the code rte_pktmbuf_read should do the consoliation. Are you sure driver is not generating weird packets?