Serious bug in KTurtle for KDE 4, help needed

2 views
Skip to first unread message

piacentini

unread,
Jan 28, 2008, 2:55:59 PM1/28/08
to KTurtle; an eduactinal programming environment
Hi. There is a serious bug in KTurtle for KDE4. It would be wonderful
if we could fix it in the next two days, so we could include the fix
in 4.0.1, which will be tagged on 01/31. Unfortunately, my time to
work on this in the next couple of days is non-existant. Maybe Niels
can have a look at it, and let me know?
A link to the bug is

http://bugs.kde.org/show_bug.cgi?id=156437

Regards,
Mauricio Piacentini

Niels Slot

unread,
Jan 28, 2008, 4:24:08 PM1/28/08
to kdeedu-...@googlegroups.com
Hi Mauricio,

Thanks for pointing this out. I'll try to take a serious look at it before 01/31. It's probably gonna be tomorrow or Wednesday.

Niels

2008/1/28, piacentini <piace...@kde.org>:

Mauricio Piacentini

unread,
Jan 29, 2008, 6:57:46 AM1/29/08
to kdeedu-...@googlegroups.com
Niels Slot wrote:
> Thanks for pointing this out. I'll try to take a serious look at it before
> 01/31. It's probably gonna be tomorrow or Wednesday.

Good, Niels. If you can make it by tomorrow (01/30), let me know and/or
backport to 4.0.1. It will be tagged at midnight (00:00 of 01/31) I
believe.

Regards,
Mauricio Piacentini

Niels Slot

unread,
Jan 29, 2008, 1:46:35 PM1/29/08
to kdeedu-...@googlegroups.com
Hi Mauricio,

It seems that I fixed the bug.

Every time the 'if' statement was executed it put some sort of state variable on the local variable table (the '__%1_%2' in the code). This is fine, since it needs to know that the 'if' is already executed when it gets returned after a scope close. The only problem is a loop. In that case an 'if' is supposed to be executed more than once. Because of the state variable it only got executed half the time. I fixed the problem by only setting the state variable when the scope actually changes. This way the state variable always gets deleted when the executer returns to 'if' after the scope close.

I committed  my fix in /trunk and in /branches/4.0.

I used the following KTurtle script to test:

 reset
 $a = 0
 repeat 3 {
   $a=$a+1
        forward 20
   if $a==2 {
     print "$a == 2"
   }else{
     print "$a != 2"
   }
 }

It's based on your comment at bugs.kde.org. It now correctly prints "$a != 2", "$a == 2" and "$a != 2".

Regards,

Niels

2008/1/29, Mauricio Piacentini <piace...@kde.org>:

Mauricio Piacentini

unread,
Jan 29, 2008, 3:07:04 PM1/29/08
to kdeedu-...@googlegroups.com
Niels Slot wrote:
> Every time the 'if' statement was executed it put some sort of state
> variable on the local variable table (the '__%1_%2' in the code). This is
> fine, since it needs to know that the 'if' is already executed when it gets
> returned after a scope close. The only problem is a loop. In that case an
> 'if' is supposed to be executed more than once. Because of the state
> variable it only got executed half the time. I fixed the problem by only
> setting the state variable when the scope actually changes. This way the
> state variable always gets deleted when the executer returns to 'if' after
> the scope close.
>
> I committed my fix in /trunk and in /branches/4.0.

Hey, cool! Yes, it appears to be fixed, at least in the test scripts I
wrote to reproduce it. All work fine now.
Thanks a lot for this fix, users of KDE 4.0.1 will get it soon! I also
bumped the version number (from 0.8 beta to 0.8.1) so we can track this
better in the bugbase.
I had already backported some changes to the 4.0.1 branch, will document
it in the changelog.
A question: would you guys mind if we somehow link the posts here to the
kde-edu mailing list? Or maybe use the kde-edu one as well, instead of
this group?

Regards,
Mauricio Piacentini


Niels Slot

unread,
Jan 29, 2008, 4:22:25 PM1/29/08
to kdeedu-...@googlegroups.com


2008/1/29, Mauricio Piacentini <piace...@kde.org>:

The use of the kde-edu list is fine with me. I'm already subscribed to that group.
 

Regards,
Mauricio Piacentini




Reply all
Reply to author
Forward
0 new messages