On Thu, Oct 06, 2005 at 12:04:01PM +0200, Tom Parker <[EMAIL PROTECTED]> was 
heard to say:
> Daniel Burrows wrote:
> >  I think a backtrace really would help, since that would give me a clue
> >which widget is being hauled out of its grave...I'll try some more
> >combinations of packages and see if I can reproduce it here, too.
> 
> I'm now able to trigger it by starting aptitude without any arguments, 
> selecting a version of a package that breaks something, pressing 'g' to 
> bring up the solutions dialog, and attempting to "apply" the first solution 
> that I get given.
> 
> Tried recompiling aptitude with CXXFLAGS="-O0 -g" set in order to get rid 
> of the optimizing away that was hiding some of the information about the 
> program stack, and got the attached stack trace screenshot. Hopefully it'll 
> be of a bit more use...

  Ah, thanks.  I found a bit of code that's definitely wrong, and it may
even be causing your crash (thank goodness I put those asserts in, or
you'd have gotten random memory corruption later on).  Could you try the
attached patch and see if the crash goes away?

   Thanks,
  Daniel
Thu Oct  6 11:19:02 PDT 2005  Daniel Burrows <[EMAIL PROTECTED]>
  * Use a slot_event instead of a custom event type to post solution dialog 
updates.
  Aside from bringing this code into line with the current recommended way of
  handling one-off events, this also avoids posting bare pointers to the event
  queue when the underlying object might be deleted before the event is
  dispatched (the alternative would be to make the update_event hold either
  a weak or a strong reference, but this is obviously simpler).
diff -rN -u old-head/src/solution_dialog.cc new-head/src/solution_dialog.cc
--- old-head/src/solution_dialog.cc     2005-10-06 11:19:54.815119824 -0700
+++ new-head/src/solution_dialog.cc     2005-10-06 11:13:20.000000000 -0700
@@ -57,25 +57,9 @@
     update();
   }
 
-  struct update_event : public vscreen_event
-  {
-    solution_dialog *dlg;
-
-  public:
-    update_event(solution_dialog *_dlg)
-      :dlg(_dlg)
-    {
-    }
-
-    void dispatch()
-    {
-      dlg->update();
-    }
-  };
-
   void post_update()
   {
-    vscreen_post_event(new update_event(this));
+    vscreen_post_event(new slot_event(sigc::mem_fun(this, 
&solution_dialog::update)));
   }
 
 protected:

Attachment: signature.asc
Description: Digital signature

Reply via email to