1.5: build fsails
kloczek opened this issue · comments
+ cd ProcDump-for-Linux-1.5
+ ASMFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none'
+ CFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os'
+ CXXFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none'
+ FFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules'
+ FCFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules'
+ LDFLAGS='-Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1'
+ RUSTFLAGS='-C codegen-units=1 -C debuginfo=2 -C opt-level=2 -C link-arg=-fdata-sections -C link-arg=-ffunction-sections -C link-arg=-Wl,--as-needed -C link-arg=-Wl,-z,now -C link-arg=-Wl,-z,relro --cap-lints=warn'
+ VALAFLAGS=-g
+ CC=/usr/bin/gcc
+ CXX=/usr/bin/g++
+ FC=/usr/bin/gfortran
+ AR=/usr/bin/gcc-ar
+ NM=/usr/bin/gcc-nm
+ RANLIB=/usr/bin/gcc-ranlib
+ export ASMFLAGS CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS VALAFLAGS CC CXX FC AR NM RANLIB RUSTFLAGS VALAFLAGS
+ /usr/bin/make -O -j48 V=1 VERBOSE=1 CC=/usr/bin/gcc CXX=/usr/bin/g++
rm -rf obj
rm -rf bin
rm -rf /home/tkloczko/rpmbuild/BUILD/ProcDump-for-Linux-1.5/pkgbuild
mkdir -p obj
mkdir -p bin
/usr/bin/gcc -c -g -o obj/ProcDumpTestApplication.o tests/integration/ProcDumpTestApplication.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/Procdump.o src/Procdump.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/Events.o src/Events.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/Logging.o src/Logging.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/ProfilerHelpers.o src/ProfilerHelpers.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/DotnetHelpers.o src/DotnetHelpers.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/Handle.o src/Handle.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/CoreDumpWriter.o src/CoreDumpWriter.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/GenHelpers.o src/GenHelpers.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/Process.o src/Process.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/ProcDumpConfiguration.o src/ProcDumpConfiguration.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -o bin/ProcDumpTestApplication obj/ProcDumpTestApplication.o -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
/usr/bin/gcc -c -g -o obj/Monitor.o src/Monitor.c -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
clang++ -o obj/ProcDumpProfiler.so -DELPP_NO_DEFAULT_LOG_FILE -DELPP_THREAD_SAFE -g -pthread -shared --no-undefined -Wno-invalid-noreturn -Wno-pragma-pack -Wno-writable-strings -Wno-format-security -fPIC -fms-extensions -DHOST_64BIT -DBIT64 -DPAL_STDCPP_COMPAT -DPLATFORM_UNIX -std=c++11 -I profiler/inc profiler/src/ClassFactory.cpp profiler/src/ProcDumpProfiler.cpp profiler/src/dllmain.cpp profiler/src/corprof_i.cpp profiler/src/easylogging++.cc
ld -r -b binary -o obj/ProcDumpProfiler.o obj/ProcDumpProfiler.so
/usr/bin/gcc -o bin/procdump obj/CoreDumpWriter.o obj/DotnetHelpers.o obj/Events.o obj/GenHelpers.o obj/Handle.o obj/Logging.o obj/Monitor.o obj/ProcDumpConfiguration.o obj/Procdump.o obj/Process.o obj/ProfilerHelpers.o obj/ProcDumpProfiler.o -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror
In function 'cleanup_fd',
inlined from 'ExtractProfiler' at src/ProfilerHelpers.c:26:22:
./include/GenHelpers.h:47:8: error: leak of file descriptor 'creat ("/usr/local/bin/procdumpprofiler.so", 452)' [CWE-775] [-Werror=analyzer-fd-leak]
47 | if (*val)
| ^
'ExtractProfiler': events 1-5
|
|src/ProfilerHelpers.c:31:14:
| 26 | auto_free_fd int destfd = -1;
| | ~
| | |
| | (5) inlined call to 'cleanup_fd' from 'ExtractProfiler'
|......
| 31 | destfd = creat(PROCDUMP_DIR "/" PROFILER_FILE_NAME, S_IRWXU|S_IROTH);
| | ^
| | |
| | (1) opened here
| 32 | if (destfd < 0)
| | ~
| | |
| | (2) assuming 'creat ("/usr/local/bin/procdumpprofiler.so", 452)' is a valid file descriptor (>= 0)
| | (3) following 'false' branch...
|......
| 37 | size_t written = 0;
| | ~
| | |
| | (4) ...to here
|
+--> 'cleanup_fd': event 6
|
|./include/GenHelpers.h:47:8:
| 47 | if (*val)
| | ^
| | |
| | (6) 'creat ("/usr/local/bin/procdumpprofiler.so", 452)' leaks here; was opened at (1)
|
src/DotnetHelpers.c: In function 'IsCoreClrProcess':
src/DotnetHelpers.c:51:24: error: use of NULL where non-null expected [CWE-476] [-Werror=analyzer-null-argument]
51 | if(strncmp(ptr, tmpFolder, strlen(tmpFolder)) == 0)
| ^
'LoadProfiler': events 1-3
|
|src/ProfilerHelpers.c:62:5:
| 62 | int LoadProfiler(pid_t pid, char* filter, char* fullDumpPath)
| | ^
| | |
| | (1) entry to 'LoadProfiler'
|......
| 70 | auto_free char* socketName = NULL;
| | ~
| | |
| | (2) 'socketName' is NULL
|......
| 76 | if(!IsCoreClrProcess(pid, &socketName))
| | ~
| | |
| | (3) calling 'IsCoreClrProcess' from 'LoadProfiler'
|
+--> 'IsCoreClrProcess': events 4-5
|
|src/DotnetHelpers.c:25:6:
| 25 | bool IsCoreClrProcess(pid_t pid, char** socketName)
| | ^
| | |
| | (4) entry to 'IsCoreClrProcess'
|......
| 35 | tmpFolder = GetSocketPath("dotnet-diagnostic-", pid, 0);
| | ~
| | |
| | (5) calling 'GetSocketPath' from 'IsCoreClrProcess'
|
+--> 'GetSocketPath': events 6-9
|
|src/GenHelpers.c:374:7:
| 374 | char* GetSocketPath(char* prefix, pid_t pid, pid_t targetPid)
| | ^
| | |
| | (6) entry to 'GetSocketPath'
|......
| 383 | if(targetPid)
| | ~
| | |
| | (7) following 'false' branch (when 'targetPid_15(D) == 0')...
|......
| 396 | int len = snprintf(NULL, 0, "/tmp/%s%d", prefix, pid);
| | ~
| | |
| | (8) ...to here
| 397 | t = malloc(len+1);
| 398 | if(t==NULL)
| | ~
| | |
| | (9) following 'true' branch (when 't_23' is NULL)...
|
'GetSocketPath': event 10
|
|lto1:
| (10): ...to here
|
<------+
|
'IsCoreClrProcess': events 11-14
|
|src/DotnetHelpers.c:35:17:
| 35 | tmpFolder = GetSocketPath("dotnet-diagnostic-", pid, 0);
| | ^
| | |
| | (11) returning to 'IsCoreClrProcess' from 'GetSocketPath'
|......
| 42 | if(procFile != NULL)
| | ~
| | |
| | (12) following 'true' branch...
| 43 | {
| 44 | if(fgets(lineBuf, sizeof(lineBuf), procFile) != NULL)
| | ~ ~
| | | |
| | | (14) following 'true' branch...
| | (13) ...to here
|
'IsCoreClrProcess': event 15
|
|lto1:
| (15): ...to here
|
'IsCoreClrProcess': events 16-18
|
| 46 | while(fgets(lineBuf, 4096, procFile) != NULL)
| | ^
| | |
| | (16) following 'true' branch...
| 47 | {
| 48 | char* ptr = GetPath(lineBuf);
| | ~ ~
| | | |
| | | (18) calling 'GetPath' from 'IsCoreClrProcess'
| | (17) ...to here
|
+--> 'GetPath': events 19-23
|
|src/GenHelpers.c:117:7:
| 117 | char* GetPath(char* lineBuf)
| | ^
| | |
| | (19) entry to 'GetPath'
|......
| 126 | for(int i=0; i<7; i++)
| | ~
| | |
| | (20) following 'true' branch (when 'i_5 != 7')...
| | (22) following 'true' branch (when 'i_5 != 7')...
| 127 | {
| 128 | ptr = strtok(NULL, delim);
| | ~
| | |
| | (21) ...to here
| | (23) ...to here
|
<------+
|
'IsCoreClrProcess': events 24-27
|
|src/DotnetHelpers.c:48:29:
| 48 | char* ptr = GetPath(lineBuf);
| | ^
| | |
| | (24) returning to 'IsCoreClrProcess' from 'GetPath'
| 49 | if(ptr!=NULL)
| | ~
| | |
| | (25) following 'true' branch (when 'ptr_29' is non-NULL)...
| 50 | {
| 51 | if(strncmp(ptr, tmpFolder, strlen(tmpFolder)) == 0)
| | ~ ~
| | | |
| | | (27) argument 1 ('GetSocketPath ("dotnet-diagnostic-", pid_24(D), 0)') NULL where non-null expected
| | (26) ...to here
|
/usr/include/string.h:407:15: note: argument 1 of 'strlen' must be non-null
407 | extern size_t strlen (const char *__s)
| ^
lto1: all warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [Makefile:67: bin/procdump] Error 1
Hi, thanks for reporting this? Which version of gcc are you using (gcc --version)? We use gcc 10 as the base line which builds just fine. With the recent security hardening changes, if you're running a version greater than 10, it's possible that we have new analysis warnings pop up which of course should be fixed. If you are interested in taking a look at fix let me know otherwise, I can pick this up.
Also, if you can let me know which distro/version you are using?
I'm using gcc 13.1.1.
I'm using my own distro however that version of gcc you can find in Fedora rawhide.
I just tried this on my Fedora Rawhide (Linux version 6.3.0-0.rc6.20230414git44149752e998.53.fc39.x86_64 (mockbuild@a8b1e6fc26e547649f489eb3d5d335f7) and it compiled fine. Granted, it's not the latest but the gcc version is the same as yours:
gcc (GCC) 13.1.1 20230511 (Red Hat 13.1.1-2)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Did you change anything in the Makefile? I can see some build errors (different than yours) if I change the optimization level but that should always be set to -O2.
Nope.
As source I;m using tar autogenerated from git tag.
[-Werror=analyzer-fd-leak]
error has nothing to do with optimisation options.
It appears that your environment enables link time optimizations (-flto=auto) which causes the above. As a test, try removing that flag.
Now that I have a repro I can investigate and see what the issue is when -flto=auto is set.
So ProcDump is not LTO rerady?
It depends on what the issue is, could be a false positive in the static analysis when LTO is enabled. I'll look into it.
Hmm so on generate prod binaries is used some static analyse?
By default, static analysis is always turned on. You are free to remove it if you so choose (just remove the -fanalyzer from the Makefile). Static analysis doesn't have any effect on the built binaries.