Overview
| Artifact ID: | 917ce6fcd764544d2cf12ade55a804fcff97dbc4450e817c698ca9af2e55b210 |
|---|---|
| Ticket: | 92564326a98b551099d3e61bbe88e3b5f9720c15
Open file descriptor leak: better align dir operations(opendir/readdir/closedir) all to either 64bit or 32bit ones. |
| User & Date: | wrenashe on 2018-05-08 07:02:43 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
We recently got "file operator leaks" on AIX from Tcl 8.5.19/8.6.3 which was built by ourselves on AIX for 32-bit Tcl target. build@aixbuild 8>xlC_r -qversion IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07) Version: 13.01.0003.0000 The sympton was like, <-libc.a:opendir() = 3603f978 0.000000 495.8273: getdirent(161, 0x360ADD78, 4096) = 1024 496.6565: getdirent(161, 0x360ADD78, 4096) = 0 ->libc.a:closedir(0x3603f978) <-libc.a:closedir() = 0 0.000000 ->libc.a:opendir(0x35caf13c) 498.2069: getdirent(161, 0x360ADD78, 4096) = 116 <-libc.a:opendir() = 3603f978 0.000000 498.2097: getdirent64(161, 0x360ADD78, 4096) = 160 498.2100: getdirent64(161, 0x360ADD78, 4096) = 0 ->libc.a:closedir(0x3603f978) <-libc.a:closedir() = ffffffffffffffff 0.000000 You can see closedir() fails at the end and then the file operator is leaked then. The problem is caused by closedir() call after readdir64() which is enabled by "-DHAVE_STRUCT_DIRENT64=1" instead of readdir() during the build. The warning is issued during the build. "/work/app/external/tcl8.5.19/unix/../unix/tclUnixFile.c", line 392.35: 1506-280 (W) Function argument assignment between types "struct dirdesc64*" and "struct dirdesc*" is not allowed. The suggestion is to align all the DIR operations in either 64-bit or 32-bit ones to avoid build warning and file operator leak in the runtime. Tcl now only has TclOSreaddir defined for readdir/readdir64(). Tao
- foundin changed to: "8.5.19 and above"
- is_private changed to: "0"
- login: "wrenashe"
- priority changed to: "5 Medium"
- private_contact changed to: "f5e96bd3168d173a07f11b6f7040c085db1fb97d"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "wrenashe"
- subsystem changed to: "37. File System"
- title changed to:
Open file descriptor leak: better align dir operations(opendir/readdir/closedir) all to either 64bit or 32bit ones.
- type changed to: "Bug"