Skip navigation.
Home
The QNX Community Portal

View topic - QNX File Descriptor Leak

Page 1 of 1

QNX File Descriptor Leak

PostPosted: Wed Dec 14, 2016 9:58 am
by vjeevana
down vote
favorite
Working on a platform with below details

QNX localhost 6.3.0 2008/01/15-13:30:11EST IXP_23xx armbe

One of our application process leaks file descriptor. We found that file descriptor leakage happens by print "Too many open files" . Then we verified file leakgae be below program (I have pasted only skeleton/logic of the program)

(dir = opendir ("/proc"))
pid = atoi (dirent -> d_name)
sprintf (paths, "/proc/%d/as", pid);
fd = open (paths, O_RDONLY)
devctl (fd, DCMD_PROC_INFO, &info, sizeof (info), 0)
printf("files allocated %u\n",info.num_fdcons)


In QNX we are not able to find out api which will enable us to find out list of file descriptors and their properties opened by the process.(pidin -o is available only from 6.3.2.. we are using 6.3.0 . sin command is also not supported).

Re: QNX File Descriptor Leak

PostPosted: Wed Dec 14, 2016 2:26 pm
by Tim
Why don't you just slay your process's one by one and run your leak detect program after slaying each one.

When you get your file descriptors back then you know which process is leaking.

Tim

Re: QNX File Descriptor Leak

PostPosted: Thu Dec 15, 2016 12:59 pm
by denkelly
Try "pidin fds"