26.12.2015, 20:32
Hi everyone,
I've been attempting to debug this issue for the past few weeks to no avail, and I am honestly confused on what could be causing this.
Here is my respawn code
This will work perfectly for an undefined amount of time. Sometimes it can be an hour, sometimes two days. I am confident that the cause of these crashes is due to our owned vehicles respawning, though the question is, how and where?
Here's the output from my debug.
As you can see "OwnedVehicleRespawn Finished" gets printed and then suddenly, the server crashes. The vehicle does not appear to actually be created as there is no print from OnVehicleSpawn? (Some debug text has changed, but the code is the same)
OnVehicleDeath is as follows
If anyone can assist with this I would be grateful, if there is any additional debug I can add then I'm happy to do that and share the results. This issue has existed for far too long now, but I cannot for the life of me understand why.
Edit: We've already tested the mod code, the crash is unrelated to applying vehicle modifications.
Thanks
I've been attempting to debug this issue for the past few weeks to no avail, and I am honestly confused on what could be causing this.
Here is my respawn code
PHP код:
forward OwnedVehicleRespawn(vehicleid);
public OwnedVehicleRespawn(vehicleid)
{
print("[DEBUG] OwnedVehicleRespawn");
VehicleInfo[vehicleid][vehicleID] = CreateVehicle(VehicleInfo[vehicleid][vModelID], VehicleInfo[vehicleid][vX], VehicleInfo[vehicleid][vY], VehicleInfo[vehicleid][vZ], VehicleInfo[vehicleid][vAngle], VehicleInfo[vehicleid][vColor1], VehicleInfo[vehicleid][vColor2], 3600, 0);
ModVehicle(VehicleInfo[vehicleid][vehicleID]);
printf("[DEBUG] Vehicle to respawn: %i", VehicleInfo[vehicleid][vehicleID]);
new count;
for(new i; i < MAX_VEHICLES; i++)
{
if(IsValidVehicle(i)) count++;
}
printf("[DEBUG] * There are %d valid spawned vehicles on this server.", count);
print("[DEBUG] OwnedVehicleRespawn Finished");
return 1;
}
Here's the output from my debug.
PHP код:
[21:29:09] OnVehicleDeath
[21:29:09] Destroyed id 276
[21:29:09] OwnedVehicleRespawn
[21:29:09] NEW DEBUG --- Vehicle to respawn ID: 276 AND its variable ID: 651 --- DB ID: 651
[21:29:09] * There are 285 valid spawned vehicles on this server.
[21:29:09] OwnedVehicleRespawn Finished
[21:29:09] [debug] Server crashed due to an unknown error
[21:29:09] [debug] Native backtrace:
[21:29:09] [debug] #0 aa6dae8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[21:29:09] [debug] #1 aa6d3bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[21:29:09] [debug] #2 aa6d4dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[21:29:09] [debug] #3 aa6d5226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[21:29:09] [debug] #4 aa6daadc in ?? () from plugins/crashdetect.so
[21:29:09] [debug] #5 ab740410 in ?? ()
[21:29:09] [debug] #6 ab740430 in ?? ()
[21:29:09] [debug] #7 ab478871 in gsignal () from /lib/libc.so.6
[21:29:09] [debug] #8 ab47a14a in abort () from /lib/libc.so.6
[21:29:09] [debug] #9 ab4b8735 in ?? () from /lib/libc.so.6
[21:29:09] [debug] #10 ab4beb91 in ?? () from /lib/libc.so.6
[21:29:09] [debug] #11 ab4c12f8 in ?? () from /lib/libc.so.6
[21:29:09] [debug] #12 ab6d9df2 in _ZdlPv () from /usr/lib/libstdc++.so.6
[21:29:09] [debug] #13 ab6d9e4e in _ZdaPv () from /usr/lib/libstdc++.so.6
[21:29:09] [debug] #14 0807fbf8 in ?? () from ./samp03svr
[21:29:09] [debug] #15 0808013d in ?? () from ./samp03svr
[21:29:09] [debug] #16 08074c3a in ?? () from ./samp03svr
[21:29:09] [debug] #17 080763fe in ?? () from ./samp03svr
[21:29:09] [debug] #18 ab71eb39 in ?? () from /lib/libpthread.so.0
[21:29:09] [debug] #19 ab530c1e in clone () from /lib/libc.so.6
PHP код:
public OnVehicleSpawn(vehicleid)
{
printf("Vehicle %i spawned!",vehicleid);
return 1;
}
PHP код:
public OnVehicleDeath(vehicleid, killerid)
{
print("OnVehicleDeath");
for(new i; i < MAX_SAVED_VEHICLES; i++)
{
if (vehicleid != VehicleInfo[i][vehicleID]) continue;
if (DestroyVehicle(vehicleid))
{
printf("Destroyed id %i", vehicleid);
OwnedVehicleRespawn(i);
}
else
{
printf("The vehicle %i was not destroyed", vehicleid);
}
break;
}
}
Edit: We've already tested the mod code, the crash is unrelated to applying vehicle modifications.
Thanks