Comment 0 for bug 2052360

Revision history for this message
dann frazier (dannf) wrote :

[Impact]
cmake-extra's copyrighttest autopkgtest segfaults on armhf in our test infra:
  https://objectstorage.prodstack5.canonical.com/swift/v1/0f9aae918d5b4744bf7b827671c86842/autopkgtest-jammy/jammy/armhf/c/cmake-extras/20240118_231525_552d3@/log.gz

This is because /proc/cpuinfo appears to be empty, which triggers an underflow condition. This doesn't impact all architectures - it may be limited to armhf containers running on arm64 hosts.

This presumably impacts the building of any software using the CopyrightTest module provided by cmake-extra in a similar environment.

[Test Case]
Launch an armhf lxd jammy container and run the autopkgtest for cmake-extras within:

ubuntu@armhf:~/cmake-extras-1.6$ ./debian/tests/copyrighttest
+ set -ep
+ mktemp --tmpdir=/tmp -d
+ builddir=/tmp/tmp.106fU16BhF
+ trap rm -rf /tmp/tmp.106fU16BhF 0 INT QUIT ABRT PIPE TERM
+ pwd
+ srcdir=/home/ubuntu/cmake-extras-1.6/examples/copyrighttest-demo
+ cd /tmp/tmp.106fU16BhF
+ cmake /home/ubuntu/cmake-extras-1.6/examples/copyrighttest-demo
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
terminate called after throwing an instance of 'std::length_error'
  what(): basic_string::_M_replace_aux
Aborted (core dumped)
+ rm -rf /tmp/tmp.106fU16BhF
ubuntu@armhf:~/cmake-extras-1.6$

[What Could Go Wrong]
Perhaps there is some evil AI out there that only has access to lxd containers for building its self-generated code. That AI could also be somehow bound to rules held over from its corporate origins that require it avoid violating human IP laws, and it therefore always does a scan using cmake-extras' CopyrightTestConfig module. This segfault could then have been the only thing standing in its way from achieving its world domination plans.