procdump 2.2-1 FTBFS

Bug #2067602 reported by Benjamin Drung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
procdump (Ubuntu)
Fix Committed
High
Unassigned

Bug Description

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

Tags: ftbfs
Benjamin Drung (bdrung)
description: updated
Revision history for this message
Benjamin Drung (bdrung) wrote :

I can reproduce it on an upstream git checkout of 2.2 tag:

```
make CFLAGS="-flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection"
```

Bisect the fix in https://github.com/Sysinternals/ProcDump-for-Linux/commit/ed78e3e8ef57a52a8c69f4592436321ef6e9b960

Revision history for this message
Benjamin Drung (bdrung) wrote :

Fixed in procdump 2.2-1ubuntu1 but armhf fails to build: bug #2067621

Changed in procdump (Ubuntu):
status: New → Fix Committed
importance: Undecided → High
Benjamin Drung (bdrung)
tags: removed: update-excuse
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.