Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 699878 - sys-block/fio-3.16 fails to compile due to too many arguments passed to function 'strncpy'
Summary: sys-block/fio-3.16 fails to compile due to too many arguments passed to funct...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
: 699832 699852 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-11-11 19:09 UTC by Rafal Kupiec
Modified: 2020-01-24 18:12 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Kupiec 2019-11-11 19:09:02 UTC
>>> Emerging (22 of 119) sys-block/fio-3.16::gentoo
 * fio-3.16.tar.bz2 BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                                                                       [ ok ]
>>> Unpacking source...
>>> Unpacking fio-3.16.tar.bz2 to /var/tmp/portage/sys-block/fio-3.16/work
>>> Source unpacked in /var/tmp/portage/sys-block/fio-3.16/work
>>> Preparing source in /var/tmp/portage/sys-block/fio-3.16/work/fio-3.16 ...
 * Applying fio-2.2.13-libmtd.patch ...                                                                                                                                                                                                                                                                               [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-block/fio-3.16/work/fio-3.16 ...
./configure --disable-optimizations --extra-cflags=-march=znver2 -mtune=znver2 -O2 -s -pipe -fomit-frame-pointer  --cc=x86_64-pc-linux-gnu-gcc --disable-pmem --disable-http --disable-gfapi --enable-gfio --disable-numa --disable-rbd --disable-rdma --disable-tcmalloc
Operating system              Linux
CPU                           x86_64
Big endian                    no
Compiler                      x86_64-pc-linux-gnu-gcc
Cross compile                 no

Static build                  no
Wordsize                      64
zlib                          yes
Linux AIO support             no
POSIX AIO support             yes
POSIX AIO support needs -lrt  yes
POSIX AIO fsync               yes
POSIX pshared support         yes
Solaris AIO support           no
__sync_fetch_and_add          yes
__sync_synchronize            yes
__sync_val_compare_and_swap   yes
libverbs                      no
rdmacm                        no
asprintf()                    yes
vasprintf()                   yes
Linux fallocate               yes
POSIX fadvise                 yes
POSIX fallocate               yes
sched_setaffinity(3 arg)      yes
sched_setaffinity(2 arg)      no
clock_gettime                 yes
CLOCK_MONOTONIC               yes
CLOCK_MONOTONIC_RAW           yes
CLOCK_MONOTONIC_PRECISE       no
clockid_t                     yes
gettimeofday                  yes
fdatasync                     yes
sync_file_range               yes
EXT4 move extent              yes
Linux splice(2)               yes
GUASI                         no
libnuma                       no
strsep                        yes
strcasestr                    yes
strlcat                       no
getopt_long_only()            yes
inet_aton                     yes
socklen_t                     yes
__thread                      yes
gtk 2.18 or higher            yes
RUSAGE_THREAD                 yes
SCHED_IDLE                    yes
TCP_NODELAY                   yes
Net engine window_size        yes
TCP_MAXSEG                    yes
RLIMIT_MEMLOCK                yes
pwritev/preadv                yes
pwritev2/preadv2              yes
IPv6 helpers                  yes
http engine                   no
Rados engine                  no
Rados Block Device engine     no
setvbuf                       yes
Gluster API engine            no
s390_z196_facilities          no
HDFS engine                   no
MTD                           yes
libpmem                       no
libpmemblk                    no
PMDK pmemblk engine           no
PMDK dev-dax engine           no
PMDK libpmem engine           no
DDN's Infinite Memory Engine  no
iscsi engine                  no
NBD engine                    no
lex/yacc for arithmetic       no
getmntent                     yes
getmntinfo                    no
Static Assert                 yes
bool                          yes
strndup                       yes
Valgrind headers              no
Zoned block device support    yes
march_armv8_a_crc_crypto      no
cuda                          no
mkdir(a, b)                   yes
Build march=native            no
CUnit                         no
__kernel_rwf_t                yes
-Wimplicit-fallthrough        yes
MADV_HUGEPAGE                 yes
gettid                        yes
TCMalloc support              no
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-block/fio-3.16/work/fio-3.16 ...
make -j24 -s V=1 OPTFLAGS= 
FIO_VERSION = fio-3.16
gfio.c: In function 'update_button_states':
gfio.c:225:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
  225 |   gfio_report_error(ge, "Bad client state: %u\n", ge->state);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfio.c:227:2: note: here
  227 |  case GE_STATE_NEW:
      |  ^~~~
gclient.c: In function 'gfio_update_thread_status_all':
gclient.c:333:19: warning: passing argument 2 of 'strncpy' makes pointer from integer without a cast [-Wint-conversion]
  333 |  strncpy(message, sizeof(message), "%s", status_message);
      |                   ^~~~~~~~~~~~~~~
      |                   |
      |                   long unsigned int
In file included from /usr/include/features.h:450,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from gclient.c:1:
/usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'long unsigned int'
  103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
      | ^~~~~
gclient.c:333:36: warning: passing argument 3 of 'strncpy' makes integer from pointer without a cast [-Wint-conversion]
  333 |  strncpy(message, sizeof(message), "%s", status_message);
      |                                    ^~~~
      |                                    |
      |                                    const char *
In file included from /usr/include/features.h:450,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from gclient.c:1:
/usr/include/bits/string_fortified.h:103:1: note: expected 'size_t' {aka 'long unsigned int'} but argument is of type 'const char *'
  103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
      | ^~~~~
gclient.c:333:2: error: too many arguments to function 'strncpy'
  333 |  strncpy(message, sizeof(message), "%s", status_message);
      |  ^~~~~~~
In file included from /usr/include/features.h:450,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from gclient.c:1:
/usr/include/bits/string_fortified.h:103:1: note: declared here
  103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
      | ^~~~~
make: *** [Makefile:445: gclient.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: sys-block/fio-3.16::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-block/fio-3.16::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-block/fio-3.16::gentoo'`.
 * The complete build log is located at '/var/log/portage/sys-block:fio-3.16:20191111-185916.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-block/fio-3.16/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-block/fio-3.16/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-block/fio-3.16/work/fio-3.16'
 * S: '/var/tmp/portage/sys-block/fio-3.16/work/fio-3.16'


Reproducible: Always

Steps to Reproduce:
1. emerge fio
2.
3.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-11 19:48:08 UTC
gclient.c comes from --enable-gfio (USE=gtk). Reproduced locally.
Comment 2 Larry the Git Cow gentoo-dev 2019-11-11 19:55:00 UTC
The bug has been closed via the following commit(s):

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

commit a61a2972fba62810cf6ba82e3e747e303d171149
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-11-11 19:54:03 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-11-11 19:54:03 +0000

    sys-block/fio: fix USE=gtk build failure, bug #699878
    
    With USE=gtk build failed as:
    
    ```
    gclient.c:333:2: error: too many arguments to function 'strncpy'
      333 |  strncpy(message, sizeof(message), "%s", status_message);
          |  ^~~~~~~
    ```
    
    Picked upstream fix as-is.
    
    Reported-by: Rafal Kupiec
    Closes: https://bugs.gentoo.org/699878
    Package-Manager: Portage-2.3.79, Repoman-2.3.18
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-block/fio/files/fio-3.16-snprintf.patch | 44 +++++++++++++++++++++++++++++
 sys-block/fio/fio-3.16.ebuild               |  1 +
 2 files changed, 45 insertions(+)
Comment 3 SpanKY gentoo-dev 2020-01-24 18:11:56 UTC
*** Bug 699852 has been marked as a duplicate of this bug. ***
Comment 4 SpanKY gentoo-dev 2020-01-24 18:12:44 UTC
*** Bug 699832 has been marked as a duplicate of this bug. ***