https://bugs.dpdk.org/show_bug.cgi?id=1294
Stephen Hemminger ([email protected]) changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |[email protected] Resolution|--- |WONTFIX --- Comment #1 from Stephen Hemminger ([email protected]) --- The DPDK does not support forking of the primary process after rte_eal_init is called. There are many internal parts of DPDK that depend on this. More detailed AI explanation: DPDK does not support fork() after rte_eal_init(). The child is neither a valid primary nor a secondary process. What breaks: - Hugepage memory and the heap/memseg metadata in mem_config are MAP_SHARED, so parent and child share the same malloc heap. Page mappings, however, are per process. - When the child needs more memory it calls alloc_more_mem_on_socket() as if it were the primary. It maps new hugepages into its own address space only and links the new elements into the shared heap free list. The parent and any other child never mapped those pages. In normal multi-process this is kept in sync over the mp IPC channel, which the forked child does not take part in. - The second child inherits a heap whose free list points into pages that only the first child had mapped. The first heap walk in malloc_elem_insert() dereferences one of them, giving SIGSEGV. That matches your backtrace and why the first fork appears to work. - Only the calling thread survives fork(). The interrupt thread, mp handler thread and lcore workers do not exist in the child, and any spinlock in shared memory that was held at fork time stays held. Device fds (VFIO, uio, memfd) are also shared with the parent. Options: - Run the business logic as a DPDK secondary process (--proc-type=secondary, started with fork+exec or separately). You can restart it as often as you like without disturbing the primary. - Run it in threads inside the primary. - fork() before calling rte_eal_init(), and keep DPDK only in the process that initializes EAL. Closing as not a bug. -- You are receiving this mail because: You are the assignee for the bug.

