Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Errors when compiling from source on Linux: string_fortified.h: stringop-truncation #15208

@olegmikul

Description

@olegmikul

Description

Errors due to string operations

Environment info (Required)

----------Python Info----------
Version : 3.7.3
Compiler : GCC 9.1.1 20190603 gcc-9-branch@271851
Build : ('default', 'Jun 3 2019 15:02:07')
Arch : ('64bit', 'ELF')
------------Pip Info-----------
Version : 19.1.1
Directory : /usr/lib/python3.7/site-packages/pip
----------MXNet Info-----------
Version : 1.4.1
Directory : /usr/lib/python3.7/site-packages/mxnet
Commit Hash : 1a71996
----------System Info----------
Platform : Linux-5.1.7-777.native-x86_64-with-glibc2.8
system : Linux
node : clr-486efdb81ccc48b4a4a5681fe1e2c8fd
release : 5.1.7-777.native
version : #1 SMP Wed Jun 5 19:14:15 UTC 2019
----------Hardware Info----------
machine : x86_64
processor :
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 44
On-line CPU(s) list: 0-43
Thread(s) per core: 2
Core(s) per socket: 22
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 79
Model name: Intel(R) Xeon(R) CPU E5-2696 v4 @ 2.20GHz
Stepping: 1
CPU MHz: 3367.492
CPU max MHz: 3700.0000
CPU min MHz: 1200.0000
BogoMIPS: 4399.58
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 56320K
NUMA node0 CPU(s): 0-43
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts flush_l1d
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0034 sec, LOAD: 0.5042 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.1730 sec, LOAD: 0.2163 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.0460 sec, LOAD: 0.1969 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0250 sec, LOAD: 0.1757 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0220 sec, LOAD: 0.4709 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0236 sec, LOAD: 0.4099 sec.

Package used (Python/R/Scala/Julia):
I'm using Python

Build info (Required if built from source)

Compiler (gcc/clang/mingw/visual studio): gcc 9.1.1

MXNet commit hash:
3c82ce2

Build config:
make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=mkl USE_INTEL_PATH=/opt/intel

Error Message:

In file included from /usr/include/string.h:494,
from /home/username/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp:17:
In function ‘char* strncpy(char*, const char*, size_t)’,
inlined from ‘int mkldnn::impl::mkldnn_getenv(char*, const char*, int)’ at /home/username/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp:53:24:
/usr/include/bits/string_fortified.h:106:34: error: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/username/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp: In function ‘int mkldnn::impl::mkldnn_getenv(char*, const char*, int)’:
/home/username/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp:49:34: note: length computed here
49 | value_length = strlen(buffer);
| ~~~~~~^~~~~~~~

Steps to reproduce

  1. make -j $(nproc) USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=mkl USE_INTEL_PATH=/opt/intel

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions