SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 15/09/2015, 07:00 PM   #1
Patchwerk
Big Clucker
 
Join Date: Jul 2011
Location: Slovakia
Posts: 95
Reputation: 19
Default Server crash when destroyvehicle

Hi,

I find hidden bug. When I destroy vehicle in OnVehicleDeath there is chance to crash a server.

Code:
Code:
hook OnVehicleDeath(vehicleid, killerid){
	Debug(DBG_CORE, "Vehicle/Core.pwn","OnVehicleDeath(%d,%d)",vehicleid,killerid);
	foreach(new car : Vehicles){
		if(Vehicles[car][ID] == vehicleid){
			printf("%d == %d", Vehicles[car][ID], vehicleid);
			DestroyVehicle(vehicleid);
			veh_Locked[vehicleid] = INVALID_PLAYER_ID;
			defer ReCreateCar(car);
		}
	}
}

timer ReCreateCar[2500](car)
{ 
	new type = Vehicles[car][Type];
	Vehicles[type][Color][0] = random(255);
	Vehicles[type][Color][1] = random(255);
	new rand = random(VehicleCategorySize[type]);
	printf("ReCreateCar(%d), type = %d, rand = %d", car, type, rand);
	Vehicles[car][ID] = CreateVehicle(VehicleCategory[type][rand], Vehicles[car][Pos][0], Vehicles[car][Pos][1], Vehicles[car][Pos][2], Vehicles[car][Pos][3], Vehicles[car][Color][0], Vehicles[car][Color][1], 120);
	printf("ReCreateCar(%d), type = %d, rand = %d", car, type, rand);
	veh_Traveled[Vehicles[car][ID]] = randomEx(0,200000);
	if(!Vehicle_IsManual(Vehicles[car][ID])){
		SetVehicleFuel(Vehicles[car][ID], RandomFloat(3.0, GetModelMaxFuel(VehicleCategory[type][rand]), 2) );
		print("SetVehicleParams");
		SetVehicleParamsEx(Vehicles[car][ID],0,0,0,0,0,0,0);
	}
}
LOG:
Code:
[20:47:59] Vehicle/Core.pwn -> OnVehicleDeath(7,0)
[20:47:59] 7 == 7
[20:48:02] ReCreateCar(6), type = 8, rand = 23
[20:48:02] ReCreateCar(6), type = 8, rand = 23
[20:48:02] SetVehicleParams
[20:48:12] Vehicle/Core.pwn -> OnVehicleDeath(7,0)
[20:48:12] 7 == 7
[20:48:15] ReCreateCar(6), type = 8, rand = 15
[20:48:15] ReCreateCar(6), type = 8, rand = 15
[20:48:15] SetVehicleParams
[20:48:24] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:48:24] 7 == 7
[20:48:27] ReCreateCar(6), type = 8, rand = 4
[20:48:27] ReCreateCar(6), type = 8, rand = 4
[20:48:27] SetVehicleParams
[20:48:32] Vehicle/Core.pwn -> OnVehicleDeath(7,0)
[20:48:32] 7 == 7
[20:48:35] ReCreateCar(6), type = 8, rand = 3
[20:48:35] ReCreateCar(6), type = 8, rand = 3
[20:48:35] SetVehicleParams
[20:48:47] Vehicle/Core.pwn -> OnVehicleDeath(7,0)
[20:48:47] 7 == 7
[20:48:50] ReCreateCar(6), type = 8, rand = 18
[20:48:50] ReCreateCar(6), type = 8, rand = 18
[20:48:50] SetVehicleParams
[20:49:13] Vehicle/Core.pwn -> OnVehicleDeath(7,0)
[20:49:13] 7 == 7
[20:49:16] ReCreateCar(6), type = 8, rand = 18
[20:49:16] ReCreateCar(6), type = 8, rand = 18
[20:49:16] SetVehicleParams
[20:49:30] Vehicle/Core.pwn -> OnVehicleDeath(7,0)
[20:49:30] 7 == 7
[20:49:33] ReCreateCar(6), type = 8, rand = 17
[20:49:33] ReCreateCar(6), type = 8, rand = 17
[20:49:33] SetVehicleParams
[20:49:46] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:49:46] 7 == 7
[20:49:49] ReCreateCar(6), type = 8, rand = 32
[20:49:49] ReCreateCar(6), type = 8, rand = 32
[20:49:49] SetVehicleParams
[20:50:02] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:50:02] 7 == 7
[20:50:05] ReCreateCar(6), type = 8, rand = 24
[20:50:05] ReCreateCar(6), type = 8, rand = 24
[20:50:05] SetVehicleParams
[20:50:18] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:50:18] 7 == 7
[20:50:21] ReCreateCar(6), type = 8, rand = 28
[20:50:21] ReCreateCar(6), type = 8, rand = 28
[20:50:21] SetVehicleParams
[20:50:34] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:50:34] 7 == 7
[20:50:37] ReCreateCar(6), type = 8, rand = 13
[20:50:37] ReCreateCar(6), type = 8, rand = 13
[20:50:37] SetVehicleParams
[20:50:52] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:50:52] 7 == 7
[20:50:55] ReCreateCar(6), type = 8, rand = 26
[20:50:55] ReCreateCar(6), type = 8, rand = 26
[20:50:55] SetVehicleParams
[20:51:10] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:51:10] 7 == 7
[20:51:13] ReCreateCar(6), type = 8, rand = 2
[20:51:13] ReCreateCar(6), type = 8, rand = 2
[20:51:13] SetVehicleParams
[20:51:28] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:51:28] 7 == 7
[20:51:31] ReCreateCar(6), type = 8, rand = 31
[20:51:31] ReCreateCar(6), type = 8, rand = 31
[20:51:31] SetVehicleParams
[20:51:38] Vehicle/Core.pwn -> OnVehicleDeath(21,0)
[20:51:38] 21 == 21
[20:51:41] ReCreateCar(20), type = 6, rand = 8
[20:51:41] ReCreateCar(20), type = 6, rand = 8
[20:51:41] SetVehicleParams
[20:51:55] Vehicle/Core.pwn -> OnVehicleDeath(7,4)
[20:51:55] 7 == 7
[20:51:58] [debug] Server crashed due to an unknown error
[20:51:58] [debug] Native backtrace:
[20:51:58] [debug] #0 f7407e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[20:51:58] [debug] #1 f7400bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[20:51:58] [debug] #2 f7401dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[20:51:58] [debug] #3 f7402226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[20:51:58] [debug] #4 f7407adc in ?? () from plugins/crashdetect.so
[20:51:58] [debug] #5 f76e8410 in ?? ()
[20:51:58] [debug] #6 0809568a in ?? () from ./7777svr
[20:51:58] [debug] #7 080957cd in ?? () from ./7777svr
[20:51:58] [debug] #8 f63975b4 in ?? () from plugins/streamer.so
[20:51:58] [debug] #9 080ebba0 in ?? () from ./7777svr
[20:51:58] [debug] #10 080af03c in ?? () from ./7777svr
[20:51:58] [debug] #11 080aa13a in ?? () from ./7777svr
[20:51:58] [debug] #12 f7442e46 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[20:51:58] [debug] #13 0804b4e1 in ?? () from ./7777svr

Can someone confirm this bug? We destroy about 50 vehicles before crash.

Cheers

Last edited by Patchwerk; 15/09/2015 at 08:12 PM.
Patchwerk is offline   Reply With Quote
Old 15/09/2015, 07:13 PM   #2
SPAWN_METAL
Gangsta
 
SPAWN_METAL's Avatar
 
Join Date: Dec 2010
Posts: 514
Reputation: 41
Default Re: Server crash when destroyvehicle

confirm
__________________
Owner of Absolute Play and SAMP Addon
SPAWN_METAL is offline   Reply With Quote
Old 15/09/2015, 07:30 PM   #3
IstuntmanI
High-roller
 
IstuntmanI's Avatar
 
Join Date: Mar 2009
Location: Romania
Posts: 1,858
Reputation: 308
Default Re: Server crash when destroyvehicle

Also, if we try to disable the vehicle objective under OnVehicleDeath with SetVehicleParamsEx, it will not disappear until respawn.
__________________


IstuntmanI is offline   Reply With Quote
Old 15/09/2015, 11:12 PM   #4
SPAWN_METAL
Gangsta
 
SPAWN_METAL's Avatar
 
Join Date: Dec 2010
Posts: 514
Reputation: 41
Default Re: Server crash when destroyvehicle

is there something with restart?

Quote:
[20:51:55] 7 == 7
[20:51:58] [debug] Server crashed due to an unknown error
3 seconds after
__________________
Owner of Absolute Play and SAMP Addon
SPAWN_METAL is offline   Reply With Quote
Old 18/11/2016, 09:43 PM   #5
cawfee
Little Clucker
 
cawfee's Avatar
 
Join Date: Oct 2011
Location: United States
Posts: 24
Reputation: 15
Default Re: Server crash when destroyvehicle

Confirmed (been over a year now... I know)
__________________


cawfee is offline   Reply With Quote
Old 23/11/2016, 08:23 PM   #6
Drakey
Little Clucker
 
Join Date: Aug 2016
Location: United Kingdom
Posts: 26
Reputation: 1
Default Re: Server crash when destroyvehicle

Also confirmed. Would be nice if this was fixed, encountered the same thing.
__________________
[CENTER][B][FONT="Arial Narrow"]Available
for scripting.
Drakey is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crash detect , server crash Debug. whats wrong? MarwanCartman Server Support 4 10/05/2015 11:14 AM
[HELP]Server Crash - Located crash line with CrashDETECT - Guest4390857394857 Server Support 4 05/09/2014 04:37 AM
DestroyVehicle crash. MP2 Bug Reports 2 24/01/2013 07:02 PM
Fatal Game crash, Not client or server crash SourceCode Scripting Help 3 11/10/2011 05:13 PM
'SERVER: Unknown command' after used DestroyVehicle(); Faust Help Archive 12 25/02/2009 04:16 PM


All times are GMT. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.