On Sun, Mar 30, 2008 at 01:46:47PM +0200, Bram Senders <[EMAIL PROTECTED]> was 
heard to say:
> On Sat, 2008-03-29 at 19:50 -0700, Daniel Burrows wrote:
> > On Sun, Mar 30, 2008 at 12:39:21AM +0100, Bram Senders <[EMAIL PROTECTED]> 
> > was heard to say:
> > > I am also on PowerPC (as is the original reporter), and I can reproduce
> > > this on my machine.
> > 
> >   What do you get if you install valgrind and run
> > 
> >     valgrind --log-file=/tmp/aptitude.grind aptitude
> > 
> >   , then reproduce the bug?
> 
> Okay, here it is attached.
> 
> Cheers,
> Bram
> ==5065== Invalid read of size 1

> ==5065==    at 0xFFBBC7C: strlen (mc_replace_strmem.c:242)
> ==5065==    by 0xF6593D4: __dcigettext (dcigettext.c:456)
> ==5065==    by 0xF658290: dcgettext (dcgettext.c:53)
> ==5065==    by 0x100F9F4C: add_menu(cwidget::widgets::menu_info*, std::string 
> const&, cwidget::util::ref_ptr<cwidget::widgets::label> const&) (ui.cc:2385)

  (...)

  So, all this stuff in the menu code is due to a bug in ui.cc: it
stores a reference to a temporary string and then reads from it.  The
attached patch fixes this, but I doubt it's the problem you're seeing:
reading from bad memory shouldn't cause corruption later on.

> ==5065== Invalid read of size 4
> ==5065==    at 0xFDCA7EC: cwidget::widgets::widget::widget() 
> (limit_reference.h:81)

  And we crash.  The code at this point is just connecting some signals
to "this" as far as I can tell, and in fact the line of code that's
referenced above is just initializing a reference without even casting
it!  That shouldn't crash unless "this" somehow became NULL, but the
address valgrind reports isn't NULL.

  Can you compile the program with

CXXFLAGS="-g -O0 -fno-inline" ./configure && make

  and valgrind the result?

    Thanks,
  Daniel
diff -r 7d1a4a4d43db -r c7a2375be38c src/ui.cc
--- a/src/ui.cc	Sun Mar 30 14:24:28 2008 +0200
+++ b/src/ui.cc	Sun Mar 30 09:29:37 2008 -0700
@@ -2372,7 +2372,7 @@ cw::menu_info help_menu_info[]={
 	       sigc::ptr_fun(do_help_faq)),
 
   cw::menu_info(cw::menu_info::MENU_ITEM, N_("^News"), NULL,
-		ssprintf(N_("View the important changes made in each version of %s"), PACKAGE).c_str(),
+		N_("View the important changes made in each version of " PACKAGE),
 	       sigc::ptr_fun(do_help_news)),
 
   cw::menu_info(cw::menu_info::MENU_ITEM, N_("^License"), NULL,

Reply via email to