Bug 435453 - Errors with man -t formatting of ps man page
Errors with man -t formatting of ps man page
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: procps (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Tomas Smetana
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-29 09:17 EST by Matt Thompson
Modified: 2008-09-01 06:16 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-01 06:16:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Example PDF made from ps manpage via man -t (41.36 KB, application/pdf)
2008-02-29 09:17 EST, Matt Thompson
no flags Details
ps manpage created via groff pipestream (28.97 KB, application/pdf)
2008-02-29 09:49 EST, Matt Thompson
no flags Details

  None (edit)
Description Matt Thompson 2008-02-29 09:17:39 EST
Description of problem:
When one tries to make a PostScript (or PDF) version of the ps manpage, errors
crop up leading to a bad PS file.

Version-Release number of selected component (if applicable):
procps-3.2.7-17.fc8.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. man -t ps > trial.ps
2.
3.
  
Actual results:
> man -t ps > trial.ps
<standard input>:947: numeric overflow
<standard input>:1391: numeric overflow
<SNIP about 90 numeric overflows>
<standard input>:1391: numeric overflow
<standard input>:1404: addition overflow

Also, upon viewing the PostScript file (or a pdf formed using "man -t ps |
ps2pdf - trial.pdf; attached herein), the errors may be found on pages 10-14. 
You can see that some of the entries are running off the edge of the page.  It
looks like some wordwrap algorithm with gtbl isn't quite working.

Expected results:
A properly formatted PostScript file.

Additional info:
I have attached a PDF file made by the technique above.  Also, I wasn't sure who
to file this bug with.  I can see it being a procpc, man, or groff problem.
Comment 1 Matt Thompson 2008-02-29 09:17:39 EST
Created attachment 296353 [details]
Example PDF made from ps manpage via man -t
Comment 2 Tomas Smetana 2008-02-29 09:44:11 EST
Will check with the 'man' package maintainer.  I'm not sure the bug is in
procps.  I think man (groff?) should format the pages the same way as on the
screen.  And in a terminal it looks OK.
Comment 3 Matt Thompson 2008-02-29 09:48:57 EST
Thanks, I wasn't sure, but yeah it does appear correctly in terminal.  One other
thing I tried was based on an old webpage I found.  It used a command similar to
the one below to format pages for Xman.  So, I tried it with a different -T
command for groff.  Namely:

> gunzip -c /usr/share/man/man1/ps.1.gz | gtbl | geqn | gtbl | groff -Tps
-mandoc | ps2pdf - ps.manpage.pdf
gtbl:<standard input>:761: `.' not last character on line
gtbl:<standard input>:761: giving up on this table
gtbl:<standard input>:1490: `.' not last character on line
gtbl:<standard input>:1490: giving up on this table
gtbl:<standard input>:2014: `.' not last character on line
gtbl:<standard input>:2014: giving up on this table
gtbl:<standard input>:8020: `.' not last character on line
gtbl:<standard input>:8020: giving up on this table

Using this pipe-stream does indeed rid the errors.  Unfortunately it does so by
essentially stripping out the offending tables.  Just for reference, I am
attaching the PDF created with this method.

Comment 4 Matt Thompson 2008-02-29 09:49:34 EST
Created attachment 296358 [details]
ps manpage created via groff pipestream
Comment 5 Tomas Smetana 2008-03-14 07:55:57 EDT
Reassigning to man.
Comment 6 Ivana Varekova 2008-03-20 06:02:51 EDT
As is seen from the comment #3 this is not man problem - this is groff problem
man uses command 
cd /usr/share/man && /usr/bin/gunzip -c '/usr/share/man/man1/ps.1.gz' |
/usr/bin/gtbl | /usr/bin/groff -Tps -mandoc >trial.ps
which causes it.
Comment 7 Tomas Smetana 2008-03-20 06:13:19 EDT
Weird thing is that "man -t ps" and "groff -Tps -mandoc" will result in
different documents when run on ps.1.  How comes?
Comment 8 Marcela Mašláňová 2008-03-20 08:44:44 EDT
'cause man use some nrof -Something.

If you'll try to read this man page with mc, then you see another problems. This
man page has incorrect characters in table of contents (page 10 and next) and
that is the reason of all problems.
Comment 9 Tomas Smetana 2008-03-27 03:43:21 EDT
Marcela found out that the problem is caused by the following line:

.nr ColSize ((\n(.lu-\n(.iu/\n(.Hu-20u)n)

rewriting it to

.nr ColSize ((\n[.l] - \n[.i]) / 1n - 20)

seems to solve the problem.  I'll add this change to the next procps update.




Note You need to log in before you can comment on or make changes to this bug.