D8413: Filelight crashes if readdir returns very long file name
Aleksei Nikiforov
noreply at phabricator.kde.org
Sun Oct 22 12:19:05 UTC 2017
i.Dark_Templar added a comment.
I'm not sure what part exactly is broken. It's just an incompatibility between linux (posix maybe?) file length limits and windows (ntfs) limits. I'm using default gentoo libc (sys-libs/glibc-, "GNU lib C library"). I've ran filelight under valgrind and didn't notice any warnings that glibc writes anything to wrong memory address. I've looked it up, and it looks like glibc allocates buffer large enough to hold more than NAME_MAX path (on my system it allocates 32768 bytes for whole DIRP, struct dirent and additional internal stuff). And it has a special structure field d_reclen to indicate the actual length of returned record. In my case d_reclen holds value 288 (for a filename 264 bytes long). It's not fully standard compatible, but I guess it helps to work around such system design incompatibilities and usually goes unnoticed by users.
REPOSITORY
R352 Filelight
REVISION DETAIL
https://phabricator.kde.org/D8413
To: i.Dark_Templar, sitter, kfunk, sandsmark
Cc: sandsmark, kde-utils-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20171022/7e48a5c9/attachment.html>
More information about the Kde-utils-devel
mailing list