🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Linux X64 Crash

Started by
16 comments, last by Miss 7 years, 10 months ago

I don't use GCC that often so i'm not sure. The GCC 5 release notes do state this:

  • G++ now allows passing a non-trivially-copyable class via C varargs, which is conditionally-supported with implementation-defined semantics in the standard. This uses the same calling convention as a normal value parameter.

It shouldn't have any effect on regular functions though.

This is beyond my skillset, so i can't really help. Andreas should be able to help here when he has the time.

Advertisement
Alright, thanks for the help though!

I'll be able to work with a 32 bit build for now.

Unless gnuc has changed ABI I guess this is a problem with the way the glm::vec2 structure was registered in the call to RegisterObjectType. The flags used tell AngelScript that this object must be returned in memory rather than in the register, but clearly the gnuc compiler is returning the object in RAX.

Are you using asGetTypeTraits<glm::vec2> when registering the object type? Or did you manually pick the flags?

As far as I could tell the flags asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CAK | asOBJ_APP_CLASS_ALLFLOATS should be used. Using asGetTypeTraits it would be asOBJ_VALUE | asOBJ_POD | asGetTypeTraits<glm::vec2>() | asOBJ_APP_CLASS_ALLFLOATS.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Unless gnuc has changed ABI I guess this is a problem with the way the glm::vec2 structure was registered in the call to RegisterObjectType. The flags used tell AngelScript that this object must be returned in memory rather than in the register, but clearly the gnuc compiler is returning the object in RAX.

Are you using asGetTypeTraits<glm::vec2> when registering the object type? Or did you manually pick the flags?

As far as I could tell the flags asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CAK | asOBJ_APP_CLASS_ALLFLOATS should be used. Using asGetTypeTraits it would be asOBJ_VALUE | asOBJ_POD | asGetTypeTraits<glm::vec2>() | asOBJ_APP_CLASS_ALLFLOATS.

This is exactly what we are already using to register glm::vec2: asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CAK | asOBJ_APP_CLASS_ALLFLOATS

Try replacing asOBJ_APP_CLASS_CAK with asGetTypeTraits<glm::vec2>().

The implementation of glm::vec2 relies on templates and unions so it is quite possible the flags shouldn't be asOBJ_APP_CLASS_CAK, but rather something else. Hopefully asGetTypeTraits will figure it out for us.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

That did fix it! We can now run our game in 64 bit builds, even with Jit support. Thanks for the help!

Just out of curiosity, can you let us know the value that asGetTypeTraits returns for glm::vec2?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Sorry for the lack of response - I believe the return value is asOBJ_APP_CLASS_CA.

This topic is closed to new replies.

Advertisement