GLBasic forum

Main forum => Bug Reports => Topic started by: Crivens on 2011-Sep-14

Title: Latest version causing problems
Post by: Crivens on 2011-Sep-14
I don't know what it is but something has gone wrong in the last release or two from GLB.

Basically a friend of mine was playing my latest in development game and reported that he died for no reason whatsoever. Strange. And it always happened around a certain score. Stranger I thought. So I put in a bit of debugging and the like but couldn't really track it down easily. It was something to do with the ES and EntitySingleCollision using an array that I keep adding to using DIMPUSH. But it makes no sense.

Then I tried to replicate on my various devices. It went wrong on every one of them. Fair enough. But then it worked on one. My Palm Pre2 which I hadn't updated with the latest version of my program (every other device worked on the new version). Obviously something to do with my latest version! So I load the old version and it too errors in the same place (ie. in the past I've got much higher scores). Erm. Ok maybe the pre2 version was an older build of the same version I hadn't updated?... So I try a really old version (about 2-3 weeks old), knowing that that version definitely didn't error for no reason and I had got much higher scores in testing (and the main game hasn't really changed it all in that time). And that has the error now too.

So it must be the latest version (or possibly the one before that) of GLB at fault. I read elsewhere that Gernot has changed array handling in the last version so I'm guessing it's that.

Please Obi Wan Gernot, help me in my time of need!

Oh, and while we are at it, the accelerometer doesn't seem to work correctly. Is nothing like the same values as the Pre/iOS/Android.

Ta!

Cheers 
Title: Re: Latest version causing problems
Post by: Slydog on 2011-Sep-14
Do you have at least version 10.106? 
Gernot was working on the DIMPUSH, and mentions fixing a crash bug.
Or he introduced a new one!  :-[

Code (glbasic) Select
// 10.106
   // Core:
   //    bugfix: DIMPUSH to a type array could have caused a crash.
   //    Dramatical speedup for DIMPUSH/DIMDEL. (non-required internal REDIM dropped).
Title: Re: Latest version causing problems
Post by: erico on 2011-Sep-14
Obi Wan Gernot  :D
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-14
 It's the latest one according to today. I don't think I have an older GLB to check though.

Cheers
Title: Re: Latest version causing problems
Post by: Gary on 2011-Sep-14
Crivens,

if you have 10.090 I think you will find the bug is not present. I have the same issues which dont appear with the older version
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-14
It's the latest version : 10.109

It was fine either on the last version or the version before that I believe

What would be nice is if the IDE showed the version of GLB that the code was last compiled with. Then we could see what code worked with what (as the exe shows exactly what it did at the time)

Cheers
Title: Re: Latest version causing problems
Post by: MrTAToad on 2011-Sep-14
Would it be possible to make the source code available (or a test program) ?
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-15
Not easily as I have to prepare for a business trip to Dubai tomorrow night. But if there is a way to reverse GLB to an older version then I might have time to pinpoint the version that worked and then when it went wrong. So is there a way?

Cheers
Title: Re: Latest version causing problems
Post by: MrTAToad on 2011-Sep-15
It usually zipps up the previous version contents which can just be. Decompressed
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-15
Where does it store the zipped last version? Plus does it have multiple versions so you can reinstall anything?

Actually what version is the frontpage download? If it hasn't been updated in a week or two then might be easier to just install this. Will GLB allow an older version to be installed?

At the end of the day though it definitely worked a few days ago on an older version of GLB and now doesn't and even old versions of my code don't work on the new GLB (ie. has to be a bug in the latest or at least within a few days version of GLB).

Cheers
Title: Re: Latest version causing problems
Post by: MrTAToad on 2011-Sep-15
On my machine its in
QuoteC:\Program Files (x86)\GLBasic

The version on the main site is some V10 - dont know which though.

By the way, you aren't using the ALIAS command are you ?
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-15
Hmm. Annoyingly I'm off to Dubai tomorrow so can't really test for a while. Main thing though is the DIMPUSH objects being added to and also looped through (using LEN if I remember rightly) to check for collision with a standard unchanging object in EntitySingleCollision using the ES. It just decides to detect a collision (ending the game) after the DIMPUSH objects reach 9 in number I believe.

ALIAS? Unless it's in the imported ES code (or possibly the timer movement code) then I've never heard of it. What does it do? Has it modified in the last couple of versions or something?

Cheers

Title: Re: Latest version causing problems
Post by: MrTAToad on 2011-Sep-15
From the manual :

QuoteThis command internally generates a pointer to the variable to the right of "AS". You can quite quickly access variables, lessen your typing work and avoid the calculation of [123] and [78] for each variable access.

ATTENTION:
If the size of any involved arrays gets changed (using commands like DIMPUSH, DIMDEL and DELETE), this pointer will almost certainly be broken and your program will crash ...if you're lucky.

And guess what - the 3D entity system does use it :)
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-15
Ok. So is there a new bug with the alias command then? Bearing in mind it worked perfectly before the last version of GLB.

Cheers
Title: Re: Latest version causing problems
Post by: MrTAToad on 2011-Sep-15
Dont know - dont use the EntitySystem :)
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-15
I doubt its any of that code because an old version of my code compiled on the new GLB causes the same bug too. When compiled on the older GLB it worked fine as I could see from a older version of my code I had compiled onto a pre2 with an older GLB. Plus I know I didn't see that bug before and now I can recreate it everytime using the same method which I had used without seeing the bug for weeks before

Cheers
Title: Re: Latest version causing problems
Post by: MrTAToad on 2011-Sep-16
Have found an interesting problem when using LEN (same thing happens with BOUNDS) on arrays :

Code (glbasic) Select
LOCAL a[]

WHILE TRUE
DIMPUSH a[],0
DEBUG "Size : "+LEN(a[])+"\n"
DIMDEL a[],-1
DEBUG "Size : "+LEN(a[])+"\n"
DIMDEL a[],-1
DEBUG "Size : "+LEN(a[])+"\n"
DIMPUSH a[],0
DEBUG "Size : "+LEN(a[])+"\n"
DIMPUSH a[],0
DEBUG "Size : "+LEN(a[])+"\n"
DIMDEL a[],-1
DEBUG "Size : "+LEN(a[])+"\n"
DIMDEL a[],-1
DEBUG "Size : "+LEN(a[])+"\n"

SLEEP 1
WEND


Returns the following :

QuoteSize : 1
Size : 0
Size : -1
Size : 0
Size : 1
Size : 0
Size : -1
Size : 0
Size : -1
Size : -2
Size : -1
Size : 0
Size : -1
Size : -2
Size : -1
Size : -2
Size : -3
Size : -2
Size : -1
Size : -2
Size : -3
Size : -2
Size : -3
Size : -4
Size : -3
Size : -2
Size : -3
Size : -4
Size : -3
Size : -4
Size : -5
Size : -4
Size : -3
Size : -4
Size : -5
Size : -4
Size : -5
Size : -6
Size : -5
Size : -4
Size : -5

It looks like its possibly deleting something that isn't present...  After a while the program crashes
Title: Re: Latest version causing problems
Post by: Kitty Hello on 2011-Sep-19
latest update fixed that. no? 10.114, I think.
Title: Re: Latest version causing problems
Post by: MrTAToad on 2011-Sep-20
Yes it has - for my test code anyway :)
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-30
Just to confirm that after updating to the latest GLB my code now works fine. I haven't changed anything in 2 weeks so the fix obviously worked for my problem too. Phew, thought I was going to spend the day debugging. Now I can enjoy a lovely sunny lunch with my wife at the pub :) (for practically the first time this year thanks to crap UK summer).

Heh, tallest building in the world, biggest mall in the world, most expensive fountain in the world etc was all very good and all, but it pales in comparison to getting back and finding out that GLB has been fixed :)

Cheers

Title: Re: Latest version causing problems
Post by: Nathan on 2011-Sep-30
Does that mean you app is ready to release?
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Sep-30
Ha! Nice. Still a few things to do and then put it past the Chi test on a lunch break or two :)

Cheers
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Oct-10
An update on this. v10.114 I thought fixed it. But it doesn't.

It works fine now on my PCs, and on my Pre2. Which are my main test machines and is why I said it all worked now.

But, I didn't check on my iOS devices (nor Android but lets leave that for now). I have now and the bug is still there... It's exactly the same on iOS only. Thats for a 2G iPod, 3GS, and 4G iPod. This is on GLB v10.118.

I have also tested on the TP and it also works fine like the Pre2, with no sign of this bug. I also noticed Gernot fixed the screen orientation on the latest GLB. Ta! But the GETJOYX is still getting weird values compared with the other devices.

Cheers
Title: Re: Latest version causing problems
Post by: Kitty Hello on 2011-Oct-10
push the trash button before you rebuild for iOS. It might use the old lib?
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Oct-10
I'm pretty sure it's using the latest lib as I changed a few things and they are happening on the iOS devices.

Trash button? Is that like the clean build option in xcode3? Ooh that's a good point I'm on Xcode3 still. It wouldn't be because I'm not on Xcode4 would it?

Cheers
Title: Re: Latest version causing problems
Post by: Kitty Hello on 2011-Oct-11
No, I use xcode 4 myself, but 3 should be fine.
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Oct-11
Well then it is definitely using the new lib. I changed a 3D object to a completely different shape and that is reflected in the iOS builds. Do you think I should completely remove the XCode project and get GLB to build it and transfer it all over to the Mac again? Or do you think this bug still exists for iOS?

Cheers
Title: Re: Latest version causing problems
Post by: Kitty Hello on 2011-Oct-11
So, the arrays still crash on iOS? That's about to be impossible.
In the xcode/lib directroy - compare the file libGLBasic???.a with the one in compiler/platform/iPhone/XCode/lib.

I'll have a look at the getjoyx values (for the WebOS touchpad, rigtht?)
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Oct-11
Ok. Will do. If it comes to it I will completely erase the OSX versions on the PC and Mac and re-compile/send to Mac. That should definitely have the latest GLB libs then.

Yes for WebOS Touchpad. The Pre2 is exactly the same as the iOS devices. The TP detects changes but the values are totally different.

Cheers
Title: Re: Latest version causing problems
Post by: ampos on 2011-Oct-11
That's what I have to use:

Normal:
      x=GETJOYX(0);y=GETJOYY(0)

TouchPad and my Android Tablet:
      x=-GETJOYY(0);y=GETJOYX(0)

Title: Re: Latest version causing problems
Post by: Crivens on 2011-Oct-12
You were right. The GLB lib was old and needed updating by using the trash option. Never even knew I needed it! Would it be a good idea to keep a record against each project of which GLB program lib was used with the compiled version? Then if a project is compiled against a newer version of the GLB program lib to do the trash option first before the actual compilation?

Cheers
Title: Re: Latest version causing problems
Post by: Kitty Hello on 2011-Oct-13
yes. It should always overwrite the lib.
Title: Re: Latest version causing problems
Post by: Crivens on 2011-Oct-13
Really? Don't know why it didn't for me then. My macro should copy the libs directly from the project lib directory onto the Mac project. Nevermind, the clean option worked. Just must remember to use it everytime GLB is updated or the first time I compile it for that session (ie. I forgot I updated GLB yesterday and I haven't used this project since).

Cheers
Title: Re: Latest version causing problems
Post by: Kitty Hello on 2011-Oct-13
should = oughta, but doesn't, yet
Title: Re: Latest version causing problems
Post by: Ian Price on 2011-Oct-13
Quote from: Kitty Hello on 2011-Oct-13
should = oughta, but doesn't, yet
HaHa! That's classic =D