Errors in gamemode and false to load from database
#1

Hello. I have a problem with this. My crashdetect plugin print this:

Код:
[08:44:34] [debug] Run time error 5: "Invalid memory access"
[08:44:34] [debug] AMX backtrace:
[08:44:34] [debug] #0 00045654 in ?? (45516, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... <23 arguments>) from new.amx
[08:44:34] [debug] #1 0002c8cc in ?? (45516, 82284, 32) from new.amx
[08:44:34] [debug] #2 00031800 in public FJ37DH3JG_MYSQL_INTERNAL (7502824) from new.amx
[08:44:34] [debug] Run time error 5: "Invalid memory access"
[08:44:34] [debug] AMX backtrace:
[08:44:34] [debug] #0 00047d2c in ?? (45536, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... <23 arguments>) from new.amx
[08:44:34] [debug] #1 0002c8cc in ?? (45536, 82284, 32) from new.amx
[08:44:34] [debug] #2 00031800 in public FJ37DH3JG_MYSQL_INTERNAL (7502824) from new.amx
This all show after a gmx command. Before restart all work's fine. This errors not load data from my database, is probably in this lines:

Код:
public LoadVehicles()
{
	new query[256];
	inline OnLoadVehicles()
	{
		new rows = cache_get_row_count(), vehid, ORM:orm_id;
		for(new row = 0; row != rows; row++)
		{
		    vehid = Iter_Alloc(Vehicle);
		    orm_id = VehicleCache[vehid][vOrm] = orm_create("myrp_vehicles");

		    orm_addvar_int(orm_id, VehicleCache[vehid][vUID], "veh_uid");
		    orm_addvar_int(orm_id, VehicleCache[vehid][vModel], "veh_model");

	    	orm_addvar_float(orm_id, VehicleCache[vehid][vPos][0], "veh_posx");
			orm_addvar_float(orm_id, VehicleCache[vehid][vPos][1], "veh_posy");
			orm_addvar_float(orm_id, VehicleCache[vehid][vPos][2], "veh_posz");
			orm_addvar_float(orm_id, VehicleCache[vehid][vPos][3], "veh_posa");

			orm_addvar_int(orm_id, VehicleCache[vehid][vCol][0], "veh_col1");
			orm_addvar_int(orm_id, VehicleCache[vehid][vCol][1], "veh_col2");

			orm_addvar_int(orm_id, VehicleCache[vehid][vInt], "veh_int");
			orm_addvar_int(orm_id, VehicleCache[vehid][vWorld], "veh_world");

			orm_addvar_int(orm_id, VehicleCache[vehid][vOwnerType], "veh_ownertype");
			orm_addvar_int(orm_id, VehicleCache[vehid][vOwner], "veh_owner");

			orm_setkey(orm_id, "veh_uid");
			orm_apply_cache(orm_id, row);

			VehicleCache[vehid][vGID] = CreateVehicle(VehicleCache[vehid][vModel], VehicleCache[vehid][vPos][0], VehicleCache[vehid][vPos][1], VehicleCache[vehid][vPos][2], VehicleCache[vehid][vPos][3], VehicleCache[vehid][vCol][0], VehicleCache[vehid][vCol][1], 3600);
		}
	}
	mysql_format(MysqlHandle, query, sizeof(query), "SELECT * FROM `myrp_vehicles` WHERE veh_ownertype <> %d", OWNER_PLAYER);
	mysql_tquery_inline(MysqlHandle, query, using inline OnLoadVehicles, "");
	return 1;
}
Код:
public LoadGroups()
{
	inline OnLoadGroups()
	{
		new rows = cache_get_row_count(), group_id, ORM:orm_id;
		for(new row = 0; row != rows; row++)
		{
		    group_id = Iter_Alloc(Group);
		    orm_id = GroupCache[group_id][gOrm] = orm_create("myrp_groups");
		    
	    	orm_addvar_int(orm_id, GroupCache[group_id][gUID], "group_uid");
			orm_addvar_string(orm_id, GroupCache[group_id][gName], 32, "group_name");

			orm_addvar_int(orm_id, GroupCache[group_id][gType], "group_type");
			orm_addvar_int(orm_id, GroupCache[group_id][gCash], "group_cash");
			
			orm_addvar_string(orm_id, GroupCache[group_id][gTag], 5, "group_tag");

			orm_addvar_int(orm_id, GroupCache[group_id][gColor], "group_color");
			orm_addvar_int(orm_id, GroupCache[group_id][gFlags], "group_flags");
			
			orm_addvar_int(orm_id, GroupCache[group_id][gOwner], "group_owner");

			orm_setkey(orm_id, "group_uid");
			orm_apply_cache(orm_id, row);
		}
	}
	mysql_tquery_inline(MysqlHandle, "SELECT * FROM `myrp_groups`", using inline OnLoadGroups, "");
	return 1;
}
I using that functions in OnGamemodeInit. Anyone know what is this? Sry for my bad english.
Reply
#2

You will need to compile with debug info for more meaningful reports: https://github.com/Zeex/samp-plugin-...ith-debug-info

FJ37DH3JG_MYSQL_INTERNAL is the callback that mysql_tquery_inline is using.

What version of YSI are you using? I found another bug reported with y_inline after "gmx": https://github.com/pBlueG/SA-MP-MySQL/issues/72
Reply
#3

I using YSI 4.0. But i going to check 3.1 version.

EDIT:
YSI 3.1 version solved the problem. But i've got a question. ORM id's after gmx is not clean up - it's a correct action in this plugin? Or i need to clean this by my hand? LOGS:

Код:
[09:22:31] Number of vehicle models: 0
[09:22:32] ORM_ID: 1, ID: 0, UID: 6, MODEL: 411
[09:22:32] ORM_ID: 2, ID: 1, UID: 9, MODEL: 411
[09:22:33] ORM_ID: 3, ID: 2, UID: 10, MODEL: 411
[09:22:33] ORM_ID: 4, ID: 3, UID: 11, MODEL: 462
[09:22:33] ORM_ID: 5, ID: 4, UID: 12, MODEL: 411
[09:22:33] ORM_ID: 6, ID: 5, UID: 13, MODEL: 411
[09:22:33] ORM_ID: 7, ID: 0, UID: 1, NAME: Testowa grupa
[09:22:34] ORM_ID: 8, ID: 1, UID: 2, NAME: Siema test
[09:22:34] ORM_ID: 9, ID: 2, UID: 3, NAME: GRUPA 15
[09:22:34] ORM_ID: 10, ID: 3, UID: 4, NAME: GRUPSON
[09:22:34] ORM_ID: 11, ID: 4, UID: 5, NAME: GRUPINSON
[09:22:34] ORM_ID: 12, ID: 5, UID: 6, NAME: GYM
[09:22:35] ORM_ID: 13, ID: 6, UID: 7, NAME: GYM
[09:22:35] ORM_ID: 14, ID: 7, UID: 8, NAME: Central Bank
[09:22:35] ORM_ID: 15, ID: 8, UID: 9, NAME: Test
[09:22:35] ORM_ID: 16, ID: 9, UID: 10, NAME: GROVE STREET HOME

// GMX here

[09:23:28] Number of vehicle models: 0
[09:23:29] ORM_ID: 23, ID: 0, UID: 6, MODEL: 411
[09:23:30] ORM_ID: 24, ID: 1, UID: 9, MODEL: 411
[09:23:30] ORM_ID: 25, ID: 2, UID: 10, MODEL: 411
[09:23:30] ORM_ID: 26, ID: 3, UID: 11, MODEL: 462
[09:23:30] ORM_ID: 27, ID: 4, UID: 12, MODEL: 411
[09:23:31] ORM_ID: 28, ID: 5, UID: 13, MODEL: 411
[09:23:31] ORM_ID: 29, ID: 0, UID: 1, NAME: Testowa grupa
[09:23:31] ORM_ID: 30, ID: 1, UID: 2, NAME: Siema test
[09:23:31] ORM_ID: 31, ID: 2, UID: 3, NAME: GRUPA 15
[09:23:31] ORM_ID: 32, ID: 3, UID: 4, NAME: GRUPSON
[09:23:31] ORM_ID: 33, ID: 4, UID: 5, NAME: GRUPINSON
[09:23:31] ORM_ID: 34, ID: 5, UID: 6, NAME: GYM
[09:23:32] ORM_ID: 35, ID: 6, UID: 7, NAME: GYM
[09:23:32] ORM_ID: 36, ID: 7, UID: 8, NAME: Central Bank
[09:23:32] ORM_ID: 37, ID: 8, UID: 9, NAME: Test
[09:23:32] ORM_ID: 38, ID: 9, UID: 10, NAME: GROVE STREET HOME

// NEXT gmx here

[09:24:04] ORM_ID: 44, ID: 0, UID: 6, MODEL: 411
[09:24:06] ORM_ID: 45, ID: 1, UID: 9, MODEL: 411
[09:24:06] ORM_ID: 46, ID: 2, UID: 10, MODEL: 411
[09:24:07] ORM_ID: 47, ID: 3, UID: 11, MODEL: 462
[09:24:08] ORM_ID: 48, ID: 4, UID: 12, MODEL: 411
[09:24:09] ORM_ID: 49, ID: 5, UID: 13, MODEL: 411
[09:24:10] ORM_ID: 50, ID: 0, UID: 1, NAME: Testowa grupa
[09:24:10] ORM_ID: 51, ID: 1, UID: 2, NAME: Siema test
[09:24:11] ORM_ID: 52, ID: 2, UID: 3, NAME: GRUPA 15
[09:24:11] ORM_ID: 53, ID: 3, UID: 4, NAME: GRUPSON
[09:24:12] ORM_ID: 54, ID: 4, UID: 5, NAME: GRUPINSON
[09:24:12] ORM_ID: 55, ID: 5, UID: 6, NAME: GYM
[09:24:13] ORM_ID: 56, ID: 6, UID: 7, NAME: GYM
[09:24:13] ORM_ID: 57, ID: 7, UID: 8, NAME: Central Bank
[09:24:14] ORM_ID: 58, ID: 8, UID: 9, NAME: Test
[09:24:15] ORM_ID: 59, ID: 9, UID: 10, NAME: GROVE STREET HOME
Thanks very much for help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)