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

Hi Lukas,

sternenseemann wrote on Thu, Aug 19, 2021 at 12:02:13AM +0200:
> 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.

No problem, thanks for testing.

The patch is now committed to OpenBSD-current and to bsd.lv HEAD.


> 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.

Uh oh.  So there *is* a real-world use case for symlinks to
directories.

It doesn't matter that on first sight, this whole approach feels quite
fragile to me.  Isn't that going to blow up in horrible ways as soon as
somebody creates a package that also uses "man3p"?  For example, on
OpenBSD, "man3p" is used for manuals of Perl library functions.

  schwarze@isnote $ uname -a
  OpenBSD isnote.usta.de 6.9 GENERIC.MP#101 amd64
  schwarze@isnote $ man -f 3p warnings 
  encoding::warnings(3p) - Warn on implicit encoding conversions
  warnings(3p) - Perl pragma to control optional warnings
  warnings::register(3p) - warnings import function

Anyway, if systems use that, considering whether it can be supported
with resonable effort makes sense.  No guarantee, of course.
I'll think about it for a bit.

> 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)

Yes.

> and you'd be hesitant to touch the in-tree one
> for something like this?!

Can't say without looking at the code in detail, so bear with me.

Yours,
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv


  reply	other threads:[~2021-08-19 17:12 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
2021-08-19 17:11     ` Ingo Schwarze [this message]
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=20210819171150.GD56790@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=sternenseemann@systemli.org \
    --cc=tech@mandoc.bsd.lv \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).