Operating System - Tru64 Unix
1753758 Members
4462 Online
108799 Solutions
New Discussion юеВ

Re: File descriptor leak when using with the getnameinfo function

 
Julien Charbon
New Member

File descriptor leak when using with the getnameinfo function

Hi all, I have a weird behavior when I use the getnameinfo() function on Tru64:

Problem:
Each time a program call getnameinfo(), the system open the files /etc/hosts and /etc/ipnodes, read them, return the expected result but _don't close_ these both files. Which drive a file descriptor leakage.

System:
$ uname -a
OSF1 juliette V5.1 2650 alpha

Compiler:
$ gcc -v
Thread model: single
gcc version 3.3.1

Steps to reproduce:

1. Compile the joined testcase
$ gcc -Wall getnameinfo.c -o getnameinfo

2. Launch
$ ./getnameinfo

3. Check with lsof the file descriptor leakage
$ ps aux |grep getnameinfo
comp 474152 0.0 0.1 2.38M 528K pts/0 S + 11:13:25 0:00.01
./getnameinfo
$ lsof -p 474152
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
getnamein 474152 comp txt VREG 3296,411653 167536 962 /sbin/loader
getnamein 474152 comp txt VREG 3296,411653 2321952 1382 /shlib/libc.so
getnamein 474152 comp 0u VCHR 6,0 0t3962831 1821 /dev/pts/0
getnamein 474152 comp 1u VCHR 6,0 0t3962831 1821 /dev/pts/0
getnamein 474152 comp 2u VCHR 6,0 0t3962831 1821 /dev/pts/0
getnamein 474152 comp 3r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 4r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 5r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 6r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 7r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 8r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 9r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 10r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 11r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 12r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 13r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 14r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 15r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 16r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 17r VREG 3296,411653 1851 1994 /etc/hosts
getnamein 474152 comp 18r VREG 3296,411653 1717 2000 /etc/ipnodes
getnamein 474152 comp 19r VREG 3296,411653 1851 1994 /etc/hosts
....

This is a well-know issue on Tru64? Does a patch/a workaroung correct this issue?

Thanks.
4 REPLIES 4
Rob Leadbeater
Honored Contributor

Re: File descriptor leak when using with the getnameinfo function

Hi,

> Does a patch/a workaround correct this issue?

Not sure as we've no idea exactly what version / patches you're running....

Please post the output of

# sizer -v

# dupatch -track -type kit


Cheers,

Rob
Julien Charbon
New Member

Re: File descriptor leak when using with the getnameinfo function

Hi,

here the result of commands:

# sizer -v
Compaq Tru64 UNIX V5.1B (Rev. 2650); Thu Jul 3 06:30:19 GMT 2003

# dupatch -track -type kit

* Previous session logs saved in session.log.[1-25]

- This dupatch session is logged in /var/adm/patch/log/session.log


Gathering details of relevant patches, this may take a bit of time


Patches installed on the system came from following patch kits:
--------------------------------------------------------------

- T64V51BB1AS0001-20021229 OSF540
- T64V51BB22AS0002-20030415 OSF540

NOTE

When a patch kit is listed, it does not necessarily mean
all patches on that kit are installed on your system.
Martin Moore
HPE Pro

Re: File descriptor leak when using with the getnameinfo function

Hi Julien,

This is a known bug that was fixed in patch kit 6 for V5.1B. Your dupatch output indicates that you're running patch kit 2, which is considerably out of date. To get around this leak, upgrade your system to kit 6 or kit 7 (the latest).

Regards,
Martin
I work for HPE
A quick resolution to technical issues for your HPE products is just a click away HPE Support Center
See Self Help Post for more details

Accept or Kudo

Julien Charbon
New Member

Re: File descriptor leak when using with the getnameinfo function

Perfect answer, I will upgrade to patch kit 6 [or 7] for V5.1B. Thank you.

Best regards.