Daniel Burrows wrote:
On Wed, Nov 01, 2006 at 03:07:26PM +0100, Ed Schofield <[EMAIL PROTECTED]> was
heard to say:
...
I've now tried building aptitude with debug symbols to obtain a
meaningful backtrace, but I can't debug it with gdb:
[EMAIL PROTECTED]:~/Install/aptitude-0.4.3$ gdb aptitude
GNU gdb 6.4.90-debian
Copyright (C) 2006 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/libthread_db.so.1".
(gdb) run
Starting program: /usr/bin/aptitude
^^^^^^^^^^^^^^^^^
Probably you want "gdb ./aptitude"?
Daniel
No, it's the right file; I removed the original package and installed my
custom-built one.
Update: I can run aptitude fine under valgrind. It prints out lots of
messages describing (real or imagined) memory errors, but it runs
without segfaulting. Running the same command without valgrind produces
a segfault every time. Valgrind's memcheck tool traps every single
memory access and performs it synthetically. It also uses much _more_
memory than the program would alone. So I think we can conclude that
this segfault is not just due to my machine running out of RAM, but due
to old-fashioned heap corruption.
I'll attach the valgrind log file below. Perhaps the lines
==1444== Mismatched free() / delete / delete []
==1444== at 0x401CCBC: operator delete(void*) (vg_replace_malloc.c:244)
==1444== by 0x82708E2: reset_surrounding_or_memoization() (apt.cc:89)
indicate the problem??
-- Ed
-------------------------------
==1444== Memcheck, a memory error detector.
==1444== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==1444== Using LibVEX rev 1658, a library for dynamic binary translation.
==1444== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==1444== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation
framework.
==1444== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==1444== For more details, rerun with: -v
==1444==
==1444== My PID = 1444, parent PID = 1440. Prog and args are:
==1444== aptitude
==1444== upgrade
==1444==
--1444-- DWARF2 CFI reader: unhandled CFI instruction 0:50
--1444-- DWARF2 CFI reader: unhandled CFI instruction 0:50
--1444-- DWARF2 CFI reader: unhandled CFI instruction 0:50
--1444-- DWARF2 CFI reader: unhandled CFI instruction 0:50
==1444== Conditional jump or move depends on uninitialised value(s)
==1444== at 0x826D942:
aptitudeDepCache::build_selection_list(OpProgress&, bool, bool, char
const*) (aptcache.cc:349)
==1444== by 0x826E71E: aptitudeDepCache::Init(OpProgress*, bool,
bool, char const*) (aptcache.cc:193)
==1444== by 0x826E94F: aptitudeCacheFile::Open(OpProgress&, bool,
bool, char const*) (aptcache.cc:1638)
==1444== by 0x8272E1C: apt_load_cache(OpProgress*, bool, char const*)
(apt.cc:295)
==1444== by 0x81D8022: cmdline_upgrade(int, char**, char const*,
bool, bool, bool, bool, bool, bool, bool, bool, bool, int)
(cmdline_upgrade.cc:37)
==1444== by 0x80E6C08: main (main.cc:480)
==1444==
==1444== Use of uninitialised value of size 4
==1444== at 0x826D94A:
aptitudeDepCache::build_selection_list(OpProgress&, bool, bool, char
const*) (aptcache.cc:349)
==1444== by 0x826E71E: aptitudeDepCache::Init(OpProgress*, bool,
bool, char const*) (aptcache.cc:193)
==1444== by 0x826E94F: aptitudeCacheFile::Open(OpProgress&, bool,
bool, char const*) (aptcache.cc:1638)
==1444== by 0x8272E1C: apt_load_cache(OpProgress*, bool, char const*)
(apt.cc:295)
==1444== by 0x81D8022: cmdline_upgrade(int, char**, char const*,
bool, bool, bool, bool, bool, bool, bool, bool, bool, int)
(cmdline_upgrade.cc:37)
==1444== by 0x80E6C08: main (main.cc:480)
==1444==
==1444== Conditional jump or move depends on uninitialised value(s)
==1444== at 0x4069187: pkgTagSection::Scan(char const*, unsigned
long) (in /usr/lib/libapt-pkg-libc6.3-6.so.3.11.0)
==1444== by 0x82C1075: insert_tags(pkgCache::VerIterator const&,
pkgCache::VerFileIterator const&) (tags.cc:164)
==1444== by 0x82C1A6E: load_tags(OpProgress&) (tags.cc:221)
==1444== by 0x8272FB3: apt_load_cache(OpProgress*, bool, char const*)
(apt.cc:331)
==1444== by 0x81D8022: cmdline_upgrade(int, char**, char const*,
bool, bool, bool, bool, bool, bool, bool, bool, bool, int)
(cmdline_upgrade.cc:37)
==1444== by 0x80E6C08: main (main.cc:480)
==1444==
==1444== Conditional jump or move depends on uninitialised value(s)
==1444== at 0x406918C: pkgTagSection::Scan(char const*, unsigned
long) (in /usr/lib/libapt-pkg-libc6.3-6.so.3.11.0)
==1444== by 0x82C1075: insert_tags(pkgCache::VerIterator const&,
pkgCache::VerFileIterator const&) (tags.cc:164)
==1444== by 0x82C1A6E: load_tags(OpProgress&) (tags.cc:221)
==1444== by 0x8272FB3: apt_load_cache(OpProgress*, bool, char const*)
(apt.cc:331)
==1444== by 0x81D8022: cmdline_upgrade(int, char**, char const*,
bool, bool, bool, bool, bool, bool, bool, bool, bool, int)
(cmdline_upgrade.cc:37)
==1444== by 0x80E6C08: main (main.cc:480)
==1444==
==1444== Mismatched free() / delete / delete []
==1444== at 0x401CCBC: operator delete(void*) (vg_replace_malloc.c:244)
==1444== by 0x82708E2: reset_surrounding_or_memoization() (apt.cc:89)
==1444== by 0x8270EB1: apt_close_cache() (signal.h:544)
==1444== by 0x828054E:
download_install_manager::finish(pkgAcquire::RunResult, OpProgress&)
(download_install_manager.cc:179)
==1444== by 0x81D98CA: cmdline_do_download(download_manager*)
(cmdline_util.cc:185)
==1444== by 0x81D8474: cmdline_upgrade(int, char**, char const*,
bool, bool, bool, bool, bool, bool, bool, bool, bool, int)
(cmdline_upgrade.cc:110)
==1444== by 0x80E6C08: main (main.cc:480)
==1444== Address 0x6F67028 is 0 bytes inside a block of size 616,560
alloc'd
==1444== at 0x401D7C1: operator new[](unsigned) (vg_replace_malloc.c:195)
==1444== by 0x8271CD7: surrounding_or(pkgCache::DepIterator,
pkgCache::DepIterator&, pkgCache::DepIterator&, pkgCache*) (apt.cc:479)
==1444== by 0x8272489: package_recommended(pkgCache::PkgIterator
const&) (apt.cc:570)
==1444== by 0x81C80D5: cmdline_show_preview(bool,
std::set<pkgCache::PkgIterator, std::less<pkgCache::PkgIterator>,
std::allocator<pkgCache::PkgIterator> >&,
std::set<pkgCache::PkgIterator, std::less<pkgCache::PkgIterator>,
std::allocator<pkgCache::PkgIterator> >&,
std::set<pkgCache::PkgIterator, std::less<pkgCache::PkgIterator>,
std::allocator<pkgCache::PkgIterator> >&, bool, bool, bool, int)
(cmdline_prompt.cc:493)
==1444== by 0x81C873D: cmdline_do_prompt(bool,
std::set<pkgCache::PkgIterator, std::less<pkgCache::PkgIterator>,
std::allocator<pkgCache::PkgIterator> >&,
std::set<pkgCache::PkgIterator, std::less<pkgCache::PkgIterator>,
std::allocator<pkgCache::PkgIterator> >&,
std::set<pkgCache::PkgIterator, std::less<pkgCache::PkgIterator>,
std::allocator<pkgCache::PkgIterator> >&,
std::set<pkgCache::PkgIterator, std::less<pkgCache::PkgIterator>,
std::allocator<pkgCache::PkgIterator> >&, bool, bool, bool, bool, int,
bool, bool) (cmdline_prompt.cc:736)
==1444== by 0x81D8434: cmdline_upgrade(int, char**, char const*,
bool, bool, bool, bool, bool, bool, bool, bool, bool, int)
(cmdline_upgrade.cc:99)
==1444== by 0x80E6C08: main (main.cc:480)
==1444==
==1444== ERROR SUMMARY: 52059 errors from 5 contexts (suppressed: 27 from 1)
==1444== malloc/free: in use at exit: 116,700 bytes in 611 blocks.
==1444== malloc/free: 632,950 allocs, 632,339 frees, 34,357,061 bytes
allocated.
==1444== For counts of detected errors, rerun with: -v
==1444== searching for pointers to 611 not-freed blocks.
==1444== checked 8,589,680 bytes.
==1444==
==1444== LEAK SUMMARY:
==1444== definitely lost: 107,928 bytes in 217 blocks.
==1444== possibly lost: 4,972 bytes in 236 blocks.
==1444== still reachable: 3,800 bytes in 158 blocks.
==1444== suppressed: 0 bytes in 0 blocks.
==1444== Use --leak-check=full to see details of leaked memory.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]