Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


m4ttbush

Member Since 14 Jun 2011
Offline Last Active Mar 15 2013 01:50 AM

Posts I've Made

In Topic: Linux x86-64 not loading or saving bytecode correctly.

26 July 2012 - 08:26 PM

Thanks Andreas,
I was having the same issue with revision 1373, but I made the same changes in asCWriter::CalculateAdjustmentByPos() and asCReader::CalculateAdjustmentByPos()
And everything seems to be working now!
Does that sound right?

Thanks!

In Topic: Linux x86-64 not loading or saving bytecode correctly.

26 July 2012 - 07:27 PM

Thanks for the prompt fix Andreas!

The bytecode saves out ok from 64 bit now.
Unfortunately I'm still having issues with loading bytecode on 64 bit.

The bytecode seems to load ok and it runs, but when it executes a function with an enum parameter, the other parameters get mangled.
For example, I have a script function:
void change_state(state_types new_state, int new_face)
When the scripts are compiled on x64 it works fine, but when the bytecode is loaded again, the second parameter becomes the same value as the enum.
Replacing state_types with int then casting it back to an enum to assign it fixes the problem.
There was another case with a few enums and a string that caused a crash in the string assignment operator when the function was called. This was also fixed by replacing the enums with ints.
The function I was originally having problems with also causes problems, so I'm assuming this is the same problem but manifesting itself in a different way.

I'll see if I can isolate the problem again, I suspect it will just be a matter of reloading the bytecode in the test I posted earlier.
Edit: Yep, using the same script as before but saving then loading the bytecode before executing it causes a crash, but it works if the enum is swapped for an int.

Thanks for your help!

In Topic: Linux x86-64 not loading or saving bytecode correctly.

26 July 2012 - 12:51 AM

Hey Andreas,

I've managed to isolate the problem!
Happens on both Windows and Linux 64 bit with 2.24.0a
Looks like it's caused by an enum followed by a non-primitive type in a script function...:
enum TestEnum
{
  TestEnum_A
}
class NonPrimitive
{
}
// Problem function
void Foo( TestEnum e, NonPrimitive o )
{
}
void main()
{
  NonPrimitive o;
  Foo( TestEnum_A, o ); // Crashes saving bytecode for where it's called
}
"NonPrimitive" can be value or reference, script or application class and it will crash, but primitive types work fine.

Looks like it breaks in as_restore.cpp around line 3369 when it gets to the enum parameter.
Maybe some kind of discrepancy in how enum parameters are treated?
for( asUINT p = 0; p < calledFunc->parameterTypes.GetLength(); p++ )
{
  if( offset <= currOffset ) break;
  if( calledFunc->parameterTypes[p].GetObjectType() ||
	calledFunc->parameterTypes[p].IsReference() )
  {
	numPtrs++;
	currOffset += AS_PTR_SIZE; // offset is 1 on 32 bit and 64 bit, but this causes currOffset to be 2 on 64 bit
  }
  else
  {
	asASSERT( calledFunc->parameterTypes[p].IsPrimitive() );
	currOffset += calledFunc->parameterTypes[p].GetSizeOnStackDWords();
  }
}

In Topic: Mac OS X 32-bits crash

22 April 2012 - 02:50 AM

All of the tests passed with success.


Awesome.

Thanks so much for your help with that, and I'm really glad you got it sorted without having to shell out for a new mac.

In Topic: Mac OS X 32-bits crash

18 April 2012 - 11:57 PM

This is what I'm getting if I run just the native calling convention tests:

Same in debug/release apple/gcc compiler

AngelScript version: 2.23.1 WIP
AngelScript options: AS_MAC AS_X86
-- TestExecute passed
--- Assert failed ---
func: void ExecuteString()
mdle: ExecuteString
sect: ExecuteString
line: 1
---------------------
Failed on line 76 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp

TestReturn: cfunction didn't return properly

Failed on line 84 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp
--- Assert failed ---
func: void ExecuteString()
mdle: ExecuteString
sect: ExecuteString
line: 1
---------------------
Failed on line 88 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp
--- Assert failed ---
func: void ExecuteString()
mdle: ExecuteString
sect: ExecuteString
line: 1
---------------------
Failed on line 100 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp
Failed on line 248 in /Users/Matt/Downloads/trunk 2/sdk/tests/test_feature/projects/xcode/../../source/test_cdecl_return.cpp
--------------------------------------------
One of the tests failed, see details above.


I'll see if I can get a better idea of what's going wrong, let me know if there's any other information I can give you.

I don't know if you have any interest in upgrading your mac, and please don't feel obligated to do so.
But I just made a small donation on behalf of Hitbox for your contribution to Dustforce, which might help out if you did want to upgrade.

Thanks,
Matt

PARTNERS