X-Debbugs-Cc: debian-hurd@lists.debian.org
Dear Maintainer,
Would you consider the attached patch aiming to address the long standing FTBS
on the Hurd, and allow Hurd users to explore gopher space?
Best regards,
João
[2. text/x-diff; gopher-3.0.17.4-hurd.patch]...
Thank you for sending this patch! I don't believe it's correct,
however.
On line 202, curcwd is malloced. Overwriting it prevents freeing it
later, so this creates a memory leak.
I suspect the later instance also has that issue.
How exactly is getcwd() defined and used on Hurd?
Hello John,
Thank you for having a look at the patch.
I apologise as the patch is indeed a bit rushed.
On Thu, Apr 10, 2025 at 10:15:02PM -0500, John Goerzen wrote:
Thank you for sending this patch! I don't believe it's correct,
however.
On line 202, curcwd is malloced. Overwriting it prevents freeing it
later, so this creates a memory leak.
I suspect the later instance also has that issue.
I see what you mean. Instead of allocating the memory on line 202, would it not
be possible to dynamically allocate with getcwd(NULL, 0) when that function is
available?
Is there any case that would not be covered by this?
How exactly is getcwd() defined and used on Hurd?
My understanding is that on Hurd getcwd() is just defined in glibc. Looking at
the comment in https://sources.debian.org/src/glibc/2.41-7/io/getcwd.c/?hl=39#L25
Many thanks,
João
I think that would work fine on Linux and Hurd. That behavior, however, isn't POSIX so wouldn't be portable. Can you clarify what the problem
with getcwd() as written is on Hurd? From the description in glibc, it sounds like the behavior is the same as on Linux.
Hello John,
On Wed, Apr 16, 2025 at 07:32:22AM -0500, John Goerzen wrote:
I think that would work fine on Linux and Hurd. That behavior, however,
isn't POSIX so wouldn't be portable. Can you clarify what the problem
with getcwd() as written is on Hurd? From the description in glibc, it
sounds like the behavior is the same as on Linux.
The issue is that MAXPATHLEN is not defined on Hurd. For reference: https://darnassus.sceen.net/~hurd-web/faq/foo_max/
It is interesting that you mention POSIX compliance, as I have seen contradictory information about this. The above linked page states that getcwd(NULL, 0) is part of POSIX 2008.
Every reference I have seen says it's not part of POSIX. However, Linux
and the BSDs seem to support it, so might as well just assume it will
work. If you have a patch to just go that direction, I'll take it.
Every reference I have seen says it's not part of POSIX. However, Linux
and the BSDs seem to support it, so might as well just assume it will
work. If you have a patch to just go that direction, I'll take it.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 482 |
Nodes: | 16 (2 / 14) |
Uptime: | 41:53:47 |
Calls: | 9,566 |
Files: | 13,656 |
Messages: | 6,141,868 |