bugDatabase-driven manual pager suite - Bugs: bug #50324, Bump or remove MAXDIRS

 
 

bug #50324: Bump or remove MAXDIRS

Submitter:  None
Submitted:  Thu 16 Feb 2017 08:42:43 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  cjwatson
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 03 Aug 2019 11:17:56 AM UTC, comment #4: 

Fixed in man-db 2.8.6.

Colin Watson <cjwatson>
Group administrator
Sun 28 Apr 2019 01:47:53 PM UTC, comment #3: 

I don't understand why you would expect my patch to completely work in 2.8.5, when it hasn't been released yet and will be in 2.8.6?

Colin Watson <cjwatson>
Group administrator
Sun 28 Apr 2019 10:44:05 AM UTC, comment #2: 

Thanks Colin for the patch

Somehow it doesn't completely work for me

export MANPATH=/usr/share/man
for i in {1..140}; do export MANPATH=${MANPATH}:/usr/share/man; printf "$i <> "; echo $MANPATH |wc -c; man cat > /dev/null; done

....

127 <> 1920
man: manpath list too long
128 <> 1935


man --version
man 2.8.5


Any idea?

Thanks
Justin

Justin <jlec>
Sat 26 Jan 2019 01:34:21 PM UTC, comment #1: 

I've pushed a fix for this to master which removes the arbitrary limit:

  https://git.savannah.gnu.org/cgit/man-db.git/commit/?id=199a6e80e7b4baa27e195f2c1120c45df9ea4e67

Colin Watson <cjwatson>
Group administrator
Thu 16 Feb 2017 08:42:43 AM UTC, original submission:  

With a long enough $MANPATH, trying to look up a man page fails with

man: manpath list too long

From briefly looking at the source code, it seems this is due to the constant MAXDIRS which is set to 128.

Would it be possible to bump MAXDIRS to some significantly higher value, or allocate dynamically (limited then only by the system limit on environment variable sizes?)?

As to what is the real use for long $MANPATH's, in HPC environments it's common to use some variant of a "module" system to provide software not provided by the base system, provide multiple versions at the same time etc. Currently the most popular module system is probably lmod ( lmod.readthedocs.io/ ), often coupled with something like EasyBuild ( https://hpcugent.github.io/easybuild/ ) to build software and generate the corresponding module files. The module system allows end users to load/unload/search etc. modules, where loading a module brings some specific software package and a specific version into the user environment, typically by prepending to $PATH, $LD_LIBRARY_PATH, $MANPATH, etc. Modules can also specify dependencies, meaning that loading a module causes other modules to be loaded as well.  As you can probably imagine by now, this can lead to a situation where the $MANPATH becomes too long, and users are then unable to view man pages until they unload some modules (which may remove the man page they are trying to read from $MANPATH).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jlec (Posted a comment)
  • -email is unavailable- added by cjwatson (Updated the item)
  • -email is unavailable- added by jlec
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-08-03 cjwatson StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-01-26 cjwatson StatusIn Progress Ready For Test
    2019-01-26 cjwatson StatusNone In Progress
        Assigned toNone cjwatson
    2017-12-19 jlec Carbon-Copy- Added jlec

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code