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

Bug#368710: apt: std::__throw_logic_error what(): basic_string::_S_construct NULL not valid probably related to dpkg: error processing osso-ic (--remove): Package is in a very bad inconsistent state



Package: apt
Version: 0.6.43.3

I downloaded the source for apt-0.6.43.3 (from debian testing)
This of course also happened using the ubuntu dapper apt of
approximately the same version, but I couldn't figure out how to get
sources for it, so I figured using the official would simplify my
reporting problems.

root@swift:/tmp/messbox# apt-build --sources-list
/etc/apt/sources.list.d/etch-debian.list --build-dir apt
--target-release testing source apt 0.6.43.3

The package does seem to have quite a few dependencies.

timeless@swift:~/usr/bin$ dpkg -s libc6 | grep ^Version:
Version: 2.3.6-7
timeless@swift:~/usr/bin$ dpkg -s libgcc1 | grep ^Version:
Version: 1:4.1.0-4
timeless@swift:~/usr/bin$ dpkg -s libstdc++6 | grep ^Version:
Version: 4.1.0-4

Details about my debian system seem fairly important:
It's Ubuntu Dapper Beta, with a bunch of messed up package sources (it
didn't even take me a whole week to mess it up this badly).

timeless@swift:~/usr/bin$ uname -a
Linux swift 2.6.16-1-686-smp #2 SMP Tue Apr 25 20:45:37 UTC 2006 i686 GNU/Linux

-rw-r--r-- 1 root     root        1 2006-05-12 16:56 /etc/apt/sources.list
-rw-r--r-- 1 root     root      149 2006-05-15 16:32
/etc/apt/sources.list.d/eff.list
-rw-r--r-- 1 root     root      142 2006-05-24 01:04
/etc/apt/sources.list.d/etch-debian.list
-rw-r--r-- 1 root     root       71 2006-05-12 16:56
/etc/apt/sources.list.d/etch-debian.list.save
-rw-r--r-- 1 root     root      130 2006-05-12 16:56
/etc/apt/sources.list.d/maemo-extras.list
-rw-r--r-- 1 root     root      134 2006-05-12 16:56
/etc/apt/sources.list.d/maemo-extras.list.save
-rw-r--r-- 1 root     root      116 2006-05-12 16:56
/etc/apt/sources.list.d/maemo.list
-rw-r--r-- 1 root     root      120 2006-05-12 16:56
/etc/apt/sources.list.d/maemo.list.save
-rw-r--r-- 1 root     root      141 2006-05-12 16:56
/etc/apt/sources.list.d/mozilla-x86.list
-rw-r--r-- 1 root     root      141 2006-05-12 16:56
/etc/apt/sources.list.d/mozilla-x86.list.save
-rw-r--r-- 1 timeless timeless   62 2006-05-12 16:56
/etc/apt/sources.list.d/scratchbox.list
-rw-r--r-- 1 root     root       62 2006-05-12 16:56
/etc/apt/sources.list.d/scratchbox.list.save
-rw-r--r-- 1 root     root     1955 2006-05-12 16:56
/etc/apt/sources.list.d/ubuntu.list
-rw-r--r-- 1 root     root     1955 2006-05-12 16:56
/etc/apt/sources.list.d/ubuntu.list.save

maemo is repository.maemo.org
etch is debian-testing
ubuntu is dapper, dapper-updates, dapper-universe, dapper-backports,
dapper-security
scratchbox is an internal server
mozilla-x86 would be an internal server, except the repository went away
eff is an internal server

details about internal servers will probably require patience,
screening,  and cleaning.

root@swift:~# gdb ~timeless/usr/bin/apt-get
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db
library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) r remove  osso-ic osso-ic-lib
Starting program: /home/timeless/usr/bin/apt-get remove  osso-ic osso-ic-lib
E: dpkg was interrupted, you must manually run 'dpkg --configure -a'
to correct the problem.

Program exited with code 0144.
(gdb)
[1]+  Stopped                 gdb ~timeless/usr/bin/apt-get
root@swift:~# dpkg --configure -a
root@swift:~# fg
gdb ~timeless/usr/bin/apt-get
r remove  osso-ic osso-ic-lib
Starting program: /home/timeless/usr/bin/apt-get remove  osso-ic osso-ic-lib
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
 osso-ic osso-ic-lib
0 upgraded, 0 newly installed, 2 to remove and 909 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 295kB disk space will be freed.
Do you want to continue [Y/n]? y
dpkg: error processing osso-ic (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
terminate called after throwing an instance of 'std::logic_error'
 what():  basic_string::_S_construct NULL not valid

Program received signal SIGABRT, Aborted.
(Reading database ... 0xffffe410 in __kernel_vsyscall ()
(gdb) 172339 files and directories currently installed.)
Removing osso-ic-lib ...
Errors were encountered while processing:
osso-ic

(gdb) where
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xa7c9c6d1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xa7c9df9b in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xa7e91654 in __gnu_cxx::__verbose_terminate_handler () from
/usr/lib/libstdc++.so.6
#4  0xa7e8f045 in std::set_unexpected () from /usr/lib/libstdc++.so.6
#5  0xa7e8f082 in std::terminate () from /usr/lib/libstdc++.so.6
#6  0xa7e8f1ba in __cxa_throw () from /usr/lib/libstdc++.so.6
#7  0xa7e2410f in std::__throw_logic_error () from /usr/lib/libstdc++.so.6
#8  0xa7e6aadf in std::string::_S_copy_chars () from /usr/lib/libstdc++.so.6
#9  0xa7e6ac29 in std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::basic_string ()
  from /usr/lib/libstdc++.so.6
#10 0xa7f3f8a8 in pkgDPkgPM::Go (this=0x8083318, OutStatusFd=-1) at
deb/dpkgpm.cc:658
#11 0xa7f03d2a in pkgPackageManager::DoInstall (this=0x8083318,
status_fd=6) at packagemanager.cc:640
#12 0x08052bf5 in InstallPackages (Cache=@0xafb7e5f0, ShwKept=false,
Ask=true, Safety=true) at apt-get.cc:1001
#13 0x08059a54 in DoInstall (CmdL=@0xafb7ea78) at apt-get.cc:1683
#14 0xa7ef0a09 in CommandLine::DispatchArg (this=0xafb7ea78,
Map=0xafb7ea20, NoMatch=true) at contrib/cmndline.cc:340
#15 0x0805f420 in main (argc=0, argv=0x0) at apt-get.cc:2588
(gdb) frame 10
#10 0xa7f3f8a8 in pkgDPkgPM::Go (this=0x8083318, OutStatusFd=-1) at
deb/dpkgpm.cc:658
658              vector<struct DpkgState> &states = PackageOps[pkg];
(gdb) list
653                 if
(_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
654                    std::clog << "send: '" << status.str() << "'" << endl;
655                 continue;
656              }
657
658              vector<struct DpkgState> &states = PackageOps[pkg];
659              const char *next_action = NULL;
660              if(PackageOpsDone[pkg] < states.size())
661                 next_action = states[PackageOpsDone[pkg]].state;
662              // check if the package moved to the next dpkg state
(gdb) p pkg
$1 = 0x0
(gdb) p list
$2 = {0xafb7d56d "reinstall it before attempting a removal.", 0x0,
0xafb7d57e "re attempting a removal.",
 0xafb7d586 "pting a removal."}
(gdb) info local
len = <value optimized out>
status = <incomplete type>
list = {0xafb7d56d "reinstall it before attempting a removal.", 0x0,
0xafb7d57e "re attempting a removal.",
 0xafb7d586 "pting a removal."}
action = 0xafb7d57e "re attempting a removal."
states = (class
std::vector<pkgDPkgPM::DpkgState,std::allocator<pkgDPkgPM::DpkgState>

    &) @0x81668fc:
{<std::_Vector_base<pkgDPkgPM::DpkgState,std::allocator<pkgDPkgPM::DpkgState>
= {
   _M_impl = {<std::allocator<pkgDPkgPM::DpkgState>> =
{<__gnu_cxx::new_allocator<pkgDPkgPM::DpkgState>> = {<No data
fields>}, <No data fields>}, _M_start = 0x8083a78, _M_finish =
0x8083a90, _M_end_of_storage = 0x8083a98}}, <No data fields>}
pkg = 0x0
next_action = <value optimized out>
(gdb)

I believe that osso-* can be retrieved from a public server. osso-* is
supposed to generally be installed in a scratchbox or on a real device
and not onto a normal end user workstation.

The best debugging output I could get was:
Breakpoint 3, TokSplitString (Tok=58 ':', Input=0xafe8818c "status:
osso-ic: half-configured\n", List=0xafe8874c, ListMax=5)
   at contrib/strutl.cc:853

The comment says:
	 /* dpkg sends strings like this:
	    'status:   <pkg>:  <pkg  qstate>'
	    errors look like this:
	    'status: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb
: error : trying to overwrite
`/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in
package krecipes-data
	    and conffile-prompt like this
	    'status: conffile-prompt: conffile : 'current-conffile'
'new-conffile' useredited distedited
	
	 */

Both comment expectations seem to expect more :s than my error case.

At first glance, it looks like this code is ignoring the boolean
result from TokSplitString at its peril. And I'm not quite sure that
passing 5 is the right value for the array length. It sure seems like
it'd probably be a good idea to generally be cautious about the input
from another program....

This isn't 100% reproducable, it's more like 70% reproducable, since
the package database half cleans itself up if you repeat this process
enough times. But all I need to do if it stops reproducing is ask it
to blink at the osso-ic* packages again, and it returns to its
crashing state.

I meant to send this last night, but it seems I fell asleep.



Reply to: