GameMonkey Script

GameMonkey Script Forums
It is currently Fri Nov 16, 2018 11:53 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: GitHub respository
PostPosted: Sun Mar 08, 2015 3:38 am 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 707
I'm experimentally hosting my GMScript branch and some other FOSS projects on GitHub.
Please find them here: https://github.com/publicrepo


Top
 Profile  
Reply with quote  
 Post subject: Re: GitHub respository
PostPosted: Wed Apr 25, 2018 11:24 am 
Offline

Joined: Wed Apr 18, 2018 9:35 am
Posts: 1
Hi Greg, are you still using that repository? Is it worth checking out and playing around with?


Top
 Profile  
Reply with quote  
 Post subject: Re: GitHub respository
PostPosted: Wed Apr 25, 2018 10:27 pm 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 707
Welcome Wingrove :)

Yes, I am still using that repo and have recently done maintenance to ensure it compiles with VS2017 and has improved 64bit value support. I'm mostly using GM these days as a debug console interpreter, for debugging and testing applications.

If you're new to GM and want to play with it, that repo is a reasonably starting place. Other people have extended the language with various useful features. I can't speak for the status of any other projects or repos though.


Top
 Profile  
Reply with quote  
 Post subject: Re: GitHub respository
PostPosted: Fri Oct 05, 2018 12:29 pm 
Offline

Joined: Fri Nov 04, 2016 11:43 pm
Posts: 15
Hey Greg,

I think I have a 64 bit issue, as my code runs very stable under 32-bit. I'm kinda lost how to fix it, trying for a while now...

In "gmLibHooks.cpp" an assertion throws an exception:

Code:
        case BC_GETDOT :
        case BC_SETDOT :
        case BC_GETTHIS :
        case BC_SETTHIS :
        case BC_GETGLOBAL :
        case BC_SETGLOBAL :
        {
          gmptr * reference = (gmptr *) instruction;
          GM_ASSERT(*reference >= 0 && *reference < (gmptr) strings.m_size);
          *reference = a_machine.AllocPermanantStringObject(&stringTable[*reference])->GetRef();
          instruction += sizeof(gmptr);
          break;
        }


This is while calling "ExecuteLib" in gmMachine. I believe it is because "instruction" is 32-bit wide but "reference" is 64-bit. It kinda randomly generates exception, indicating that the upper Dword is not allocated. Now I'm puzzled if the instructions should be 64-bit. As you see, the reference is updated with a 64-bit pointer.

Have you an idea how to fix it?

Cheers,
Bastian


Top
 Profile  
Reply with quote  
 Post subject: Re: GitHub respository
PostPosted: Fri Oct 05, 2018 12:58 pm 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 707
Welcome back Bastian. I'll try to look into this soon.

I think you're saying that '*reference' appears to have a valid string index in the lower 32bit but junk in the higher 32bit as if not initialized properly?

1) Can you please tell me how your gmConfig_p.h defines gmint, gmfloat and gmptr?
2) Can you reproduce this by running gme.exe with a small script?
3) Which instruction was being executed at the time of the assert, and is it the same each time it fires? (eg. BC_SETGLOBAL)

Those things would be most helpful to investigate.


Top
 Profile  
Reply with quote  
 Post subject: Re: GitHub respository
PostPosted: Fri Oct 05, 2018 1:18 pm 
Offline

Joined: Fri Nov 04, 2016 11:43 pm
Posts: 15
Hi Greg, thank you! I use gm-script a lot. Thank you for the quick response and excellent library!

I found this suspicious piece of code that is taken from "gmsrc/src/platform/win32msvc". Looks wrong to begin with (#if 1).

Code:
#if 1 // 32bit int
typedef int gmint;
typedef unsigned int gmuint;
#else // 64bit int
typedef __int64 gmint;
typedef unsigned __int64 gmuint;
#endif
#if 1 // 32bit float
typedef float gmfloat;
#else // 64bit float
typedef double gmfloat;
#endif


I will provide more info on Monday (gotta run). I've this bug on Windows and MacOS, I try to port xstart to 64-bit and MacOS (which should then work soon; along with compilation to stand-alone executable and more). I think reproducing is not that straightforward, I use game-monkey libraries for compilation of "include" files, that is where trouble is. But in 32-bit that works rock-solid.

Code:
   // add source to machine
   gmStreamBufferDynamic *stream = new gmStreamBufferDynamic();
   machine->CompileStringToLib(buffer, *stream);
   machine->ExecuteLib(*stream, 0, true, file, 0);
   machine->AddSourceCode(buffer, file);
   delete stream;


It fails at "BindLib" then:

Code:
bool gmMachine::ExecuteLib(gmStream &a_stream, int * a_threadId, bool a_now, const char * a_filename, gmVariable* a_this)
{
  gmFunctionObject * rootFunction = gmLibHooks::BindLib(*this, a_stream, a_filename);


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group