[bt-devel] SegFault in 2.3.3 during navigation
Gary Holmlund
gary.holmlund at gmail.com
Wed Nov 4 13:21:24 MST 2009
I looked at this for some time. I believe it is safe to copy the pointer
for now.
The real problem here is where multiple classes use the same pointer to
a verse reference. For instance, the CKeyReferenceWidget which
implements the spinboxes for book, chapter, and verse. It keeps a copy
of this pointer, increments it when the user changes the widget, and
emits a signal for a verse change. The signal for verse change is caught
by CBibleKeyChooser where it emits a beforeKeyChange using the same
shared pointer. It does not know that the value in the pointer has
already been changed. It then saves the pointer and emits a keyChanged
with the saved pointer thinking that the second emit has a different
value. This lead to problems in the saving of text in personal
commentaries. Also, keeping a pointer as a member of multiple classes
clearly can cause problems if any class decides to delete and recreate
the pointer.
I think the real answer is to eliminate the use of a shared pointer for
verse references. Each class should have a method of getting the verse
reference value gets a non-pointer copy of the verse reference. All of
the emit signals should pass a const reference to a verse value rather
than the shared pointer. Doing this may take some time and perhaps
should not be done as we are getting ready to make a release.
Gary
Martin Gruner wrote:
> Eeli,
>
> I just looked at the "fix" in r1726. It seems kindof dangerous to just copy the
> key object, introducing a memory leak. I would guess that this only masks the
> original crash problem instead of fixing it, but I cannot tell for sure now.
>
> I don't have the time now to investigate it, will be away until Monday.
>
> mg
>
> Am Mittwoch, 4. November 2009 17:10:12 schrieb Eeli Kaikkonen:
>
>> On Wed, 4 Nov 2009, John A. Sullivan III wrote:
>>
>>> Hello, all. It's great to be able to use BibleTime once again.
>>> However, I am experiencing a readily reproducible segfault after
>>> upgrading to 2.3.3 via an apt-get update on fully patched Ubuntu 8.04 on
>>> 64-bit AMD. If I scroll forward a chapter using the next chapter
>>> navigation arrows in my Bible pane and then click on a verse lower down
>>> in the text, I get a segmentation fault every time.
>>>
>> This has accidentally been fixed with svn r1726 while fixing another
>> crash. It should be backported to 2.3 series.
>>
>>
>>> I also noticed this wiped out any bookmarks I had created. I looked for
>>> a way to save the bookmarks other than quitting BibleTime as a way to
>>> protect my work from this bug. Perhaps I didn't look hard enough but I
>>> did not see a way. Is there a way to save bookmarks from within a
>>> session? Should they be save automatically upon creation so they are not
>>> lost in the event of a crash? Thanks - John
>>>
>> That's a reasonable request (saving automatically), but could you add it
>> to our feature request database in sourceforge.net?
>>
>> Yours,
>> Eeli Kaikkonen (Mr.), Oulu, Finland
>> e-mail: eekaikko at mailx.studentx.oulux.fix (with no x)
>>
>> _______________________________________________
>> bt-devel mailing list
>> bt-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/bt-devel
>>
>>
>
>
More information about the bt-devel
mailing list