FS#22866 - [man-db] man command is returning incorrect man page for non existent ones

Attached to Project: Arch Linux
Opened by Raghavendra D Prabhu (rprabhu) - Saturday, 12 February 2011, 11:17 GMT
Last edited by Andreas Radke (AndyRTR) - Wednesday, 13 April 2011, 16:42 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
man command is returning an incorrect entry.


Additional info:

Version
Name : man-pages
Version : 3.32-1
URL : http://www.kernel.org/doc/man-pages/


Steps to reproduce:
/usr/bin/man 1 asdasd

This returns man page for std::_Build_index_tuple and after exiting man output says "No manual entry for asdasd"

Happens only for man 1 <nonexistent> and man 2 <nonexistent>

Ideally, it should say

No manual entry for asdasd in section 1 with exit code 16
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Wednesday, 13 April 2011, 16:42 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in 2.6.0.2
Comment by Andreas Radke (AndyRTR) - Saturday, 12 February 2011, 15:04 GMT
[andyrtr@workstation64 ~]$ LANG=C /usr/bin/man 1 foo
No manual entry for foo

This seems to be an issue with man-db showing a wrong default page when the intended page is not found.
Comment by Andreas Radke (AndyRTR) - Saturday, 12 February 2011, 15:07 GMT
section 1 and 2 have that weird behavior. all other directly fail as expected.
Comment by Andreas Radke (AndyRTR) - Saturday, 19 February 2011, 16:25 GMT
http://savannah.nongnu.org/projects/man-db - you may want to bring this upstream though I've already mailed Colin about this.
Comment by Colin Watson (cjwatson) - Tuesday, 12 April 2011, 13:08 GMT
I can't reproduce this. Could you please post the output with the --debug option?
Comment by Andreas Radke (AndyRTR) - Tuesday, 12 April 2011, 14:20 GMT
see logfile
   logfile (41.4 KiB)
Comment by Colin Watson (cjwatson) - Tuesday, 12 April 2011, 21:09 GMT
Can I have a copy of /usr/share/man/man3/std::_Build_index_tuple.3.gz?

What's happening here is that, after failing to find foo(1), man falls back to considering '1' and 'foo' as separate manual page names (we have to try this because there are some legitimate manual page names that look like sections; the example I left in a source code comment is 'man 9wm fvwm'). It looks like std::_Build_index_tuple(3) is misparsed such that it has '1' and '2' as alternative names, so man shows that for '1' and then issues an error to the effect that it can't find 'foo'.

The proper fix for this is probably to fix the parsing of std::_Build_index_tuple(3) (which will require a full database rebuild to take effect).
Comment by Greg (dolby) - Tuesday, 12 April 2011, 23:25 GMT
Heres your man page, ftr i verify the problem as well.
Comment by Colin Watson (cjwatson) - Wednesday, 13 April 2011, 00:59 GMT
Thanks. I've managed to reproduce this now and am considering the best approach to a fix.
Comment by Colin Watson (cjwatson) - Wednesday, 13 April 2011, 09:27 GMT
Fixed for 2.6.0.2, coming soon.

Wed Apr 13 10:26:07 BST 2011 Colin Watson <cjwatson@debian.org>

* src/descriptions.c (parse_descriptions): Once we've seen at least
one record, ignore any further records that don't include a whatis
description, as they tend to be noise (Arch Linux bug #22866).
* NEWS: Document this.
Comment by Colin Watson (cjwatson) - Wednesday, 13 April 2011, 09:48 GMT
Incidentally, as I noted a few comments back, this will require a full database rebuild (mandb -c) to take effect.

Loading...