Bug 65443 (suse50443)

Summary: man page open for tcl not correct
Product: [openSUSE] SUSE Linux 10.1 Reporter: Andreas Klein <asklein>
Component: BasesystemAssignee: Reinhard Max <max>
Status: RESOLVED UPSTREAM QA Contact: Karl Eichwalder <ke>
Severity: Minor    
Priority: P3 - Medium CC: maiku.fabian, max, vetter, werner, wl
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: patch to avoid nasty warnings about line breakage/adjusting
patch for an-old.tmac
patch for env.cpp
patch for open.n

Description Andreas Klein 2005-02-03 00:40:23 UTC
type man open in a xterm:
 Manual page open(n) line 1/usr/share/man/mann/open.n.gz:421: warning [p 3,
4.5i]: cannot adjust line
/usr/share/man/mann/open.n.gz:433: warning [p 3, 6.5i]: cannot adjust line
/usr/share/man/mann/open.n.gz:441: warning [p 3, 7.8i]: cannot adjust line
/usr/share/man/mann/open.n.gz:447: warning [p 3, 9.0i]: cannot adjust line
/usr/share/man/mann/open.n.gz:455: warning [p 3, 10.5i]: cannot adjust line
/usr/share/man/mann/open.n.gz:457: warning [p 3, 11.0i]: cannot adjust line
/usr/share/man/mann/open.n.gz:464: warning [p 4, 1.0i]: cannot adjust line
/usr/share/man/mann/open.n.gz:482: warning [p 4, 4.3i]: cannot adjust line
/usr/share/man/mann/open.n.gz:484: warning [p 4, 5.0i]: can't break line
/usr/share/man/mann/open.n.gz:486: warning [p 4, 5.5i]: cannot adjust line
/usr/share/man/mann/open.n.gz:490: warning [p 4, 6.7i]: can't break line
/usr/share/man/mann/open.n.gz:493: warning [p 4, 7.3i]: cannot adjust line
/usr/share/man/mann/open.n.gz:497: warning [p 4, 8.3i]: can't break line
/usr/share/man/mann/open.n.gz:500: warning [p 4, 9.0i]: can't break line
/usr/share/man/mann/open.n.gz:503: warning [p 4, 9.7i]: can't break line
/usr/share/man/mann/open.n.gz:505: warning [p 4, 10.3i]: can't break line
/usr/share/man/mann/open.n.gz:524: warning [p 5, 2.2i]: can't break line
/usr/share/man/mann/open.n.gz:529: warning [p 5, 3.2i]: can't break line
/usr/share/man/mann/open.n.gz:533: warning [p 5, 4.0i]: cannot adjust line
/usr/share/man/mann/open.n.gz:539: warning [p 5, 5.2i]: cannot adjust line
/usr/share/man/mann/open.n.gz:544: warning [p 5, 6.2i]: can't break line
/usr/share/man/mann/open.n.gz:549: warning [p 5, 7.0i]: can't break line
Comment 1 Reinhard Max 2005-02-03 02:37:06 UTC
AFAIK, this is a problem with recent versions of groff.
People in the Tcl community that use other implementations of nroff told me,
that they don't get these warnings and the resulting misformattings.
Werner, can you shed some light on this?
Comment 2 Dr. Werner Fink 2005-02-03 02:39:28 UTC
You should ask Mike.  I've also a problem with mm files of the ksh.
Comment 3 Andreas Klein 2005-02-24 21:48:14 UTC
Still does not work in 9,3b1
Comment 4 Mike Fabian 2005-03-01 19:27:02 UTC
These are just warning messages and the man page in question still
formats just fine.

See also:

http://lists.gnu.org/archive/html/groff/2005-02/msg00025.html
Comment 5 Andreas Klein 2005-03-01 19:37:44 UTC
Only if you press ctrl+l to refresh the screen, otherwise the first lines are
"hidden" by the warnings.
Comment 6 Mike Fabian 2005-03-01 22:16:42 UTC
I don't know what you are using to view your man-pages.
I tried "man open" with the default settings (pager is "less")
and M-x man in (X)Emacs. In (X)Emacs you cannot see the warnings
at all. When using "man open" on the command line you can see the
warnings for a very short moment only (on a fast machine) then
you can only see the rendered result in less. The warnings go to
stderr and the result goes to stdout. "less" gets only the result
from stdout, not the warning from stderr. So how should "less" be able
to display the warnings?

The only way for me to see these warnings longer than a few milliseconds
was using something like:

    man open 2>&1 | less

But who does that?

Are you using some strange terminal or a very strange pager?
Comment 7 Andreas Klein 2005-03-02 10:21:02 UTC
I am logged in with fvwm. Terminal is a standard xterm from fvwm menu:
xterm -geometry 80x24+513+10 -e bash -login -sl 10000
PAGER is less.
Comment 8 Reinhard Max 2005-03-02 10:31:45 UTC
I also only see the warnings for a moment when using the same arguments to xterm
as you, but there are some misformattings in the manpage that are related to the
warnings. BTW, the warnings and misformattings seem always to be related to
changebars. E.g. the in the description of the -mode option in open(n), the line
that shows the syntax (-mode baud,parity,data,stop) is needlessly broken in two
lines, and the second of them has two changebars.
Comment 9 Dr. Werner Fink 2005-03-02 10:46:54 UTC
Try

      zcat /usr/share/man/mann/open.n.gz | nroff -mandoc > /dev/null

to get stderr.
Comment 10 Reinhard Max 2005-03-02 10:48:34 UTC
Why so complicated? I just used "man n open > /dev/null". ;)
Comment 11 Reinhard Max 2005-03-02 10:50:17 UTC
BTW my point wasn't that I can't get to see the warnings, but that they are not
normally contained in what less displays, and that there are in fact misformattings.
Comment 12 Mike Fabian 2005-03-02 11:04:03 UTC
Yes, and because they are not normally contained in what less displays,
they are not very important in my opinion.

And, if something needs to be fixed it is the source of the man-page,
not groff.
Comment 13 Reinhard Max 2005-03-02 11:09:32 UTC
These manpages work fine with other implementation of nroff, and with older
versions of groff. So why do you think it is a bug in the source of the manpage?

But anyways, if you can show me how to fix the man pages so that they work fine
with current groff, AND other nroff implementations, I'll be glad to do make the
change.
Comment 14 Dr. Werner Fink 2005-03-02 11:10:46 UTC
Complicated? Hmm ... I want only be sure to see
the result of a bad nroff text file instead of
a automatic preprocessor like tbl or eqn.

As you can see from line 389ff of /usr/share/man/mann/open.n.gz

.TP
\fB\-mode\fR \fIbaud\fB,\fIparity\fB,\fIdata\fB,\fIstop\fR

which leads to the bad formated ident mark:

       -mode baud,par-                                                         |
       ity,data,stop

the change to

.TP
\fB\-mode\fR \fIbaud\fB, \fIparity\fB, \fIdata\fB, \fIstop\fR

would give a better formated ident mark:

       -mode baud, parity, data,                                               |
       stop

but also with a folded text within the mark.
Comment 15 Reinhard Max 2005-03-02 11:20:46 UTC
This change is wrong, as the -mode option doesn't allow any white space in it's
arguments.

Werner, do you have an idea where these unneeded foldings and duplicated
changebars might come from? Is it groff, or is it something in the man.macros
file that comes with Tcl, and gets copied into each manpage during installation?

BTW, when I use "man -T n open", I get no warnings, and the resulting Postscript
output doesn't contain extra foldings or double change bars.
Comment 16 Dr. Werner Fink 2005-03-02 11:52:56 UTC
IMHO the groff package seems to be very sensitive if used for
terminal output.  Maybe caused by some nroff macros of open.n
by its self.  Could be done by a defined macro which does not
reset its used spacing after finishing .. ?
Comment 17 Reinhard Max 2005-04-21 09:47:37 UTC
I don't think this is architecture speciffic.
But I still have no idea how to deal with it.
Comment 18 Reinhard Max 2005-05-23 13:04:47 UTC
To comment #16: I have no idea how to define such a macro.
Werner, if you can't help me, probably nobody here can, and I'll close this as
WONTFIX and hope it will be fixed upstream one day (either in groff or in tcl).
Comment 19 Mike Fabian 2005-05-23 13:08:13 UTC
It's a tcl problem, not a groff problem.
Comment 20 Reinhard Max 2005-05-23 13:22:02 UTC
Why do you think so?

As said in comment #1 other people from the Tcl community told me that the
manpages render correctly on their unix flavours with other implementations of
nroff.

So as long as nobody can show me what's excactly wrong in the nroff source of
the Tcl manpages, I'll assume that they are OK, and just trigger a bug in groff.
Comment 21 Dr. Werner Fink 2005-05-23 13:45:10 UTC
Created attachment 37901 [details]
patch to avoid nasty warnings about line breakage/adjusting

Try out the patch in the attachment.
It switches of the VS before an .TP or .IP
macro and reanble the VS afterwards.
Comment 22 Mike Fabian 2005-05-23 13:46:15 UTC
Werner Lemberg, the upstream author of groff, said that recent versions of groff have become more picky about errors in the source files (like man-pages) which were previously ignored. Just like gcc4 warns about a lot of stuff older gcc versions just ignored.  It works for people on other flavours of Linux like systems only because they have older implementations of nroff which are less picky.
Comment 23 Reinhard Max 2005-05-23 13:55:19 UTC
to comment #21: excluding .TP and .IP from the change bars is a workaround, but
not a solution. If these lines have changed, it is desired that they also have
the change bars.

to comment #22: These people are not on other flavours of Linux, but on other
(non-Linux) flavours of Unx with different (non-GNU) implementations of *roff.
And what drives me to the conclusion, that the bug is in groff is not that they
get no warnings, but that they do get correctly formatted output.
Comment 24 Mike Fabian 2005-05-23 14:14:48 UTC
Reinhard> These people are not on other flavours of Linux, but on other
Reinhard> (non-Linux) flavours of Unx

I only wrote "Linux like systems" because in one of our Tuesday
meetings it was said that this is the preferred expression to talk
about UNIX like systems because UNIX is a trade mark.  And if Linux is
UNIX like, UNIX is also Linux like. ☺

Comment 25 Reinhard Max 2005-05-23 14:58:15 UTC
Here's a little excerpt form the Tcl'ers chat, where I just brought up the topic
again:

[16:25]	dkf  OK, located the original roff manual
[16:27]	dkf  And we're just specifying a margin character
[16:28]	dkf  Looks exactly like a groff bug to me :)
[16:30]	dkf  In fact, the roff manual *demonstrates* the use of .mc (or 'mc?)
             in a way compatible with Tcl's use
[16:30]	dkf  AIUI anyway
[16:33]	dkf  Page 26 of the Troff User's Manual (aka Bell Labs CSTR#54,
             http://cm.bell-labs.com/cm/cs/cstr/54.ps.gz)
[16:55]	dkf  The key is that CSTR#54 is *the* normative reference for *roff
[16:55]	dkf  It's referenced from everywhere else
Comment 26 Mike Fabian 2005-05-23 15:03:10 UTC
Add Werner LEMBERG <wl@gnu.org> (current upstream groff maintainer) to CC:.

Comment 27 Mike Fabian 2005-07-26 14:10:13 UTC
Werner,

is this a bug in groff or in the source of the man-pages?

If it is a bug in the source of the man-pages, how should the man-pages be
changed?
Comment 28 Dr. Werner Fink 2005-07-26 14:25:47 UTC
It is a bug in the groff sources.
Comment 29 Reinhard Max 2005-07-26 14:31:20 UTC
The term "groff sources" is ambiguous.
Do you mean the C source code of groff, or the source code of the manpages?

And BTW, Mike's question was directed to Werner Lemberg, not Werner Fink :)
Comment 30 Reinhard Max 2006-01-16 13:36:46 UTC
As this seems to be a bug in groff, there is nothing I can do about it.
Reassigning to the groff maintainer.
Comment 31 Dr. Werner Fink 2006-01-16 13:41:43 UTC
maintainer groff
mfabian@suse.de
Comment 32 Reinhard Max 2006-01-16 13:51:35 UTC
Whoops, sorry, I confused "maintainer groff" and "maintainer man" ;)
Comment 33 Werner Lemberg 2006-05-27 14:52:01 UTC
Somehow this bug has disappeared from my radar screen...

I've fixed that now.  It was mainly a bug in groff's man macros which
didn't handle margin characters correctly in .TP and friends.
Interestingly, my fix exposed another bug in the troff binary, causing
a crash.

Besides this, there are problems with the macro stuff in open.n --
this is something you should probably forward to the tcl/tk people.
Note that I intentionally don't enhance the macros to use groff
extensions, and my modifications are as small as possible.

  . The implementation of .VE is flawed.  I would, similar to .VS, add
    two arguments; the first to be ignored (being a version number),
    the second telling .VS to emit a .br command.  To make the margin
    character stop at the right line I've modified the man page
    slightly.

  . The .BS line has a typo IMHO.  Without this fix, the two lines
    surrounding the NAME and SYNOPSIS sections have different lengths.
    It is arguable whether those two lines should really have that
    length...

  . Another typo is in .BE, which fortunately has no effect.

I've attached three patches; the two regarding groff are already in
the CVS.
Comment 34 Werner Lemberg 2006-05-27 14:54:28 UTC
Created attachment 85379 [details]
patch for an-old.tmac
Comment 35 Werner Lemberg 2006-05-27 14:54:56 UTC
Created attachment 85380 [details]
patch for env.cpp
Comment 36 Werner Lemberg 2006-05-27 14:55:21 UTC
Created attachment 85381 [details]
patch for open.n
Comment 37 Reinhard Max 2006-05-29 09:42:30 UTC
Thanks, Werner.
I'll take care to push your improvements upstream into Tcl/Tk.
Comment 38 Reinhard Max 2006-08-03 11:54:39 UTC
*** Bug 196763 has been marked as a duplicate of this bug. ***
Comment 39 Andreas Jaeger 2009-02-25 15:00:49 UTC
Reinhard, can we close this bug now?  I consider it as Resolved UPstream - correct?
Comment 40 Reinhard Max 2009-07-09 12:04:30 UTC
Yes, I just checked the open(n) manpage of the upcoming 8.6 release of Tcl and it doesn't print any warnings anymore.