- Package:
- src:memstat
- Source:
- memstat
- Submitter:
- Tanguy LE CARROUR
- Date:
- 2013-11-28 20:03:07 UTC
- Severity:
- wishlist
Hi, This patch solves the build problems for GNU/Hurd due to PATH_MAX issues. The solution is to make dynamic string allocations instead of using fixed length buffers. The patch involves one file, and is trivial. Parts of the the code has been reviewed by GNU/Hurd developers and Debian GNU/Hurd developers and maintainers. Thanks! Tanguy
tag 658384 -patch thanks Thanks for your effort, but unfortunately the patch does not work. It might make memstat compile on Hurd, but it certainly creates a non-funtional binary on Linux. Please run the progam on Linux with and without your patch to see the different output. Michael
Hi, Le vendredi 3 février 2012, Michael Meskes <meskes@debian.org> a écrit : might binary see the Thanks for trying the patch! I did notice some differences in the outputs but I thought it was time-related, meaning that I tried the 2 versions at different moments and the memory occupation was different.... But I'm not (yet) a memstat specialist so I'm not sure what to expect! ^_^' I'll try to see what's wrong, but any advice is welcome. Thanks for your time, Tanguy
Hi Tanguy, The problem is due to lstat() always returning a null size on Linux for /proc/*/exe, so the approach described in readlink(2) cannot be applied. You will need a reallocation loop similar to what you did for get_line().
Hi, 2012/2/3 Michael Meskes <meskes@debian.org>: I'm attaching the corrected version of the patch. Even if the output is not exactly the same (memstat scans its own memory and the fixed software uses a dynamically allocated variable) I thinks the fix would be appropriate for Linux. But, even if it solves the FTBFS on Hurd the output on this OS is not correct. On Hurd the /proc is not totally implemented so memstat, even fixed, cannot work. I'll keep the patch and resubmit it when Hurd has a complete /proc file-system. Thanks again for your time, Tanguy