bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61073] [groff]: SEGV with a single option as input


From: Bjarni Ingi Gislason
Subject: [bug #61073] [groff]: SEGV with a single option as input
Date: Tue, 24 Aug 2021 00:43:19 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #2, bug #61073 (project groff):

  Some findings.

  GROFF_FONT_PATH must exist (can be empty), therefore "test-groff
--version" does not segfault.

  I think the code is not robust enough.

  A second compilation without "-Og" behaves in the same way, with these
changes:

  Compiling without "-Og" reveals

>From configure (previous is with -Og):

--- config.out.previous 2021-08-24 00:09:29.000000000 +0000
+++ config.out.latest   2021-08-24 03:04:36.000000000 +0000
@@ -87,7 +87,7 @@ checking whether long double and double
 checking whether printf supports infinite 'long double' arguments...
yes
 checking whether printf supports the 'a' and 'A' directives... yes
 checking whether printf supports the 'F' directive... yes
-checking whether printf supports the 'n' directive... no
+checking whether printf supports the 'n' directive... yes
 checking whether printf supports the 'ls' directive... yes


>From make (previous is with -Og):

Previous has "lib/fprintf.o" and "lib/fprintf.lo"

--- Makefile    2021-08-24 03:04:36.000000000 +0000
+++ Makefile.previous   2021-08-24 00:09:29.000000000 +0000
-REPLACE_FPRINTF = 0
+REPLACE_FPRINTF = 1
...
-gl_LIBOBJS =  lib/asnprintf.o lib/free.o lib/fseterr.o lib/printf-args.o
lib/printf-parse.o lib/vasnprintf.o
-gl_LTLIBOBJS =  lib/asnprintf.lo lib/free.lo lib/fseterr.lo
lib/printf-args.lo lib/printf-parse.lo lib/vasnprintf.lo
+gl_LIBOBJS =  lib/asnprintf.o lib/fprintf.o lib/free.o lib/fseterr.o
lib/printf-args.o lib/printf-parse.o lib/vasnprintf.o
+gl_LTLIBOBJS =  lib/asnprintf.lo lib/fprintf.lo lib/free.lo lib/fseterr.lo
lib/printf-args.lo lib/printf-parse.lo lib/vasnprintf.lo

  The latest compilation complains a lot about "putc"

../src/devices/grodvi/dvi.cpp: In member function 'void
dvi_printer::out1(int)':
../src/devices/grodvi/dvi.cpp:231:7: warning: call to 'putc' declared
with attribute warning: The symbol ::putc refers to the system function.
Use gnulib::putc instead. [-Wattribute-warning]
  231 |   putc(n & 0xff, fp);
      |   ~~~~^~~~~~~~~~~~~~

  and also about "printf", "free", "fputs", "fprintf", "fputc", and so on.

  My compilations flags:

FLAGS_COMMON="\
-Wall -Wextra -Wformat=2  \
-Wstringop-overflow=4 \
-Wshadow=global -Wredundant-decls \
-Wunused \
-Wunused-parameter \
-fsanitize=signed-integer-overflow \
-fsanitize-undefined-trap-on-error \
-fstack-protector-strong -fno-common \
-fstack-clash-protection \
-ftrapv \
-funsigned-char \
-fvar-tracking-assignments  \
-ggdb  \
"
# and with -Og
# causes rpl_fprintf to not be found with -D_FORTIFY_SOURCE=2
# use -DGNULIB_NAMESPACE=gnulib to fix
#-ggdb -Og \


CPPFLAGS="-D_FORTIFY_SOURCE=2 \
-DGCC_LINT \
"

CFLAGS="\
$FLAGS_COMMON \
-Wmissing-prototypes \
-Wold-style-definition -Wstrict-prototypes  \
-Wold-style-declaration  \
"

#For cleaning add -Wold-style-cast, this gives too many warnings
# -Wmissing-declarations gives to many warnings for old software
CXXFLAGS="\
$FLAGS_COMMON \
-fcheck-new \
-std=c++17 \
-Wredundant-decls \
-DGNULIB_NAMESPACE=gnulib \
"
# GNULIB_NAMESPACE is used in lib/stdio.in.h


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61073>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]