Bug#1071219: apt: debListParser fails to parse arch lists with extraneous whitespace: terminate called after throwing an instance of 'std::length_error'
Control: severity -1 normal
On Thu, May 16, 2024 at 02:11:41PM +0200, Andreas Beckmann wrote:
> Package: apt
> Version: 2.9.2
> Severity: serious
>
> one package to reproduce this bug is mpich 4.2.0-5.1
>
> mpich-4.2.0# apt-get build-dep -y .
> Note, using directory '.' to get the build dependencies
> terminate called after throwing an instance of 'std::length_error'
> what(): basic_string::_M_create
> Aborted (core dumped)
>
> Running this through gdb and extracting the interesting part of the
> backtrace:
>
> #11 0x00007ffff7e28c6c in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<char const*, void> (__a=...,
> __end=0x5555555baade " amd64 powerpc armhf],\n"...,
> __beg=0x5555555baadf "amd64 powerpc armhf],\n"..., this=0x7fffffffd670) at /usr/include/c++/13/bits/basic_string.h:765
> #12 debListParser::ParseDepends (Start=<optimized out>,
> Start@entry=0x5555555baabb "valgrind [i386 arm64 ppc64el ppc64 amd64 powerpc armhf],\n"...,
> Stop=Stop@entry=0x5555555bab15 "\nBuild-Conflicts: libamdhip64-dev\n"..., Package=..., Ver=..., Op=@0x7fffffffd930: 0, ParseArchFlags=<optimized out>, StripMultiArch=<optimized out>, ParseRestrictionsList=<optimized out>, Arch=...) at ./apt-pkg/deb/deblistparser.cc:667
>
> Note the double space in ..."ppc64 amd64"...
> It tries to create a std::string with __end < __beg resulting in a
> negative (or insane) length.
Don't do that then. I mean it is failing safely, this is highly
unusual so it's not a critical bug in any sort of shape for apt
(but sure for packages actually doing that in the archive since
they don't build correctly or whatever).
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
Reply to: