Activity log for bug #2067602

Date Who What changed Old value New value Message
2024-05-30 11:26:48 Benjamin Drung bug added bug
2024-05-30 11:33:54 Benjamin Drung description procdump 2.2-1 fails to build from source on Ubuntu. I can reproduce it locally. ``` src/Monitor.c: In function 'WaitForProfilerCompletion': src/Monitor.c:1602:5: error: leak of file descriptor 'socket(1, 1, 0)' [CWE-775] [-Werror=analyzer-fd-leak] 1602 | pthread_mutex_lock(&config->dotnetMutex); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'WaitForProfilerCompletion': events 1-3 | | 1545 | if((s = socket(AF_UNIX, SOCK_STREAM, 0))==-1) | | ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | | | (1) stream socket created here | | | (2) when 'socket' succeeds | | (3) following 'false' branch... | 'WaitForProfilerCompletion': events 4-16 | | 1553 | local.sun_family = AF_UNIX; | | ^ | | | | | (4) ...to here |...... | 1557 | if(bind(s, (struct sockaddr *)&local, len)==-1) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | || | | |(5) stream socket bound here | | |(6) when 'bind' succeeds | | (7) following 'false' branch... |...... | 1569 | chmod(tmpFolder, 0777); | | ~~~~~~~~~~~~~~~~~~~~~~ | | | | | (8) ...to here |...... | 1577 | if ((pthread_create(&processMonitor, NULL, ProcessMonitor, (void *) config)) != 0) | | ~ | | | | | (9) following 'false' branch... |...... | 1590 | if(listen(s, MAX_PROFILER_CONNECTIONS)==-1) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | || | | |(10) ...to here | | |(11) stream socket marked as passive here via 'listen' | | |(12) when 'listen' succeeds | | (13) following 'false' branch... |...... | 1602 | pthread_mutex_lock(&config->dotnetMutex); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (14) ...to here |...... | 1612 | if((s2 = accept(s, (struct sockaddr *)&remote, &t))==-1) | | ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | | | (15) when 'accept' fails | | (16) following 'true' branch... | 'WaitForProfilerCompletion': event 17 | |./include/Logging.h:51:5: | 51 | DiagTrace(format " %s", ##__VA_ARGS__, LOCATION); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (17) ...to here src/Monitor.c:1615:13: note: in expansion of macro 'Trace' | 1615 | Trace("WaitForProfilerCompletion: Failed in accept call on socket\n"); | | ^~~~~ | 'WaitForProfilerCompletion': event 18 | | 1602 | pthread_mutex_lock(&config->dotnetMutex); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (18) 'socket(1, 1, 0)' leaks here | cc1: all warnings being treated as errors ``` procdump 2.2-1 fails to build from source on Ubuntu. I can reproduce it locally. ``` cc -c -g -o obj/Monitor.o src/Monitor.c -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/procdump-2.2-1 -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/procdump-2.2-1 -fcommon -Wl,-z,now -Wdate-time -D_FORTIFY_SOURCE=3 -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -I ./include -pthread -std=gnu99 -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O2 -fanalyzer -Werror src/Monitor.c: In function 'WaitForProfilerCompletion': src/Monitor.c:1602:5: error: leak of file descriptor 'socket(1, 1, 0)' [CWE-775] [-Werror=analyzer-fd-leak]  1602 | pthread_mutex_lock(&config->dotnetMutex);       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   'WaitForProfilerCompletion': events 1-3     |     | 1545 | if((s = socket(AF_UNIX, SOCK_STREAM, 0))==-1)     | | ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | | | |     | | | (1) stream socket created here     | | | (2) when 'socket' succeeds     | | (3) following 'false' branch...     |   'WaitForProfilerCompletion': events 4-16     |     | 1553 | local.sun_family = AF_UNIX;     | | ^     | | |     | | (4) ...to here     |......     | 1557 | if(bind(s, (struct sockaddr *)&local, len)==-1)     | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | | ||     | | |(5) stream socket bound here     | | |(6) when 'bind' succeeds     | | (7) following 'false' branch...     |......     | 1569 | chmod(tmpFolder, 0777);     | | ~~~~~~~~~~~~~~~~~~~~~~     | | |     | | (8) ...to here     |......     | 1577 | if ((pthread_create(&processMonitor, NULL, ProcessMonitor, (void *) config)) != 0)     | | ~     | | |     | | (9) following 'false' branch...     |......     | 1590 | if(listen(s, MAX_PROFILER_CONNECTIONS)==-1)     | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | | ||     | | |(10) ...to here     | | |(11) stream socket marked as passive here via 'listen'     | | |(12) when 'listen' succeeds     | | (13) following 'false' branch...     |......     | 1602 | pthread_mutex_lock(&config->dotnetMutex);     | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | | |     | | (14) ...to here     |......     | 1612 | if((s2 = accept(s, (struct sockaddr *)&remote, &t))==-1)     | | ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | | | |     | | | (15) when 'accept' fails     | | (16) following 'true' branch...     |   'WaitForProfilerCompletion': event 17     |     |./include/Logging.h:51:5:     | 51 | DiagTrace(format " %s", ##__VA_ARGS__, LOCATION);     | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | | |     | | (17) ...to here src/Monitor.c:1615:13: note: in expansion of macro 'Trace'     | 1615 | Trace("WaitForProfilerCompletion: Failed in accept call on socket\n");     | | ^~~~~     |   'WaitForProfilerCompletion': event 18     |     | 1602 | pthread_mutex_lock(&config->dotnetMutex);     | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     | | |     | | (18) 'socket(1, 1, 0)' leaks here     | cc1: all warnings being treated as errors ``` Full log: https://launchpadlibrarian.net/732490833/buildlog_ubuntu-oracular-amd64.procdump_2.2-1_BUILDING.txt.gz
2024-05-30 14:35:06 Benjamin Drung procdump (Ubuntu): status New Fix Committed
2024-05-30 14:35:12 Benjamin Drung procdump (Ubuntu): importance Undecided High
2024-05-31 11:02:35 Benjamin Drung tags ftbfs update-excuse ftbfs