Script execute bug
issueid=353 28-03-2012 19:33
Junior Member
Number of reported issues by Asper: 1
Script execute bug

Hello Eros.

Today start wrapping Blitz3d SDK for my little game project and found some bug.

Then i run script i have strange error, output:

Main script name: C:\Program Files\thinBasic\My Project\b3d sdk\sample.tbasic
Included script:
Error code: 30
Error description: Variable not defined or misspelled Keyword
Line number: 14.9999997646012
Line code: MESH = CREATECUBE(0)
Token found: CREATECUBE
Additional info:
BUT then i run script in DEBUG mode all working fine.

My Project files:
http://www22.zippyshare.com/v/87599705/file.html
Issue Details
Issue Number 353
Project thinBasic
Category Core engine (thinCore.dll)
Status Confirmed
Priority 1 - Highest
Affected Version 1.8.9
Fixed Version (none)
Milestone (none)
Users able to reproduce bug 1
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




29-03-2012 00:03
thinBasic author
Hi Asper,

those kind of errors usually occurs when there is some memory corruption due to incorrect stack passing parameters.
It can occurs when external function/sub library is defined incorrectly or when a parameter type is not the supposed type ... and for many other reasons related to incorrect declarations.

I think the problem is in Graphics3D execution. After the call to Graphics3D, script starts to corrupt memory

I do not know BLITZ3D lib but I'm checking other languages if other programmers has created include files. For example I've found the following in FreeBasic:
http://www.freebasic.net/forum/viewt...&hilit=blitz3d

I'm checking to see if it can en-light something

30-03-2012 07:20
thinBasic author
Well, I think this is definitely a bug in thinBasic CDECL external function calling.
I've created a PowerBasic application doing exactly what your script does and it works perfectly.

Problem starts after calling the following:
Graphics3D(800, 600, 32, 0)
application stack gets corrupted.
I think the problem is related to CDECL calling convention. thinBasic is not doing the right things in cleaning parameters from the stack after function execution.

I need to disassemble the PowerBasic application I did and see how it is working with the stack.

Sorry but this is not something very quick to solve.

Ciao
Eros

30-03-2012 07:20
Issue Changed by ErosOlmi
  • Status changed from Unconfirmed to Confirmed

31-03-2012 16:18
thinBasic author

01-04-2012 18:35
Junior Member
many thanks eros, it would be greate if you fix this bug.

+ Reply