Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 669152

Summary: =net-libs/libwebsockets-2.0.2 fails compile ( error: ‘__builtin_snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] )
Product: Gentoo Linux Reporter: Kent Fredric (IRC: kent\n) (RETIRED) <kentnl>
Component: Current packagesAssignee: Jaco Kroon <jaco>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint, yuchen.xie
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/13579
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log

Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2018-10-20 22:58:12 UTC
Created attachment 552022 [details]
build.log

[ 44%] Building C object CMakeFiles/websockets_shared.dir/lib/extension.c.o                       
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc -Dwebsockets_shared_EXPORTS -I/var/tmp/portage/net-libs/libwebsockets-2.0.2/work/libwebsockets-2.0.2_build -I/var/tmp/portage/net-libs/libwebsockets-2.0.2/work/libwebsockets-2.0.2/lib   -DNDEBUG -Wall -Werror -fvisibility=hidden -mar
ch=native -mtune=native -O2 -pipe -pthread -fPIC   -o CMakeFiles/websockets_shared.dir/lib/extension.c.o -c /var/tmp/portage/net-libs/libwebsockets-2.0.2/work/libwebsockets-2.0.2/lib/extension.c
/var/tmp/portage/net-libs/libwebsockets-2.0.2/work/libwebsockets-2.0.2/lib/server.c: In function ‘lws_http_action’:                                                                                                    
/var/tmp/portage/net-libs/libwebsockets-2.0.2/work/libwebsockets-2.0.2/lib/server.c:293:40: error: ‘__builtin_snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]                        
    snprintf(path, sizeof(path) - 1, "%s", sym); 
                                        ^                                                                 
In file included from /usr/include/stdio.h:862,                                            
                 from /var/tmp/portage/net-libs/libwebsockets-2.0.2/work/libwebsockets-2.0.2/lib/private-libwebsockets.h:34,
                 from /var/tmp/portage/net-libs/libwebsockets-2.0.2/work/libwebsockets-2.0.2/lib/server.c:23:                                                                                                                                                                        
/usr/include/bits/stdio2.h:64:10: note: ‘__builtin_snprintf’ output between 1 and 256 bytes into a destination of size 255                                                                                                                                                           
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,                                                                                                                                                                                                               
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());                                                                                                                                                                                                                                       
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
cc1: all warnings being treated as errors        
make[2]: *** [CMakeFiles/websockets_shared.dir/build.make:471: CMakeFiles/websockets_shared.dir/lib/server.c.o] Error 1


 * Package:    net-libs/libwebsockets-2.0.2      
 * Repository: gentoo                            
 * Maintainer: jaco@uls.co.za yuchen.xie@live.com,proxy-maint@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc http2 ipv6 kernel_linux ssl userland_GNU
 * FEATURES:   ccache preserve-libs sandbox userpriv usersandbox


Installed Deps:

[ebuild  N    ~] net-libs/libwebsockets-2.0.2  USE="http2 ipv6 ssl -client -libev -libressl -libuv -static-libs" 0 KiB
[ebuild  N     ]  dev-util/cmake-3.9.6  USE="ncurses -doc -emacs -qt5 -server -system-jsoncpp {-test}" 0 KiB                                                                                                                                                                         
[ebuild  N     ]   app-crypt/rhash-1.3.6-r1  USE="nls ssl -debug -libressl -static-libs" 0 KiB                                                                                            
[ebuild  N     ]   app-arch/libarchive-3.3.1:0/13  USE="acl bzip2 e2fsprogs iconv lzma threads xattr zlib -expat -libressl -lz4 -lzo -nettle -static-libs" 0 KiB

Portage 2.3.40 (python 2.7.15-final-0, default/linux/amd64/17.1/no-multilib, gcc-8.2.0, glibc-2.26-r7, 4.9.6-gentoo-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.9.6-gentoo-r1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-gentoo-2.4.1
KiB Mem:     2042732 total,    238904 free
KiB Swap:   18588764 total,  18565520 free
Head commit of repository gentoo: e55cddaaeb3bb9f59b7297273452ad45e6a91a64

sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p5) 2.30.0
ccache version 3.3.4 [enabled]
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.38.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r4::gentoo
sys-devel/gcc:            8.2.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Comment 1 Larry the Git Cow gentoo-dev 2019-11-12 14:45:52 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31ceadbd479ef83029bfa47e3315dd713bb584fe

commit 31ceadbd479ef83029bfa47e3315dd713bb584fe
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2019-11-07 10:46:17 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2019-11-12 14:45:29 +0000

    net-libs/libwebsockets: version bump to 3.2.0
    
    Closes: https://bugs.gentoo.org/696554
    Closes: https://bugs.gentoo.org/615532
    Closes: https://bugs.gentoo.org/618428
    Closes: https://bugs.gentoo.org/672194
    Closes: https://bugs.gentoo.org/669152
    Package-Manager: Portage-2.3.76, Repoman-2.3.16
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/13579
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-libs/libwebsockets/Manifest                    |  1 +
 .../libwebsockets-3.2.0-check_chown_result.patch   | 22 ++++++
 .../libwebsockets-3.2.0-string_assignment.patch    | 11 +++
 net-libs/libwebsockets/libwebsockets-3.2.0.ebuild  | 80 ++++++++++++++++++++++
 4 files changed, 114 insertions(+)