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

Bug#1098702: apt-get --with-source crashes with Assertion '__n < this->size()' failed.



Op 2025-02-22 om 19:20 schreef David Kalnischkies:
libapt7.0 did a bunch of std::string→std::string_view things and a crash
here might very well be a sign that either a string is not properly owned
any longer or you are lucky enough to hit a cache-growth problem that
are a pain to find and weed out.

Since you mentioned possible memory issues, here's the output of valgrind.
==634351== Memcheck, a memory error detector
==634351== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==634351== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==634351== Command: apt-get --with-source /tmp/tmp.VtKyaCzPyr/Packages upgrade -s
==634351== 
==634352== Warning: invalid file descriptor 524276 in syscall fcntl()
==634352== Warning: invalid file descriptor 524277 in syscall fcntl()
==634352== Warning: invalid file descriptor 524278 in syscall fcntl()
==634352== Warning: invalid file descriptor 524279 in syscall fcntl()
==634352==    Use --log-fd=<number> to select an alternative log fd.
==634352== Warning: invalid file descriptor 524280 in syscall fcntl()
==634352== Warning: invalid file descriptor 524281 in syscall fcntl()
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists...==634353== Warning: invalid file descriptor 524276 in syscall fcntl()
==634353== Warning: invalid file descriptor 524277 in syscall fcntl()
==634353== Warning: invalid file descriptor 524278 in syscall fcntl()
==634353== Warning: invalid file descriptor 524279 in syscall fcntl()
==634353==    Use --log-fd=<number> to select an alternative log fd.
==634353== Warning: invalid file descriptor 524280 in syscall fcntl()
==634353== Warning: invalid file descriptor 524281 in syscall fcntl()
==634354== Warning: invalid file descriptor 524276 in syscall fcntl()
==634354== Warning: invalid file descriptor 524277 in syscall fcntl()
==634354== Warning: invalid file descriptor 524278 in syscall fcntl()
==634354== Warning: invalid file descriptor 524279 in syscall fcntl()
==634354==    Use --log-fd=<number> to select an alternative log fd.
==634354== Warning: invalid file descriptor 524280 in syscall fcntl()
==634354== Warning: invalid file descriptor 524281 in syscall fcntl()
/usr/include/c++/14/bits/stl_vector.h:1130: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = pkgCacheGenerator::VersionExtra; _Alloc = std::allocator<pkgCacheGenerator::VersionExtra>; reference = pkgCacheGenerator::VersionExtra&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
==634351== 
==634351== Process terminating with default action of signal 6 (SIGABRT)
==634351==    at 0x4ED1DCC: __pthread_kill_implementation (pthread_kill.c:44)
==634351==    by 0x4E7DD01: raise (raise.c:26)
==634351==    by 0x4E664EF: abort (abort.c:79)
==634351==    by 0x4C7DF5D: std::__glibcxx_assert_fail(char const*, int, char const*, char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33)
==634351==    by 0x4B0B36E: ??? (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351==    by 0x4B0CCCC: ??? (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351==    by 0x4AE9F61: pkgDebianIndexFile::Merge(pkgCacheGenerator&, OpProgress*) (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351==    by 0x4B06412: ??? (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351==    by 0x4B0857E: ??? (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351==    by 0x4B0F7A5: ??? (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351==    by 0x4A14D48: pkgCacheFile::BuildCaches(OpProgress*, bool) (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351==    by 0x4A15107: pkgCacheFile::Open(OpProgress*, bool) (in /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0.0)
==634351== 
==634351== HEAP SUMMARY:
==634351==     in use at exit: 2,550,548 bytes in 3,458 blocks
==634351==   total heap usage: 38,077 allocs, 34,619 frees, 5,674,339 bytes allocated
==634351== 
==634351== LEAK SUMMARY:
==634351==    definitely lost: 0 bytes in 0 blocks
==634351==    indirectly lost: 0 bytes in 0 blocks
==634351==      possibly lost: 0 bytes in 0 blocks
==634351==    still reachable: 2,550,548 bytes in 3,458 blocks
==634351==         suppressed: 0 bytes in 0 blocks
==634351== Rerun with --leak-check=full to see details of leaked memory
==634351== 
==634351== For lists of detected and suppressed errors, rerun with: -s
==634351== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Reply to: