tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: sternenseemann <sternenseemann@systemli.org>
To: tech@mandoc.bsd.lv
Subject: Re: makewhatis: segfault in dbadd when using -a
Date: Thu, 19 Aug 2021 00:02:13 +0200	[thread overview]
Message-ID: <14853b5f-c67e-a317-17fe-9c3a92f516b7@systemli.org> (raw)
In-Reply-To: <20210811150959.GI38774@athene.usta.de>

Hi Ingo,

On 8/11/21 5:09 PM, Ingo Schwarze wrote:
> Does the following patch make sense to you and work for you?

Yes, tested it with my real world case and it doesn't crash anymore!
Sorry for the delay with testing.

> You stared at the wrong place.  That may be where the car finally
> exploded, but not where it ran off the road.

Indeed, I later realized that treescan was to blame when I investigated
something else which you won't like to hear…

> Note that i don't feel like actually *following* such a link unless
> people show real-world use cases that require it.  If the link target
> is below the same manpath, it will be reached by direct traversal, too.
> Nobody claimed so far that having such a link point to the cellar or
> store might be useful, and if i understand sufficiently well what the
> point of a cellar or a store is, indeed it could hardly be useful.
> If it points somewhere else, it certainly should not be followed.

So, about that: NixOS creates its man directories exclusively by
symlinking man pages into a common directory from a lot of sysroot-esque
directories in the store. Of course the starting point is not individual
man pages, but lots of share/man directories in the “little sysroots”.
When building the common man path, naturally the script tasked with
doing this tries to create as little symlinks as possible: If a
directory of the common manpath is only present in one store-sysroot,
the script will symlink the directory instead of creating one and
symlinking every file in it.

Unfortunately, there is a few man sections which basically come
exclusively from one package, so from one store path: man1p and man3p
from Linux' man-pages-posix package. So for me
$GLOBAL_MANPATH/share/man3p is a symlink to
/nix/store/2fn4bf6xj9bxq3dpa6mznqbzqqanfdiv-man-pages-posix-2017a/share/man/man3p
and makewhatis(8) can't index it.

This is, however, a bit of an edge case and there is a workaround
(running a script which converts it into a proper directory), but still
a bit annoying. For the standard man sections this will probably never
happen.

I also fear that traversing such symlinks is not easy to patch into the
portable version since it would mean changing treescan quite
significantly (which currently assumes that symlinks if they are “good”
point to regular files) and you'd be hesitant to touch the in-tree one
for something like this?!

Cheers,

Lukas
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv


  reply	other threads:[~2021-08-18 22:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 23:53 sternenseemann
2021-08-11 15:09 ` Ingo Schwarze
2021-08-18 22:02   ` sternenseemann [this message]
2021-08-19 17:11     ` Ingo Schwarze
2021-09-06 14:50       ` Ingo Schwarze
2021-09-06 15:52         ` sternenseemann
2021-09-06 17:12           ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14853b5f-c67e-a317-17fe-9c3a92f516b7@systemli.org \
    --to=sternenseemann@systemli.org \
    --cc=tech@mandoc.bsd.lv \
    --subject='Re: makewhatis: segfault in dbadd when using -a' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).