lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Segfault in lmi with wx-2.9.5


From: Vadim Zeitlin
Subject: Re: [lmi] Segfault in lmi with wx-2.9.5
Date: Sun, 14 Jul 2013 17:54:04 +0200

On Sun, 14 Jul 2013 12:53:12 +0000 Greg Chicares <address@hidden> wrote:

GC> > doesn't seem to be debuggable so I don't know why exactly does this
GC> > happen, nor do I know if it is new.
GC> 
GC> It is new: I can't reproduce it with my last wx-2.9.3 build, and
GC> no wx-dependent code in lmi has changed since then.

 The good news is that I was able to debug the crash easily after building
LMI with MSVC and fixed it in wxWidgets so it will work with 2.9.5, thanks
a lot for finding it initially, I really have no idea how so many problems
in docview could have escaped me in spite of all my testing. Because the
bad news is that this bug was due to our own changes, again... The gory
details of the fix are at http://trac.wxwidgets.org/changeset/74515 if
you're interested but, in brief, the document pointer was used after being
freed if the view initialization failed.


GC> warning: not enough space for wxSpinCtrl!

 I've also looked at this while I was playing with the MSVC build and this
is not really wxWidgets fault but it definitely could be more helpful about
what's going on, so I've also improved the things a little here and now the
debug output says:

wxSpinCtrl "SurviveToAge": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "SurviveToYear": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "IssueAge": initial width 10 is too small, at least 19 pixels needed.
wxSpinCtrl "RetirementAge": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "SolveBeginYear": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "SolveBeginTime": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "SolveEndYear": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "SolveEndTime": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "SolveTargetYear": initial width 10 is too small, at least 19 pixels 
needed.
wxSpinCtrl "SolveTargetTime": initial width 10 is too small, at least 19 pixels 
needed.

 As you can see, the problem is that these controls are created with a
hard-coded width of 10 pixels in the XRC file which is too small to
accommodate both the spin button (whose width is 17 on my system) and
wxTextCtrl. The simplest solution would be to just remove the width
completely. If you want to impose some minimal width on the control, then
specifying a width in dialog units (i.e. with "d" suffix) and adding ~6
(one dialog unit is 1/4th of the average character width and spin button is
usually somewhat larger than an average character) should take care of
this.

 Of course, ideally wxWidgets would allow you to specify the width of the
text part of the control only, and do it in characters it contains (because
you'd probably like to say "it should be wide enough for 3 digits" and not
bother with the dialog units) and both of these enhancements had been
discussed but haven't been implemented so far.


 Thanks again for finding the bug and sorry for introducing it in the first
place,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]