[Home]

Summary:DAHLIN-00387: DAHDI compilation gives "directive output may be truncated" error
Reporter:David Cunningham (dcunningham)Labels:
Date Opened:2021-05-02 19:07:24Date Closed:
Priority:MajorRegression?
Status:Triage/NewComponents:General
Versions:3.1.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 18.04, kernel 4.15.0-142-genericAttachments:
Description:DAHDI fails to compile on kernel 4.15.0-142-generic, with an error:

xusb_libusb.c: In function ‘xusb_find_bypath’:
xusb_libusb.c:500:41: error: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4093 [-Werror=format-truncation=]
   snprintf(devpath_tail, PATH_MAX, "%3s/%3s",

The same problem happens with both DAHDI 3.1.0 and 3.0.0. The gcc compiler version is 7.5.0. The full compilation output is below. Thank you.

   root@ast1:/usr/src/dahdi-linux-complete-3.1.0+3.1.0# uname -r
   4.15.0-142-generic
   root@ast1:/usr/src/dahdi-linux-complete-3.1.0+3.1.0# make install-config
   make -C linux all
   make[1]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux'
   make -C drivers/dahdi/firmware firmware-loaders
   make[2]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/firmware'
   make[2]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/firmware'
   make -C /lib/modules/4.15.0-142-generic/build KBUILD_EXTMOD=/usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi DAHDI_INCLUDE=/usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux/include DAHDI_MODULES_EXTRA=" " HOTPLUG_FIRMWARE=yes modules DAHDI_BUILD_ALL=m
   make[2]: Entering directory '/usr/src/linux-headers-4.15.0-142-generic'
     Building modules, stage 2.
     MODPOST 28 modules
   WARNING: could not find /usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/vpmadt032_loader/.vpmadt032_x86_64.o.cmd for /usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/vpmadt032_loader/vpmadt032_x86_64.o
   make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-142-generic'
   make[1]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/linux'
   (cd tools && autoreconf -i && [ -f config.status ] || ./configure --with-dahdi=../linux)
   make -C tools all
   make[1]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
   make  all-recursive
   make[2]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
   Making all in xpp
   make[3]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp'
   Making all in perl_modules
   make[4]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp/perl_modules'
   make[4]: Nothing to be done for 'all'.
   make[4]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp/perl_modules'
   Making all in oct612x
   make[4]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp/oct612x'
   make[4]: Nothing to be done for 'all'.
   make[4]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp/oct612x'
   Making all in xtalk
   make[4]: Entering directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp/xtalk'
     CC       libxtalk_la-xusb_libusb.lo
   xusb_libusb.c: In function ‘xusb_find_bypath’:
   xusb_libusb.c:500:41: error: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4093 [-Werror=format-truncation=]
       snprintf(devpath_tail, PATH_MAX, "%3s/%3s",
                                            ^
   In file included from /usr/include/stdio.h:862:0,
                    from xusb_libusb.c:23:
   /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 8 and 8194 bytes into a destination of size 4096
      return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           __bos (__s), __fmt, __va_arg_pack ());
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
   Makefile:658: recipe for target 'libxtalk_la-xusb_libusb.lo' failed
   make[4]: *** [libxtalk_la-xusb_libusb.lo] Error 1
   make[4]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp/xtalk'
   Makefile:1043: recipe for target 'all-recursive' failed
   make[3]: *** [all-recursive] Error 1
   make[3]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools/xpp'
   Makefile:1115: recipe for target 'all-recursive' failed
   make[2]: *** [all-recursive] Error 1
   make[2]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
   Makefile:664: recipe for target 'all' failed
   make[1]: *** [all] Error 2
   make[1]: Leaving directory '/usr/src/dahdi-linux-complete-3.1.0+3.1.0/tools'
   Makefile:9: recipe for target 'all' failed
   make: *** [all] Error 2
Comments:By: David Cunningham (dcunningham) 2021-05-04 19:27:15.513-0500

Would anyone have a patch that we can try? I understand there is no ETA to solve bug reports, but this is affecting a production system and any help would be greatly appreciated. Thanks in advance.