[RTEMS Project] #4642: RSB: log.py tends removes relevant error messages

RTEMS trac trac at rtems.org
Tue Apr 12 14:03:02 UTC 2022


#4642: RSB: log.py tends removes relevant error messages
-----------------------------+--------------------
  Reporter:  Frank Kuehndel  |      Owner:  (none)
      Type:  defect          |     Status:  new
  Priority:  low             |  Milestone:  6.1
 Component:  tool/rsb        |    Version:  6
  Severity:  minor           |   Keywords:
Blocked By:                  |   Blocking:
-----------------------------+--------------------
 I sometime see (spontaneous) RSB build errors when building the tools.
 Fortunately, RSB provides error logs like this:

 {{{
 rtems/rsb-report-sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1.txt
 }}}

 Unfortunately, I can often not find the error message in the report. The
 reason is that the file `source-builder/sb/log.py` shortens the report to
 the last 400 lines in

 {{{
 148         if len(self.tail) > self.tail_size:
 149             self.tail = self.tail[-self.tail_size:]
 }}}

 This is fine if the number of jobs is 1. If the number of jobs is greater
 one, the following tends to happen:

 Assume the top level Makefile is called with `-j 2` and it makes one job
 to execute a sub-Makefile in `foo/Makefile` and concurrently the second
 job to execute another one: `bar/Makefile`. Now, assume the job in
 `foo/Makefile` runs into an error, prints the error and returns to the top
 Makefile. The top Makefile will then wait for the second job to finish
 `bar/Makefile`. This job will typically print thousands of lines into the
 log and succeed in its execution. The result is that the truncated log
 will not contain the error message but only final lines of the output of
 the successful job.

 For example, I oft did see this log report:

 {{{
 make[8]: Entering directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/soft/leon/at697f/libstdc++-v3'
 true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc -O2 -g -pipe -I/home/minna/src/rtems-
 source-builder/rtems/build/tmp/sb-1000/6/rtems-sparc/opt/rtems/6/include"
 "CC_FOR_TARGET=/home/minna/src/rtems-source-builder/rtems/build/sparc-
 rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/./gcc/xgcc
 -B/home/minna/src/rtems-source-builder/rtems/build/sparc-rtems6-gcc-
 0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/./gcc/" "CFLAGS=-g -O2
 -msoft-float -mcpu=leon -mfix-at697f" "CXXFLAGS=-g -O2  -msoft-float
 -mcpu=leon -mfix-at697f" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g
 -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m
 644" "INSTALL_PROGRAM=/usr/bin/install -c"
 "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=-msoft-float -mcpu=leon
 -mfix-at697f" "LIBCFLAGS=-g -O2  -msoft-float -mcpu=leon -mfix-at697f"
 "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-
 size=5000000 --split-size=5000000       " "SHELL=/bin/sh" "RUNTESTFLAGS="
 "exec_prefix=/opt/rtems/6" "infodir=/opt/rtems/6/share/info"
 "libdir=/opt/rtems/6/lib" "includedir=/opt/rtems/6/include"
 "prefix=/opt/rtems/6" "tooldir=/opt/rtems/6/sparc-rtems6"
 "gxx_include_dir=/opt/rtems/6/lib/gcc/sparc-rtems6/10.3.1/include/c++" "AR
 =sparc-rtems6-ar" "AS=/home/minna/src/rtems-source-builder/rtems/build
 /sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/./gcc/as" "LD=/home/minna/src/rtems-source-builder/rtems/build
 /sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/./gcc
 /collect-ld" "RANLIB=sparc-rtems6-ranlib" "NM=/home/minna/src/rtems-
 source-builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64
 -linux-gnu-1/build/./gcc/nm" "NM_FOR_BUILD=" "NM_FOR_TARGET=sparc-
 rtems6-nm" "DESTDIR=" "WERROR=" DO=all multi-do # make
 make[8]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/soft/leon/at697f/libstdc++-v3'
 make[7]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/soft/leon/at697f/libstdc++-v3'
 make[6]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/soft/leon/at697f/libstdc++-v3'
 make[5]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/libstdc++-v3'
 make[4]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/libstdc++-v3'
 make[3]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/libstdc++-v3'
 make[2]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/libstdc++-v3'
 make[1]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build'
 make: *** [Makefile:965: all] Error 2
 shell cmd failed: /bin/sh -ex  /home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/do-build
 error: building sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-
 1minna@
 }}}

 When I managed to get the complete output, the real error was in line
 881481 of 894625 (please, do not ask why this was build with Fortran – it
 turned out that I did build using command line options I did not intend to
 use):

 {{{
 /bin/sh ./libtool  --tag=CC   --mode=compile /home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/./gcc/xgcc -B/home/minna/src/rtems-source-builder/rtems/build
 /sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/./gcc/
 -nostdinc -B/home/minna/src/rtems-source-builder/rtems/build/sparc-rtems6
 -gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/sparc-rtems6/newlib/
 -isystem /home/minna/src/rtems-source-builder/rtems/build/sparc-rtems6
 -gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/sparc-rtems6/newlib
 /targ-include -isystem /home/minna/src/rtems-source-builder/rtems/build
 /sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/gnu-mirror-
 gcc-0f001dd/newlib/libc/include -B/usr/lib/rtems6/devtools-arm/sparc-
 rtems6/bin/ -B/usr/lib/rtems6/devtools-arm/sparc-rtems6/lib/ -isystem
 /usr/lib/rtems6/devtools-arm/sparc-rtems6/include -isystem /usr/lib/rtems6
 /devtools-arm/sparc-rtems6/sys-include    -DHAVE_CONFIG_H -I. -I
 ../../../gnu-mirror-gcc-0f001dd/libgfortran  -iquote../../../gnu-mirror-
 gcc-0f001dd/libgfortran/io -I../../../gnu-mirror-gcc-
 0f001dd/libgfortran/../gcc -I../../../gnu-mirror-gcc-
 0f001dd/libgfortran/../gcc/config  -I../.././gcc -I../../../gnu-mirror-
 gcc-0f001dd/libgfortran/../libgcc -I../libgcc -I../../../gnu-mirror-gcc-
 0f001dd/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace
 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-
 definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration
 -Werror=vla  -fcx-fortran-rules -ffunction-sections -fdata-sections   -g
 -O2 -MT pause.lo -MD -MP -MF .deps/pause.Tpo -c -o pause.lo `test -f
 'runtime/pause.c' || echo '../../../gnu-mirror-gcc-
 0f001dd/libgfortran/'`runtime/pause.c
 In file included from ../../../gnu-mirror-gcc-
 0f001dd/libgfortran/runtime/fpu.c:29:
 ./fpu-target.h: In function 'set_fpu_trap_exceptions':
 ./fpu-target.h:90:3: error: implicit declaration of function
 'feenableexcept'; did you mean 'feraiseexcept'? [-Werror=implicit-
 function-declaration]
    90 |   feenableexcept (mode_set);
       |   ^~~~~~~~~~~~~~
       |   feraiseexcept
 ./fpu-target.h:91:3: error: implicit declaration of function
 'fedisableexcept'; did you mean 'feraiseexcept'? [-Werror=implicit-
 function-declaration]
    91 |   fedisableexcept (mode_clr);
       |   ^~~~~~~~~~~~~~~
       |   feraiseexcept
 ./fpu-target.h: In function 'get_fpu_trap_exceptions':
 ./fpu-target.h:98:20: error: implicit declaration of function
 'fegetexcept'; did you mean 'fetestexcept'? [-Werror=implicit-function-
 declaration]
    98 |   int exceptions = fegetexcept ();
       |                    ^~~~~~~~~~~
       |                    fetestexcept
 libtool: compile:  /home/minna/src/rtems-source-builder/rtems/build/sparc-
 rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/./gcc/xgcc
 -B/home/minna/src/rtems-source-builder/rtems/build/sparc-rtems6-gcc-
 0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/./gcc/ -nostdinc
 -B/home/minna/src/rtems-source-builder/rtems/build/sparc-rtems6-gcc-
 0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/sparc-rtems6/newlib/
 -isystem /home/minna/src/rtems-source-builder/rtems/build/sparc-rtems6
 -gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/build/sparc-rtems6/newlib
 /targ-include -isystem /home/minna/src/rtems-source-builder/rtems/build
 /sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-gnu-1/gnu-mirror-
 gcc-0f001dd/newlib/libc/include -B/usr/lib/rtems6/devtools-arm/sparc-
 rtems6/bin/ -B/usr/lib/rtems6/devtools-arm/sparc-rtems6/lib/ -isystem
 /usr/lib/rtems6/devtools-arm/sparc-rtems6/include -isystem /usr/lib/rtems6
 /devtools-arm/sparc-rtems6/sys-include -DHAVE_CONFIG_H -I. -I../../../gnu-
 mirror-gcc-0f001dd/libgfortran -iquote../../../gnu-mirror-gcc-
 0f001dd/libgfortran/io -I../../../gnu-mirror-gcc-
 0f001dd/libgfortran/../gcc -I../../../gnu-mirror-gcc-
 0f001dd/libgfortran/../gcc/config -I../.././gcc -I../../../gnu-mirror-gcc-
 0f001dd/libgfortran/../libgcc -I../libgcc -I../../../gnu-mirror-gcc-
 0f001dd/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace
 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-
 definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration
 -Werror=vla -fcx-fortran-rules -ffunction-sections -fdata-sections -g -O2
 -MT pause.lo -MD -MP -MF .deps/pause.Tpo -c ../../../gnu-mirror-gcc-
 0f001dd/libgfortran/runtime/pause.c -o pause.o
 cc1: some warnings being treated as errors
 make[5]: *** [Makefile:2809: fpu.lo] Error 1
 make[5]: *** Waiting for unfinished jobs....
 mv -f .deps/main.Tpo .deps/main.Plo
 mv -f .deps/environ.Tpo .deps/environ.Plo
 mv -f .deps/pause.Tpo .deps/pause.Plo
 mv -f .deps/error.Tpo .deps/error.Plo
 mv -f .deps/single.Tpo .deps/single.Plo
 make[5]: Leaving directory '/home/minna/src/rtems-source-
 builder/rtems/build/sparc-rtems6-gcc-0f001dd-newlib-64b2081-x86_64-linux-
 gnu-1/build/sparc-rtems6/libgfortran'
 }}}

 I would expect that the log/RSB report contains the actual error message
 by either somehow making sure the error containing piece is kept or the
 whole output is available. (I do not want to suggest a design decision on
 how this is solved the best way.)

 For the records:

 {{{
 $ git -C rtems-source-builder/ rev-parse HEAD
 49e3dac17765fa82ce2f754da839638ee352f95c
 }}}

 Build command:

 {{{
 $ cd rtems-source-builder/rtems && ../source-builder/sb-set-builder
 --rtems-version 6 --prefix /usr/lib/rtems6/devtools-arm --with_ada
 --with_cxx --with_fortran --with_objc --log /home/minna/src/sb-set-
 builder.log --trace --no-clean --jobs=12 6/rtems-arm 6/rtems-sparc 6
 /rtems-powerpc 6/rtems-riscv
 }}}

 Build environment: ''openSUSE Leap 15.3 container''

--
Ticket URL: <http://devel.rtems.org/ticket/4642>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list