lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 30 Mar 2020 13:43:12 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Jiri Olsa <jolsa@...hat.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: Re: [PATCH 6/9] perf record: Support synthesizing cgroup events

Em Mon, Mar 30, 2020 at 01:30:58PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Mar 25, 2020 at 09:45:33PM +0900, Namhyung Kim escreveu:
> > Synthesize cgroup events by iterating cgroup filesystem directories.
> > The cgroup event only saves the portion of cgroup path after the mount
> > point and the cgroup id (which actually is a file handle).
> 
> Breaks the build on alpine linux (musl libc):
> 
>   CC       /tmp/build/perf/util/srccode.o
>   CC       /tmp/build/perf/util/synthetic-events.o
> util/synthetic-events.c: In function 'perf_event__synthesize_cgroup':
> util/synthetic-events.c:427:22: error: field 'fh' has incomplete type
>    struct file_handle fh;
>                       ^
> util/synthetic-events.c:441:6: error: implicit declaration of function 'name_to_handle_at' [-Werror=implicit-function-declaration]
>   if (name_to_handle_at(AT_FDCWD, path, &handle.fh, &mount_id, 0) < 0) {
>       ^
> util/synthetic-events.c:441:2: error: nested extern declaration of 'name_to_handle_at' [-Werror=nested-externs]
>   if (name_to_handle_at(AT_FDCWD, path, &handle.fh, &mount_id, 0) < 0) {
>   ^
>   CC       /tmp/build/perf/util/data.o
> cc1: all warnings being treated as errors
> mv: can't rename '/tmp/build/perf/util/.synthetic-events.o.tmp': No such file or directory
> 
> 
> I'm trying to fix

musl libc up to 1.2.21 (IIRC) lacks name_to_handle_at and its structs,
then from the one that is in alpine linux 3.10 the error changes to:

  CC       /tmp/build/perf/util/cloexec.o
util/synthetic-events.c:427:22: error: field 'fh' with variable sized type 'struct file_handle' not at the end of a struct or class is a GNU
      extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
                struct file_handle fh;
                                   ^
1 error generated.
mv: can't rename '/tmp/build/perf/util/.synthetic-events.o.tmp': No such file or directory
make[4]: *** [/git/linux/tools/build/Makefile.build:97: /tmp/build/perf/util/synthetic-events.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [/git/linux/tools/build/Makefile.build:139: util] Error 2
make[2]: *** [Makefile.perf:617: /tmp/build/perf/perf-in.o] Error 2
make[1]: *** [Makefile.perf:225: sub-make] Error 2
make: *** [Makefile:70: all] Error 2
make: Leaving directory '/git/linux/tools/perf'
+ exit 1
[root@...co ~]#

So probably we'll need a feature test to catch this and do some
workaround or disable the feature on such systems, providing some
warning.

I left the container build tests running to see if some other system has
problems with this, perhaps the ones with uCLibc or some older glibc,
we'll see.

So far all the alpine versions failed with the above problems and ALT
Linux p8 and p9 built without problems.

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ