Op 2025-02-22 om 19:20 schreef David Kalnischkies:
Sadly, I can't reproduce this here…

And I think I figured out why. If I change the Version line and the version in the Filename line, it only happens if the version is the same as the version that I currently have installed, not if it's less or greater. I'm going to assume you don't have dseomn-standard installed :)

Does it happen for you with (simulation mode, so no need for sudo):
     apt-get --with-source ./Packages upgrade -s dseomn-standard

Yes, and also with apt-cache (ignore locale-en_US, it just does what it says on the tin to make error messages in English):

$ locale-en_US apt-get --with-source /tmp/tmp.VtKyaCzPyr/Packages upgrade -s
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!
/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.
Afgebroken
$ locale-en_US apt-cache --with-source /tmp/tmp.VtKyaCzPyr/Packages show dseomn-standard /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.
Afgebroken

If so, add one by one:
     -o Dir::state::status=/dev/null
     -o Dir::Etc::main=/dev/null -o Dir::Etc::parts=/dev/null
     -o Dir::etc::sourcelist=/dev/null
     -o Dir::etc::sourceparts=/dev/null

Either of these two by themselves fix it:
-o Dir::state::status=/dev/null
-o dir::etc::sourceparts=/dev/null

I suspect its not crashing anymore if sources are disabled, so if you
could figure out which sources are needed to reproduce this would be
helpful. You can be either commenting out sources.list entries or adding
their Packages files from /var/lib/apt/lists to the apt call (before
your own Packages file). That isn't the same, the later might just be
easier to do but perhaps its doesn't trigger the problem. If we aren't
"lucky", its likely highly state dependent.

Even after adding all the Packages files from /var/lib/apt/lists, it still didn't crash.

So I commented out all of my sources except for one, and it still crashed.

$ grep -rv '^#' /etc/apt/sources.list{,.d}
/etc/apt/sources.list.d/20-debian.sources:Types: deb
/etc/apt/sources.list.d/20-debian.sources:URIs: https://deb.debian.org/debian
/etc/apt/sources.list.d/20-debian.sources:Suites: testing
/etc/apt/sources.list.d/20-debian.sources:Components: main
/etc/apt/sources.list.d/20-debian.sources:Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

If I comment out that last remaining source, the crash goes away.

If so, a "silly" workaround might just be:
     -o APT::Cache-Start=$((200 * 1024 * 1024))
(the default for that option is ~25 MB currently)

$ locale-en_US apt-get --with-source /tmp/tmp.VtKyaCzPyr/Packages -o APT::Cache-Start=$((200*1024*1024)) upgrade -s
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!
/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.
Afgebroken

Description: dseomn-standard

I don't see something obviously wrong that should crash the parsers, but
that "description" is not what it should be in any sense of the word.

Yeah, I was just lazy because these packages shouldn't really be published for anybody else. I just changed it to this though, and still got the crash:

Description: foo
  bar
  .
  baz

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.

In either case a backtrace for this crash would be useful. Please try
getting a coredump, preferably with -dbgsym packages installed.
(You might need to add a source for that… which might change the setup
  and hence makes the problem disappear)

I've been using DEBUGINFOD_URLS=https://debuginfod.debian.net with gdb lately instead of bothering with -dbgsym packages. Is there any reason to install those packages instead of using the server?

See gdb.txt attached.
Starting program: /usr/bin/apt-get --with-source /tmp/tmp.VtKyaCzPyr/Packages 
upgrade -s
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after fork from child process 620518]
[Detaching after fork from child process 620519]
[Detaching after fork from child process 620520]

Program received signal SIGABRT, Aborted.
Download failed: Invalid argument.  Continuing without source file 
./nptl/./nptl/pthread_kill.c.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, 
no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
warning: 44     ./nptl/pthread_kill.c: No such file or directory
#0  __pthread_kill_implementation (threadid=<optimized out>, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007ffff769de2f in __pthread_kill_internal (threadid=<optimized out>, 
signo=6) at ./nptl/pthread_kill.c:78
#2  0x00007ffff7649d02 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x00007ffff76324f0 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007ffff78d4f5e in std::__glibcxx_assert_fail 
(file=file@entry=0x7ffff7e07520 "/usr/include/c++/14/bits/stl_vector.h", 
line=line@entry=1130, function=function@entry=0x7ffff7e153d8 "std::vector<_Tp, 
_Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = 
pkgCacheGenerator::VersionExtra; _Alloc = 
std::allocator<pkgCacheGenerator::VersionExtra>; reference = p"..., 
condition=condition@entry=0x7ffff7e17a0f "__n < this->size()") at 
../../../../../src/libstdc++-v3/src/c++11/assert_fail.cc:41
#5  0x00007ffff7dd336f in std::vector<pkgCacheGenerator::VersionExtra, 
std::allocator<pkgCacheGenerator::VersionExtra> >::operator[] (this=<optimized 
out>, __n=<optimized out>) at /usr/include/c++/14/bits/stl_vector.h:1128
#6  std::vector<pkgCacheGenerator::VersionExtra, 
std::allocator<pkgCacheGenerator::VersionExtra> >::operator[] (this=<optimized 
out>, __n=<optimized out>) at /usr/include/c++/14/bits/stl_vector.h:1128
#7  pkgCacheGenerator::MergeListVersion (this=this@entry=0x5555555a9da0, 
List=..., Pkg=..., Version=..., OutVer=@0x7fffffffce28: 0x0) at 
./apt-pkg/pkgcachegen.cc:399
#8  0x00007ffff7dd4ccd in pkgCacheGenerator::MergeList 
(this=this@entry=0x5555555a9da0, List=..., OutVer=<optimized out>, 
OutVer@entry=0x0) at ./apt-pkg/pkgcachegen.cc:285
#9  0x00007ffff7db1f62 in pkgDebianIndexFile::Merge (this=<optimized out>, 
Gen=..., Prog=<optimized out>) at ./apt-pkg/indexfile.cc:351
#10 0x00007ffff7dce413 in operator() (__closure=__closure@entry=0x7fffffffd100, 
I=0x55555557ec70) at ./apt-pkg/pkgcachegen.cc:1604
#11 0x00007ffff7dd057f in 
std::for_each<__gnu_cxx::__normal_iterator<pkgIndexFile**, 
std::vector<pkgIndexFile*> >, BuildCache(pkgCacheGenerator&, OpProgress*, 
map_filesize_t&, map_filesize_t, const pkgSourceList*, FileIterator, 
FileIterator)::<lambda(pkgIndexFile*)> > (__first=0x55555557ec70, __last=0x0, 
__f=...) at /usr/include/c++/14/bits/stl_algo.h:3786
#12 BuildCache (Gen=..., Progress=<optimized out>, 
Progress@entry=0x7fffffffd6d0, CurrentSize=@0x7fffffffd258: 681, 
TotalSize=<optimized out>, TotalSize@entry=681, List=List@entry=0x0, Start=..., 
End=0x0) at ./apt-pkg/pkgcachegen.cc:1633
#13 0x00007ffff7dd77a6 in pkgCacheGenerator::MakeStatusCache (List=..., 
Progress=Progress@entry=0x7fffffffd6d0, OutMap=OutMap@entry=0x7fffffffd430, 
OutCache=OutCache@entry=0x7fffffffd438) at 
/usr/include/c++/14/bits/unique_ptr.h:446
#14 0x00007ffff7cdcd49 in pkgCacheFile::BuildCaches 
(this=this@entry=0x7fffffffd650, Progress=Progress@entry=0x7fffffffd6d0, 
WithLock=WithLock@entry=true) at ./apt-pkg/cachefile.cc:127
#15 0x00007ffff7cdd108 in pkgCacheFile::Open (this=this@entry=0x7fffffffd650, 
Progress=Progress@entry=0x7fffffffd6d0, WithLock=WithLock@entry=true) at 
./apt-pkg/cachefile.cc:217
#16 0x00007ffff7f7da92 in CacheFile::Open (this=0x7fffffffd650, WithLock=true) 
at ./obj-x86_64-linux-gnu/include/apt-private/private-cachefile.h:29
#17 CacheFile::OpenForInstall (this=0x7fffffffd650) at 
./obj-x86_64-linux-gnu/include/apt-private/private-cachefile.h:36
#18 UpgradeHelper (CmdL=..., UpgradeFlags=3) at 
./apt-private/private-upgrade.cc:31
#19 0x00007ffff7d00b3f in CommandLine::DispatchArg 
(this=this@entry=0x7fffffffd880, Map=<optimized out>, 
NoMatch=NoMatch@entry=true) at ./apt-pkg/contrib/cmndline.cc:373
#20 0x00007ffff7f105c4 in DispatchCommandLine (CmdL=..., Cmds=std::vector of 
length 29, capacity 32 = {...}) at ./apt-private/private-cmndline.cc:615
#21 0x0000555555558c15 in main (argc=5, argv=0x7fffffffd9f8) at 
./cmdline/apt-get.cc:450

Reply via email to