FTBFS on ppc64el: array subscript is partly outside array bounds

Bug #1955767 reported by Andreas Hasenack
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libcamera (Debian)
Fix Released
Unknown
libcamera (Ubuntu)
Fix Released
Critical
Unassigned

Bug Description

ppc64el build is failing[1] on jammy:

FAILED: src/libcamera/base/libcamera-base.so.0.0.0.p/object.cpp.o
c++ -Isrc/libcamera/base/libcamera-base.so.0.0.0.p -Isrc/libcamera/base -I../src/libcamera/base -Iinclude -I../include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++17 -Wshadow -include config.h -g -O3 '-ffile-prefix-map=/<<BUILDDIR>>/libcamera-0~git20211108+1b30992b623e=.' -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -pthread -DLIBCAMERA_BASE_PRIVATE -MD -MQ src/libcamera/base/libcamera-base.so.0.0.0.p/object.cpp.o -MF src/libcamera/base/libcamera-base.so.0.0.0.p/object.cpp.o.d -o src/libcamera/base/libcamera-base.so.0.0.0.p/object.cpp.o -c ../src/libcamera/base/object.cpp
In file included from ../src/libcamera/base/object.cpp:13:
../src/libcamera/base/object.cpp: In member function ‘libcamera::Object::notifyThreadMove()’:
../include/libcamera/base/message.h:58:47: error: array subscript ‘const struct InvokeMessage[0]’ is partly outside array bounds of ‘struct Message[1]’ [-Werror=array-bounds]
   58 | Semaphore *semaphore() const { return semaphore_; }
      | ^~~~~~~~~~
../src/libcamera/base/object.cpp:272:17: note: while referencing ‘msg’
  272 | Message msg(Message::ThreadMoveMessage);
      | ^~~
cc1plus: all warnings being treated as errors

I filed an upstream bug[2] about it too.

1. https://launchpadlibrarian.net/576601418/buildlog_ubuntu-jammy-ppc64el.libcamera_0~git20211108+1b30992b623e-3_BUILDING.txt.gz
2. https://bugs.libcamera.org/show_bug.cgi?id=106

Bryce Harrington (bryce)
Changed in libcamera (Ubuntu):
status: New → Confirmed
Revision history for this message
Benjamin Drung (bdrung) wrote :

It still fails on ppc64el after fixing this issue:

ipa/raspberrypi/raspberrypi.cpp
FAILED: src/ipa/raspberrypi/ipa_rpi.so.p/raspberrypi.cpp.o
c++ -Isrc/ipa/raspberrypi/ipa_rpi.so.p -Isrc/ipa/raspberrypi -I../src/ipa/raspberrypi -Iinclude -I../include -Isrc/ipa -I../src/ipa -I../src/ipa/raspberrypi/controller -Iinclude/libcamera/ipa -Iinclude/libcamera -I/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++17 -O0 -Wshadow -include config.h -g -O3 '-ffile-prefix-map=/<<PKGBUILDDIR>>=.' -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wno-error -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DBOOST_ALL_NO_LIB -DLIBCAMERA_BASE_PRIVATE -MD -MQ src/ipa/raspberrypi/ipa_rpi.so.p/raspberrypi.cpp.o -MF src/ipa/raspberrypi/ipa_rpi.so.p/raspberrypi.cpp.o.d -o src/ipa/raspberrypi/ipa_rpi.so.p/raspberrypi.cpp.o -c ../src/ipa/raspberrypi/raspberrypi.cpp
In file included from /usr/include/c++/12/chrono:39,
                 from ../include/libcamera/base/log.h:10,
                 from ../src/ipa/raspberrypi/raspberrypi.cpp:18:
../src/ipa/raspberrypi/raspberrypi.cpp:64:53: in ‘constexpr’ expansion of ‘std::chrono::operator/<long double, std::ratio<1>, double>(std::literals::chrono_literals::operator""s(1.0e+0l), 3.0e+1)’
/usr/include/c++/12/bits/chrono.h:694:39: error: ‘(1.0e+0l / 3.0e+1)’ is not a constant expression
  694 | return __cd(__cd(__d).count() / __s);
      | ~~~~~~~~~~~~~~~~~~^~~~~
../src/ipa/raspberrypi/raspberrypi.cpp:73:56: in ‘constexpr’ expansion of ‘std::chrono::operator/<long double, std::ratio<1>, double>(std::literals::chrono_literals::operator""s(1.0e+0l), 6.0e+1)’
/usr/include/c++/12/bits/chrono.h:694:39: error: ‘(1.0e+0l / 6.0e+1)’ is not a constant expression

Revision history for this message
Olivier Gayot (ogayot) wrote :

https://bugs.launchpad.net/ubuntu/+source/libcamera/+bug/1992331 addresses the issue with constexpr that @bdrung mentioned.

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

libcamera 0~git20211108+1b30992b623e-4 does not treat warnings as errors.

Changed in libcamera (Ubuntu):
importance: Undecided → Critical
status: Confirmed → Fix Committed
Changed in libcamera (Debian):
status: Unknown → Fix Released
Jeremy Bícha (jbicha)
Changed in libcamera (Ubuntu):
status: Fix Committed → Fix Released
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.