[bt-devel] close presenter bug

Kevin Miller bt-devel@crosswire.org
Thu, 7 Jun 2001 08:56:21 -0600 (MDT)


I am running kde 2.1.2 from debian packages and qt 2.2.3 also
from debian package.  I already did an --enable-debug build as
that is how I was able to come up with the fix that I mentioned.
The line that dies is the close call in any of the three
presenters in the modulesChanged method.  The method checks to
see if there is any remaining modules open for that window and if
not calls close(), which is where the failure occurs--inside this
method which must come from either one of the kde or qt ancestors
of the class as I saw no such method defined in any of the
presenter classes/subclasses.

--- void CBiblePresenter::modulesChanged(){
---   m_moduleList = m_moduleChooserBar->getModuleList();
---   if (!m_moduleList.count())
--->  	close();  //*** Dies in this call ****
---   else {
---     refreshFeatures();
---     m_key->module(m_moduleList.first());
---	m_keyChooser->setModule(m_moduleList.first());
---	lookup(m_key);
---   }
--- }

If I wasn't really clear on how to reproduce the bug, I apolgize.
Here are my steps that will repeat the bug at any time in the cvs
branch or in the beta1 build.

1.  Open Bibletime, then open a module in the presenter.  Doesn't
matter if it is maximized or not.

2.  Click on the module chooser button in the open presenter's
toolbar and choose 'None'.  The presenter window will close, then
after a few seconds, Dr. Konqi comes up with seq fault
information, or if he is turned off then it just seg faults.

Hope this helps, please let me know if there is anything else I
can do to help you out.

Kevin

On Thu, 7 Jun 2001 mg.pub@gmx.net wrote:

> Hi Kevin,
>
> thanks for this constructive information.
> I have not seen this behaviour on my system.
> Which KDE/QT version are you using?
>
> If you use configure --enable-debug and recompile, you can
> debug BT with KDevelop (frontend to gdb) to see where
> the error is. Would be good if we could solve it before 1.0.
>
> Martin
>
> > In the current CVS build of bibletime there is a bug in the
> > presenters that can cause a segfault when you choose NONE from the
> > module selection button.  I also saw the same behavior in the
> > beta1 build.  This happens for all of the
> > presenters--CBiblePresenter, CCommentaryPresenter, and
> > CLexiconPresenter.  Can anyone else verify this or is this some
> > strange behavior for my system.
> >
> > If it is verifiable as a bug, I think I have a solution, but as I
> > am fairly new to KDE/QT development I am not sure if it is the
> > best solution or not.  Basically in CSwordPresenter.cpp if you
> > change the line:
> >
> > CSwordPresenter::CSwordPresenter(ListCSwordModuleInfo useModules,
> > CImportantClasses* importantClasses,QWidget *parent, const char
> > *name ) : CPresenter(parent,name) {
> >
> > to be:
> >
> > CSwordPresenter::CSwordPresenter(ListCSwordModuleInfo useModules,
> > CImportantClasses* importantClasses,QWidget *parent, const char
> > *name ) : CPresenter(parent,name,0) {
> >
> > fixes the problem.  The only change is sending in 0 as the widget
> > flag for the CPresenter which then gets used in the KMainWindow
> > constructor instead of the default WDestructiveClose.  From
> > kmainwindow.h it says:
> >
> >  *  Note that a KMainWindow per-default is created with the
> >  *  WDestructiveClose flag, i.e. it is automatically destroyed when the
> >  *  window is closed. If you do not want this behavior, specify 0 as
> >  *  widget flag in the constructor.
> >
> > By sending 0 in it thus avoids the destructive close behavior and
> > alleviates the segfault problem.  My biggest worry, being less
> > than well versed in the kde api, is that by not using
> > "destructive close" this is leaving objects and thus memory
> > around that are not getting cleaned up properly.
> >
> > Any thoughts from those who are a little more knowledgable?  If
> > this isn't reproduceable on anyone else's builds, any thoughts as
> > to why I may be seeing it?  Thanks.
> >
> > Kevin
> >
>
> --
> Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
> http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a
>
> --
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net