bugGNU roff - Bugs: bug #64730, [html] pre-grohtml: fatal error:...

 
 

bug #64730: [html] pre-grohtml: fatal error: 'pre-grohtml' exited with status 2;

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sat 30 Sep 2023 10:27:31 PM UTC
   
 
Category:  Preprocessor html Severity:  3 - Normal
Item Group:  Build/Installation Status:  Unreproducible
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 01 Oct 2023 11:32:33 PM UTC, comment #3: 


>  The "groff" software, as a typesetting one, should not deal with

producing other formats like "html".
For that, software for converting between different formats is the
right choice.

  If people want "html" format they should do it themselves with
software like "pdftohtml" (Debian package "poppler-utils").

What other softwares for typesetting produce themselves formats like
"html"?

N.B.
  man (man-db) relies on "groff" to produce "html", but should (must)
it?

Software, that converts a format to "html", that I have on my Debian
testing computer is (man -k convert):

asciidoctor (1)      - converts AsciiDoc source files to HTML, DocBook, and other formats
enscript (1)         - convert text files to PostScript, HTML, RTF, ANSI, and overstrikes
pamtohtmltbl (1)     - convert pnm/pam visual image to an HTML table
pdftohtml (1)        - program to convert PDF files into HTML, XML and PNG images
pod2html (1)         - convert .pod files to .html files
rst-buildhtml (1)    - convert many reST documents to HTML
rst2html (1)         - convert reST documents to XHTML
rst2html4 (1)        - convert reST documents to XHTML
rst2html5 (1)        - convert reST documents to HTML 5
rstpep2html (1)      - convert reST Python Enhancement Proposals to HTML
wvHtml (1)           - convert msword documents to HTML4.0
xmlmantohtml (1)     - xml to html converter

-.-

  Compiling groff-1.23.0 shows these warnings, that do not show up in my
groff branch with my usual configuration and are not dependent on the C
or C++ standard that I use.

  CXX      src/preproc/html/pre-html.o
In file included from /usr/include/stdio.h:906,
                 from ./lib/stdio.h:43,
                 from ../src/include/getopt.h:35,
                 from ../src/include/lib.h:44,
                 from ../src/preproc/html/pre-html.cpp:24:
In function 'int vsnprintf(char*, size_t, const char*, __va_list_tag*)',
    inlined from 'char* make_string(const char*, ...)' at ../src/preproc/html/pre-html.cpp:408:16:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:68:36: warning: null destination pointer [-Wformat-truncation=]
   68 |   return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |                                     __glibc_objsize (__s), __fmt, __ap);
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX      src/preproc/html/pushback.o

-.-

../src/preproc/tbl/table.cpp:1057:45: warning: extra ';' after in-class function definition [-Wextra-semi]
 1057 |   virtual int is_single_line() { return 0; };

and more of this type (-Wextra-semi).

.-.

  GROFF    contrib/pdfmark/pdfmark.pdf
troff:/home/bg/Sottar.skrar/groff-1.23.0/build/../doc/../contrib/pdfmark/pdfmark.ms:374: warning [p 1, 5.0i]: cannot adjust line
troff:/home/bg/Sottar.skrar/groff-1.23.0/build/../doc/../contrib/pdfmark/pdfmark.ms:374: warning [p 1, 4.6i]: cannot adjust line

  This is caused by ".CW \n(.F ,", where the "string" ".F" does not have
any '\:' in it.  (I use PAGE=A4).

Bjarni Ingi Gislason <bjarniig>
Sun 01 Oct 2023 06:13:58 PM UTC, comment #2: 


comment #1:

>   This is probably a bug in the gcc with one of the options
> -fsanitize=undefined, -fsanitize=bounds, and -fsanitize=bounds-strict,
> as the error is absent with default flags "-g -O2".
>
>   This default warning remains:
>
> warning: ISO C++ forbids converting a string constant to 'char*'
> [-Wwrite-strings]
>
>   The line number and name of the source file is missing in the error
> message:
>
>   GROFF    doc/pic.html
> failed to replace fd=1 with -1
> pre-grohtml: fatal error: dup2: Bad file descriptor
>
>   and
>
>   GROFF    doc/webpage.html
> failed to replace fd=1 with -1
> pre-grohtml: fatal error: dup2: Bad file descriptor



Fortunately, that is enough to track down what is issuing the diagnostic.

https://git.savannah.gnu.org/cgit/groff.git/tree/src/preproc/html/pre-html.cpp?h=1.23.0#n1136

I can see some ways to improve diagnostics in this file, even if in the long run I want to kill off `pre-grohtml` entirely.

But in the meantime, if you got this error simply by running groff's own make targets, that suggests some kind of race.

However, it would be hasty to assume that this problem exists in stock groff 1.23.0 as we see evidence that you're not using that.


MFLAG = -M$(abs_top_builddir)/s-tmac


Stripped tmac files are not a feature of groff 1.23.0.

If you can't reproduce this with stock groff 1.23.0, I think we'll need to resolve it as invalid.

G. Branden Robinson <gbranden>
Group administrator
Sun 01 Oct 2023 06:00:19 PM UTC, comment #1: 

  This is probably a bug in the gcc with one of the options
-fsanitize=undefined, -fsanitize=bounds, and -fsanitize=bounds-strict,
as the error is absent with default flags "-g -O2".

  This default warning remains:

warning: ISO C++ forbids converting a string constant to 'char*'
[-Wwrite-strings]

  The line number and name of the source file is missing in the error
message:

  GROFF    doc/pic.html
failed to replace fd=1 with -1
pre-grohtml: fatal error: dup2: Bad file descriptor

  and

  GROFF    doc/webpage.html
failed to replace fd=1 with -1
pre-grohtml: fatal error: dup2: Bad file descriptor

Bjarni Ingi Gislason <bjarniig>
Sat 30 Sep 2023 10:27:31 PM UTC, original submission:  

Subject: pre-grohtml: fatal error: 'pre-grohtml' exited with status 2;

N.B.

Additional information is in the attachment.

Full message is:

pre-grohtml: fatal error: 'pre-grohtml' exited with status 2; re-run
with a different output driver to see diagnostic messages

  "groff" compiled with one of the following additional flags:
-fsanitize=undefined or -fsanitize=bounds or -fsanitize=bounds-strict.

  From the output of "make groff":

[...]
  GROFF    doc/pic.html pre-grohtml: fatal error: 'pre-grohtml' exited
with status 2; re-run with a different output driver to see diagnostic
messages
make[2]: * [Makefile:17307: doc/pic.html] Error 1
[...]

s-tmac: stripped tmac files.

MFLAG = -M$(abs_top_builddir)/s-tmac -M$(abs_top_builddir)/tmac
-M$(abs_top_srcdir)/tmac

FFLAG = -F$(abs_top_builddir)/font -F$(abs_top_srcdir)/font

DOC_GROFF = \
  GROFF_COMMAND_PREFIX= \
  GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
  $(GROFFBIN) -M $(doc_srcdir) $(MFLAG) $(FFLAG) -ww -b

Makefile:17307:

doc/pic.html: $(doc_srcdir)/pic.ms $(TMAC_PACKAGE_MS)
$(GROFF_V)$(MKDIR_P) $(doc_builddir) \
&& cd $(doc_builddir) \
&& $(DOC_GROFF) -pet -P-Ipic -P-Dimg -P-jpic -Thtml -ms \
  $(doc_srcdir)/pic.ms > pic.html


Bjarni Ingi Gislason <bjarniig>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55181:  pre-grohtml.bug added by bjarniig (9KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-10-01 gbranden StatusNone Unreproducible
        Assigned toNone gbranden
    2023-09-30 bjarniig Attached File- Added pre-grohtml.bug, #55181

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code