If the program is forking off processes, perhaps the child processes aren't closing the socket file descriptor. Using fcntl() to set FD_CLOEXEC on the descriptor in the parent may help.
Gary Duzan IT Architect Senior GT.M Core Team T: +1.484.302.3226 E: gary.du...@fisglobal.com FIS | Advancing the way the world pays, banks and invests™ ________________________________ From: Tung Quang Nguyen via tipc-discussion <tipc-discussion@lists.sourceforge.net> Sent: Monday, May 15, 2023 6:43 AM To: prakash bisht <ps13.bi...@gmail.com> Cc: Xin Long <l...@redhat.com>; tipc-discussion@lists.sourceforge.net <tipc-discussion@lists.sourceforge.net> Subject: Re: [tipc-discussion] TIPC socket ( SOCK_SEQPACKET) cleanup issue Hi Tung, Can you please share your thoughts. I have responded to your queries in my previous email. Please let me know if you need any additional information from my end. Thanks and regards, Prakash [Prakash ] We are using iproute2 version-4.20.0-2+deb10u1 on amd64 platform. Our use case is very simple. We are creating/destroying a server socket based on some event using below code. // server socket creation int sd = socket(AF_TIPC, SOCK_SEQPACKET, 0); // Closing server socket close(sd); After closing the socket the file descriptor is freed but the tipc socket is still present in "tipc socket list" output. We have multiple applications in our system which are using tipc sockets. But we see this behaviour(stale tipc socket) only in one application. The only difference which I can notice is that this particular application is spawning "strace" to monitor some other application. I am not sure but it looks like somehow running strace is affecting tipc socket cleanup. >>> Perhaps you need to provide detailed reproduction steps like these: 1/ Output of “tipc socket list” before cleanup (to determine how many sockets are existing) 2/ strace command with detailed input parameters 3/ Do the cleanup 4/ Output of “tipc socket list” after cleanup _______________________________________________ tipc-discussion mailing list tipc-discussion@lists.sourceforge.net https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Ftipc-discussion&data=05%7C01%7Cgary.duzan%40fisglobal.com%7Ce548993f9552411d1b0608db55314e07%7Ce3ff91d834c84b15a0b418910a6ac575%7C0%7C0%7C638197442480641340%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=13RgGXQpTsC%2BmNp28zM6Xf442mA8Xyhr0%2BqWiiIJoXM%3D&reserved=0<https://lists.sourceforge.net/lists/listinfo/tipc-discussion> The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _______________________________________________ tipc-discussion mailing list tipc-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tipc-discussion