[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#871538: Makes apparmor FTBFS on mips64el (generated code thinks that 1 > 1)

Package: gcc-7
Version: 7.1.0-12
Severity: important
X-Debbugs-Cc: Tyler Hicks <tyhicks@canonical.com>, Seth Arnold <seth.arnold@canonical.com>


we've debugged a FTBFS of src:apparmor on mips64el today together with
our Ubuntu friends on #apparmor, and we concluded it's probably a bug
somewhere in the toolchain rather than in src:apparmor:

Build logs:

Reproduced on eller.debian.org.

We're discussing this upstream there:

Given the failure appeared after uploads/rebuilds with no source
change (only AppArmor profiles were modified), it looks very much like
it's caused by a change in the toolchain: gcc-7, perhaps?

"Interestingly", applying a patch that merely adds debugging output
makes the bug disappear.

The following gdb session seems to indicate that there's a toolchain
bug. According to Tyler Hicks <tyhicks@ubuntu.com>:

 * aa_policy_cache_new() is called with max_caches equal to 1
 * max_caches is not modified in aa_policy_cache_new()
 * yet somehow (max_caches > 1) evaluates to true

  eller% gdb --args ./apparmor_parser --base /tmp/aa-caching-7m80k_gp --skip-kernel-load -M tst/features_files/features.all --cache-loc /tmp/aa-caching-7m80k_gp/aa-alt-cachedf_u_391 -q --write-cache -r /tmp/aa-caching-7m80k_gp/sbin.pingy
  GNU gdb (Debian 7.12-6)
  Copyright (C) 2016 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "mips64el-linux-gnuabi64".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  Find the GDB manual and other documentation resources online at:
  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  Reading symbols from ./apparmor_parser...done.
  (gdb) break aa_policy_cache_new
  Breakpoint 1 at 0x96f70: file policy_cache.c, line 135.
  (gdb) run
  Starting program: /home/intrigeri/apparmor-2.11.0/parser/apparmor_parser --base /tmp/aa-caching-7m80k_gp --skip-kernel-load -M tst/features_files/features.all --cache-loc /tmp/aa-caching-7m80k_gp/aa-alt-cachedf_u_391 -q --write-cache -r /tmp/aa-caching-7m80k_gp/sbin.pingy
  Breakpoint 1, aa_policy_cache_new (policy_cache=0xffffffe7d8, kernel_features=0xaaaaca22a0, dirfd=-100, path=0xaaaaca42b0 "/tmp/aa-caching-7m80k_gp/aa-alt-cachedf_u_391",
      max_caches=1) at policy_cache.c:135
  135                     return true;
  (gdb) s
  141     int setup_cache_tmp(const char **cachetmpname, const char *cachename)
  (gdb) s
  146             *cachetmpname = NULL;
  (gdb) s
  147             if (write_cache) {
  (gdb) s
  148                     /* Otherwise, set up to save a cached copy */
  (gdb) s
  (gdb) s
  main (argc=<optimized out>, argv=0xffffffea78) at parser_main.c:1124
  1124                    if (retval) {
  1125                            if (errno != ENOENT && errno != EEXIST) {
  (gdb) s
  1126                                    PERROR(_("Failed setting up policy cache (%s): %s\n"),
  fprintf (__fmt=0xaaaac1aaa0 "Failed setting up policy cache (%s): %s\n", __stream=0xfff7eb24e8 <_IO_2_1_stderr_>) at /usr/include/mips64el-linux-gnuabi64/bits/stdio2.h:98
  98                              __va_arg_pack ());
  Failed setting up policy cache (/tmp/aa-caching-7m80k_gp/aa-alt-cachedf_u_391): Operation not supported
  main (argc=<optimized out>, argv=<optimized out>) at parser_main.c:1128
  1128                                    return 1;
  1199    }
  0x000000fff7d386fc in __libc_start_main () from /lib/mips64el-linux-gnuabi64/libc.so.6
  Single stepping until exit from function __libc_start_main,
  which has no line number information.
  [Inferior 1 (process 609) exited with code 01]

Reply to: