#658384 memstat: FTBFS on hurd-i386

#658384#5
Date:
2012-02-02 15:53:52 UTC
From:
To:
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

#658384#10
Date:
2012-02-03 17:26:00 UTC
From:
To:
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

#658384#17
Date:
2012-02-04 09:58:43 UTC
From:
To:
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

#658384#22
Date:
2012-02-04 13:53:53 UTC
From:
To:
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().

#658384#27
Date:
2012-02-07 13:09:27 UTC
From:
To:
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