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 3B865A0C4B; Sat, 6 Nov 2021 10:27:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBF694067C; Sat, 6 Nov 2021 10:27:30 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 29B2A40151 for ; Sat, 6 Nov 2021 10:27:28 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HmX314LJKzbhJs; Sat, 6 Nov 2021 17:22:37 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Sat, 6 Nov 2021 17:27:23 +0800 To: "dev@dpdk.org" CC: Thomas Monjalon , Ferruh Yigit , From: "Min Hu (Connor)" Message-ID: <58e86979-cc9b-7dce-edf7-65867a8d4f8d@huawei.com> Date: Sat, 6 Nov 2021 17:27:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] Questions about mmap in Asan APP 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 Sender: "dev" Hi, Jonas Pfefferle and all, I met one questions: When I ran APP on Kasan OS, secondary process occasionally init failed. BTW: testpmd is built with Asan, that is to add "CFLAGS="-fsanitize=address -fno-omit-frame-pointer -pthread"". Kasan OS is what opens this: CONFIG_SLUB_DEBUG=y CONFIG_KASAN=y The PRIMARY process APP(testpmd) log: estuary:/home$ ./testpmd_kasan_debug -w 0000:00:01.0 --file-prefix=test --proc-type=auto -l 0-1 -n 2 -- -i --rxq=4 --txq=4 EAL: Detected 16 lcore(s) EAL: Detected 1 NUMA nodes Option -w, --pci-whitelist is deprecated, use -a, --allow option instead EAL: Auto-detected process type: PRIMARY EAL: Detected static linkage of DPDK EAL: Multi-process socket /var/run/dpdk/test/mp_socket EAL: Selected IOVA mode 'PA' EAL: No available 32768 kB hugepages reported EAL: No available 64 kB hugepages reported EAL: No available 1048576 kB hugepages reported EAL: VFIO support initialized EAL: WARNING! Base virtual address hint (0xd01061000 != 0xfffb89e00000) not respected! EAL: This may cause issues with mapping memory into secondary processes EAL: Invalid NUMA socket, default to 0 EAL: Using IOMMU type 8 (No-IOMMU) EAL: Probe PCI driver: net_hns3_vf (19e5:a22e) device: 0000:00:01.0 (socket 0) TELEMETRY: No legacy callbacks, legacy socket not created Interactive-mode selected testpmd: create a new mbuf pool : n=155456, size=2176, socket=0 testpmd: preferred mempool ops selected: ring_mp_mc Warning! port-topology=paired and odd forward ports number, the last port will pair with itself. Configuring Port 0 (socket 0) 0000:00:01.0 hns3_parse_rss_key(): Default RSS hash key to be set Port 0: link state change event Port 0: 72:DE:F7:1B:F6:52 Checking link statuses... "EAL: WARNING! Base virtual address hint (0xd01061000 != 0xfffb89e00000) not respected! EAL: This may cause issues with mapping memory into secondary processes" should be noticed. The SECONDARY APP(proc-info) log is: estuary:/home$ ./proc-info -w 0000:00:01.0 --file-prefix=test --proc-type=auto -- --xstats-name rx_q0_packets Option -w, --pci-whitelist is deprecated, use -a, --allow option instead EAL: Cannot get a virtual area at requested address: 0xfffba6000000 (got 0xfffb8ae3b000) EAL: Cannot reserve 17179869184 bytes at [0xfffba6000000] - please use '--base-virtaddr' option EAL: Cannot preallocate VA space for hugepage memory EAL: FATAL: Cannot init memory EAL: Cannot init memory PANIC in main(): Cannot init EAL 4: [/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe0) [0xffff8be5a8a0]] 3: [./proc-info(main+0x1098) [0x52a3a8]] 2: [./proc-info(__rte_panic+0x9c) [0x48cfac]] 1: [./proc-info(rte_dump_stack+0x20) [0x80d4b0]] Aborted "EAL: Cannot get a virtual area at requested address: 0xfffba6000000 (got 0xfffb8ae3b000)" should be noticed. According to my analysis, the reason is that the system call "mmap" return the address which is different with the hint address(first parameter). That is to say£º return_addr = mmap(void* start,size_t length,int prot,int flags,int fd,off_t offset); return_addr and start is different. Why this happened? I guess Asan works based on shadow memory, shadow memory will occupy the memory zone and it cannot be one for mmap. So, it the shadow memory happens to be in the range of mmap region, mmap will return a new address which is free(not occupied by shadow). BTW£¬I think DPDK multiple process is not supported in that situation, such as "Asan APP on Kasan OS". What is your opinion? any will weclome, thanks. Best regards.