15.09.2015, 19:00
(
Last edited by Patchwerk; 15/09/2015 at 08:12 PM.
)
Hi,
I find hidden bug. When I destroy vehicle in OnVehicleDeath there is chance to crash a server.
Code:
LOG:
Can someone confirm this bug? We destroy about 50 vehicles before crash.
Cheers
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); } }
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
Cheers