[bt-devel] Sword++ Infinite Loop

Jaak Ristioja jaak at ristioja.ee
Tue Oct 4 12:26:40 MST 2016


Among other issues the main problem here is that calling clone() from
the class itself (especially from its constructor) is a very bad idea.

J

On 04.10.2016 20:30, Gary Holmlund wrote:
> Using git bisect, I found the problem commit:
> 
> e5cc9988ca86f01d6f938c5ecfb13daf1a8e1a79 is the first bad commit
> commit e5cc9988ca86f01d6f938c5ecfb13daf1a8e1a79
> Author: Jaak Ristioja <jaak at ristioja.ee>
> Date:   Fri Sep 30 00:04:05 2016 +0300
> 
>     VerseKey: Eliminated useless tmpClone field.
> 
> Gary
> 
> 
> On 10/04/2016 09:16 AM, Jaak Ristioja wrote:
>> Thanks, guys! I think it is better to add these even if some of them
>> currently fail.
>>
>> J
>>
>> On 04.10.2016 18:38, Greg Hellings wrote:
>>> When you're ready, you can add the tests both to CMake, using the
>>> CTEST_* functions and then add "make test" to the .travis.yml file so
>>> things like this don't crop up as easily in the future!
>>>
>>> --Greg
>>>
>>> On Tue, Oct 4, 2016 at 11:28 AM, Gary Holmlund
>>> <gary.holmlund at gmail.com> wrote:
>>>> I was working on getting the tests to compile. Your recent changes
>>>> make some
>>>> of them not compile. I have not checked in those fixes yet. Running
>>>> "listtest" in the build "tests" directory was what I am showing. The
>>>> beginning of listtest.cpp is:
>>>>
>>>> ./listtest
>>>>
>>>>
>>>> int main(int argc, char **argv)
>>>> {
>>>>      // simple bounds check on verse first before we try this with
>>>> listkey
>>>>      SWKey text;
>>>>      VerseKey vk("jn 1:1", "jn 1:12");         // infinite loop.
>>>> Line 37
>>>>
>>>> Gary
>>>>
>>>>
>>>>
>>>> On 10/04/2016 12:15 AM, Jaak Ristioja wrote:
>>>>> More and more I get the feeling I should have started a new
>>>>> implementation rather than a fork... The code they've come up with is
>>>>> simply amazing... ;/
>>>>>
>>>>> How did you test this?
>>>>>
>>>>> J
>>>>>
>>>>> On 04.10.2016 07:20, Gary Holmlund wrote:
>>>>>> Jaak,
>>>>>>
>>>>>> I ran into an infinite loop tonight. It looks like below. I did
>>>>>> not have
>>>>>> time to figure it out. I don't believe it was there the previous
>>>>>> day, so
>>>>>> I think it is related to changes you make recently.
>>>>>>
>>>>>> Gary
>>>>>>
>>>>>> 1  swordxx::VerseKey::getText        versekey.cpp 1210 0x7ffff7a99bac
>>>>>> 2  swordxx::SWKey::SWKey             swkey.cpp    60 0x7ffff7aa0489
>>>>>> 3  swordxx::VerseKey::VerseKey       versekey.cpp 99 0x7ffff7a97efc
>>>>>> 4  swordxx::VerseKey::clone          versekey.cpp 265 0x7ffff7a97f82
>>>>>> 5  swordxx::VerseKey::initBounds     versekey.cpp 1180 0x7ffff7a9752a
>>>>>> 6  swordxx::VerseKey::getLowerBound  versekey.cpp 1132 0x7ffff7a97fd9
>>>>>> 7  swordxx::VerseKey::copyFrom       versekey.cpp 215 0x7ffff7a98532
>>>>>> 8  swordxx::VerseKey::VerseKey       versekey.cpp 102 0x7ffff7a97f2e
>>>>>> 9  swordxx::VerseKey::clone          versekey.cpp 265 0x7ffff7a97f82
>>>>>> 10 swordxx::VerseKey::initBounds     versekey.cpp 1180 0x7ffff7a9752a
>>>>>> 11 swordxx::VerseKey::getLowerBound  versekey.cpp 1132 0x7ffff7a97fd9
>>>>>> 12 swordxx::VerseKey::copyFrom       versekey.cpp 215 0x7ffff7a98532
>>>>>> 13 swordxx::VerseKey::VerseKey       versekey.cpp 102 0x7ffff7a97f2e
>>>>>> 14 swordxx::VerseKey::clone          versekey.cpp 265 0x7ffff7a97f82
>>>>>> 15 swordxx::VerseKey::initBounds     versekey.cpp 1180 0x7ffff7a9752a
>>>>>> 16 swordxx::VerseKey::getLowerBound  versekey.cpp 1132 0x7ffff7a97fd9
>>>>>> 17 swordxx::VerseKey::copyFrom       versekey.cpp 215 0x7ffff7a98532
>>>>>> 18 swordxx::VerseKey::VerseKey       versekey.cpp 102 0x7ffff7a97f2e
>>>>>> 19 swordxx::VerseKey::clone          versekey.cpp 265 0x7ffff7a97f82
>>>>>> 20 swordxx::VerseKey::initBounds     versekey.cpp 1180 0x7ffff7a9752a
>>>>>> 21 swordxx::VerseKey::getLowerBound  versekey.cpp 1132 0x7ffff7a97fd9
>>>>>> 22 swordxx::VerseKey::copyFrom       versekey.cpp 215 0x7ffff7a98532
>>>>>> 23 swordxx::VerseKey::VerseKey       versekey.cpp 102 0x7ffff7a97f2e
>>>>>> 24 swordxx::VerseKey::clone          versekey.cpp 265 0x7ffff7a97f82
>>>>>> 25 swordxx::VerseKey::initBounds     versekey.cpp 1180 0x7ffff7a9752a
>>>>>> 26 swordxx::VerseKey::getLowerBound  versekey.cpp 1132 0x7ffff7a97fd9
>>>>>> 27 swordxx::VerseKey::copyFrom       versekey.cpp 215 0x7ffff7a98532
>>>>>> 28 swordxx::VerseKey::VerseKey       versekey.cpp 102 0x7ffff7a97f2e
>>>>>> 29 swordxx::VerseKey::clone          versekey.cpp 265 0x7ffff7a97f82
>>>>>> 30 swordxx::VerseKey::initBounds     versekey.cpp 1180 0x7ffff7a9752a
>>>>>> 31 swordxx::VerseKey::setUpperBound  versekey.cpp 1111 0x7ffff7a9792c
>>>>>> 32 swordxx::VerseKey::parseVerseList versekey.cpp 1052 0x7ffff7a9b4df
>>>>>> 33 swordxx::VerseKey::VerseKey       versekey.cpp 250 0x7ffff7a9c3be
>>>>>> 34 main                              listtest.cpp 37 0x401414
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> bt-devel mailing list
>>>>>> bt-devel at crosswire.org
>>>>>> http://www.crosswire.org/mailman/listinfo/bt-devel
>>>>>
>>>>> _______________________________________________
>>>>> bt-devel mailing list
>>>>> bt-devel at crosswire.org
>>>>> http://www.crosswire.org/mailman/listinfo/bt-devel
>>>>
>>>>
>>>> _______________________________________________
>>>> bt-devel mailing list
>>>> bt-devel at crosswire.org
>>>> http://www.crosswire.org/mailman/listinfo/bt-devel
>>> _______________________________________________
>>> bt-devel mailing list
>>> bt-devel at crosswire.org
>>> http://www.crosswire.org/mailman/listinfo/bt-devel
>>>
>>
>> _______________________________________________
>> bt-devel mailing list
>> bt-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/bt-devel
> 
> 
> _______________________________________________
> 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