YSI-Includes icon indicating copy to clipboard operation
YSI-Includes copied to clipboard

[5.x] y_commands -> Array index out of bounds (AMX backtrace)

Open C-far opened this issue 7 years ago • 1 comments

Compiled on Windows with the compiler 3.10.9 Run on Ubuntu 18.04 & Windows 10

SAMP 0.3.DL

Edit: Probably an issue in amx_assembly

pawn.json :

{
	"user": "C-far",
	"repo": "test",
	"entry": "test.pwn",
	"output": "test.amx",
	"dependencies": [
		"pawn-lang/[email protected]"
	],
	"runtime": {
		"version": "0.3.7",
		"mode": "y_testing",
		"echo": "Loading configuration...",
		"rcon_password": "password",
		"port": 8192,
		"hostname": "SA-MP Server",
		"maxplayers": 50,
		"language": ""
	}
}

test.pwn :

#include <a_samp>

#include <YSI_Visual\y_commands>

main() {
    
}

logs on runtime :

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.DL-R1, (C)2005-2018 SA-MP Team

[15:36:35] 
[15:36:35] Server Plugins
[15:36:35] --------------
[15:36:35]  Loading plugin: crashdetect.so
[15:36:35]   CrashDetect plugin 4.19.4
[15:36:35]   Loaded.
[15:36:35]  Loading plugin: nativechecker.so
[15:36:35]   Loaded.
[15:36:35]  Loaded 2 plugins.

[15:36:35] 
[15:36:35] Filterscripts
[15:36:35] ---------------
[15:36:35]   Loaded 0 filterscripts.

[15:36:35] [debug] Run time error 4: "Array index out of bounds"
[15:36:35] [debug]  Attempted to read/write array element at index 32 in array of size 32
[15:36:35] [debug] AMX backtrace:
[15:36:35] [debug] #0 0000ec24 in CodeScanAddJumpTarget (cip=-16440, stk=0, hea=0, jumpTargets[CodeScanner:164]=@0002d4dc, next=32, sip=-156540) at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\..\..\YSI_Core\y_core\..\..\..\amx_assembly\codescan.inc:262
[15:36:35] [debug] #1 0000f288 in CodeScanAddSwitchTarget (dctx[DisasmContext:22]=@0002cc70, stk=0, hea=0, jumpTargets[CodeScanner:164]=@0002d4dc, next=-156540) at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\..\..\YSI_Core\y_core\..\..\..\amx_assembly\codescan.inc:294
[15:36:35] [debug] #2 00011708 in bool:CodeScanStepInternal (dctx[DisasmContext:22]=@0002cc70, csState[CodeScanner:164]=@0002d4dc, &parseState=@0002cc64 0, &parseParam=@0002cc60 0) at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\..\..\YSI_Core\y_core\..\..\..\amx_assembly\codescan.inc:747
[15:36:35] [debug] #3 00011c54 in bool:CodeScanRun (csState[CodeScanner:164]=@0002d4dc) at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\..\..\YSI_Core\y_core\..\..\..\amx_assembly\codescan.inc:817
[15:36:35] [debug] #4 0001318c in AddressofResolve () at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\..\..\YSI_Core\y_core\..\..\..\amx_assembly\addressof_jit.inc:130
[15:36:35] [debug] #5 00013728 in public AMX_OnCodeInit () at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\..\..\YSI_Core\y_core\y_thirdpartyinclude.inc:379
[15:36:35] [debug] #6 000024d4 in public Debug_OnCodeInit () at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Core\y_core\y_amx_impl.inc:206
[15:36:35] [debug] #7 00001e28 in public ScriptInit_OnCodeInit () at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Core\y_core\y_debug_impl.inc:659
[15:36:35] [debug] #8 00001238 in public OnGameModeInit () at C:\Users\C_far\Documents\test\dependencies\YSI-Includes\YSI_Visual\y_commands\..\..\YSI_Core\y_core\y_scriptinit_impl.inc:319
[15:36:35] Number of vehicle models: 0

C-far avatar Jan 28 '19 14:01 C-far

I've already fixed this locally, I was trying some new amx_assembly code I thought I tested it enough, I was wrong.

Y-Less avatar Jan 28 '19 17:01 Y-Less