YSF
YSF copied to clipboard
Random crash on 2.2 coming from streamer's DestroyPickup
Today for the first time I have received a crash coming from Streamer's (2.9.5 so newest) pickup streaming. I think the problem lies in YSF itself so I post the issue here. Here's the stack trace:
[20/01/2022 16:03:44] [debug] Server crashed due to an unknown error
[20/01/2022 16:03:44] [debug] Native backtrace:
[20/01/2022 16:03:44] [debug] #0 f7a49e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[20/01/2022 16:03:44] [debug] #1 f7a42bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[20/01/2022 16:03:44] [debug] #2 f7a43dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[20/01/2022 16:03:44] [debug] #3 f7a44226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[20/01/2022 16:03:44] [debug] #4 f7a49adc in ?? () from plugins/crashdetect.so
[20/01/2022 16:03:44] [debug] #5 f7f7d580 in __kernel_rt_sigreturn () from linux-gate.so.1
[20/01/2022 16:03:44] [debug] #6 f796f013 in _ZN7CPlugin14RebuildRPCDataEhPN6RakNet9BitStreamEt () from plugins/YSF.so
[20/01/2022 16:03:44] [debug] #7 f797f4fb in _ZN14CHookRakServer5RPC_2EPvPhPN6RakNet9BitStreamE14PacketPriority17PacketReliabilityj8PlayerIDbb () from plugins/YSF.so
[20/01/2022 16:03:44] [debug] #8 080ac299 in ?? () from ./samp03svr
[20/01/2022 16:03:44] [debug] #9 080c8e8f in ?? () from ./samp03svr
[20/01/2022 16:03:44] [debug] #10 080cb1a5 in ?? () from ./samp03svr
[20/01/2022 16:03:44] [debug] #11 080c8cb8 in ?? () from ./samp03svr
[20/01/2022 16:03:44] [debug] #12 f5e62135 in sampgdk_DestroyPickup () from plugins/streamer.so
[20/01/2022 16:03:44] [debug] #13 f5e8d1d1 in _ZN8Streamer13streamPickupsEv () from plugins/streamer.so
[20/01/2022 16:03:44] [debug] #14 f5ea6f82 in _ZN8Streamer20startAutomaticUpdateEv () from plugins/streamer.so
[20/01/2022 16:03:44] [debug] #15 f5ea704f in ProcessTick () from plugins/streamer.so
[20/01/2022 16:03:44] [debug] #16 080d1ce2 in ?? () from ./samp03svr
[20/01/2022 16:03:44] [debug] #17 080aef6c in ?? () from ./samp03svr
[20/01/2022 16:03:44] [debug] #18 080aa13a in ?? () from ./samp03svr
[20/01/2022 16:03:44] [debug] #19 f7a8be46 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
[20/01/2022 16:03:44] [debug] #20 0804b4e1 in ?? () from ./samp03svr
Hello, thank you for reporting. Can you specify which version of the plugin/build you are using (i.e. normal, DL, static), and if you have built it yourself, can you attach the binary?
I'm running 0.3.7 R2-2, no DL. The binary is from here - the releases section. I was the one who reported previously before 2.2 release that vehicle models array is being sent incorrectly and causes reflection problem on vehicles. I downloaded it right after you posted the linux release.
I have browsed through the archive logs and unfortunately noticed that there were more crashes but nobody has reported them to me.
This one's interesting because it shows no participation of Streamer plugin, just the raknet part of YSF
[25/12/2021 19:39:20] [debug] Server crashed due to an unknown error
[25/12/2021 19:39:20] [debug] Native backtrace:
[25/12/2021 19:39:20] [debug] #0 f79fde8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[25/12/2021 19:39:20] [debug] #1 f79f6bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[25/12/2021 19:39:20] [debug] #2 f79f7dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[25/12/2021 19:39:20] [debug] #3 f79f8226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[25/12/2021 19:39:20] [debug] #4 f79fdadc in ?? () from plugins/crashdetect.so
[25/12/2021 19:39:20] [debug] #5 f7f31580 in __kernel_rt_sigreturn () from linux-gate.so.1
[25/12/2021 19:39:20] [debug] #6 f7923013 in _ZN7CPlugin14RebuildRPCDataEhPN6RakNet9BitStreamEt () from plugins/YSF.so
[25/12/2021 19:39:20] [debug] #7 f79334fb in _ZN14CHookRakServer5RPC_2EPvPhPN6RakNet9BitStreamE14PacketPriority17PacketReliabilityj8PlayerIDbb () from plugins/YSF.so
[25/12/2021 19:39:20] [debug] #8 080ac299 in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #9 080c8dbc in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #10 080cb155 in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #11 080cbbe2 in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #12 080cbe2f in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #13 080cd5e4 in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #14 080ac97c in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #15 080aed90 in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #16 080aef02 in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #17 080aa13a in ?? () from ./samp03svr
[25/12/2021 19:39:20] [debug] #18 f7a3fe46 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
[25/12/2021 19:39:20] [debug] #19 0804b4e1 in ?? () from ./samp03svr
There are several more, but they are identical (no streamer in stack trace)
This is strange – the crash would indicate that the pickup is being destroyed for a player that doesn't exist (or is somehow else corrupted).
I have added a null check to that place. Could you test YSF.zip please?
I've already put it on the server, will monitor the logs for anything new. But the frequency of those is so low that it may take some time.
I have unfortunately experienced another crash running the new version:
[31/01/2022 13:38:29] [debug] Server crashed due to an unknown error
[31/01/2022 13:38:29] [debug] Native backtrace:
[31/01/2022 13:38:29] [debug] #0 f7a44e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[31/01/2022 13:38:29] [debug] #1 f7a3dbcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[31/01/2022 13:38:29] [debug] #2 f7a3edbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[31/01/2022 13:38:29] [debug] #3 f7a3f226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[31/01/2022 13:38:29] [debug] #4 f7a44adc in ?? () from plugins/crashdetect.so
[31/01/2022 13:38:29] [debug] #5 f7f78580 in __kernel_rt_sigreturn () from linux-gate.so.1
[31/01/2022 13:38:29] [debug] #6 f796a129 in _ZN7CPlugin14RebuildRPCDataEhPN6RakNet9BitStreamEt () from plugins/YSF.so
[31/01/2022 13:38:29] [debug] #7 f797a60d in _ZN14CHookRakServer5RPC_2EPvPhPN6RakNet9BitStreamE14PacketPriority17PacketReliabilityj8PlayerIDbb () from plugins/YSF.so
[31/01/2022 13:38:29] [debug] #8 080ac299 in ?? () from ./samp03svr
[31/01/2022 13:38:29] [debug] #9 080c8e8f in ?? () from ./samp03svr
[31/01/2022 13:38:29] [debug] #10 080cb1a5 in ?? () from ./samp03svr
[31/01/2022 13:38:29] [debug] #11 080c8cb8 in ?? () from ./samp03svr
[31/01/2022 13:38:29] [debug] #12 f5e62135 in sampgdk_DestroyPickup () from plugins/streamer.so
[31/01/2022 13:38:29] [debug] #13 f5e8d1d1 in _ZN8Streamer13streamPickupsEv () from plugins/streamer.so
[31/01/2022 13:38:29] [debug] #14 f5ea6f82 in _ZN8Streamer20startAutomaticUpdateEv () from plugins/streamer.so
[31/01/2022 13:38:29] [debug] #15 f5ea704f in ProcessTick () from plugins/streamer.so
[31/01/2022 13:38:29] [debug] #16 080d1ce2 in ?? () from ./samp03svr
[31/01/2022 13:38:29] [debug] #17 080aef6c in ?? () from ./samp03svr
[31/01/2022 13:38:29] [debug] #18 080aa13a in ?? () from ./samp03svr
[31/01/2022 13:38:29] [debug] #19 f7a86e46 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
[31/01/2022 13:38:29] [debug] #20 0804b4e1 in ?? () from ./samp03svr
Just to confirm that I am running the correct build:
[31/01/2022 13:39:07] ==============================================
[31/01/2022 13:39:07] YSF 2.2 (compiled Jan 20 2022 18:43:45) loaded
[31/01/2022 13:39:07] (c) 2008 Alex "Y_Less" Cole
[31/01/2022 13:39:07] (c) 2010 - 2018 kurta999
[31/01/2022 13:39:07] (c) 2018 - 2020 IllidanS4
[31/01/2022 13:39:07] Server version: 0.3.7 R2-1 or R2-2, Linux
[31/01/2022 13:39:07] ==============================================
Is it possible that it's a streamer bug and not caused by YSF? Must also add that there isn't anything suspicious in the logs. Basically nothing happens for a minute preceding the crash.
Hmm, the crash is definitely on this line. I think I might have got an idea, thanks to my recent experiments with actors (which work the same way in the streamer) – when I caused something that would destroy an actor in OnDynamicActorStreamIn
, the memory would be left corrupted and the next call to DestroyActor
would crash.
Is it possible we are facing a similar situation here? In that case the issue would be somewhere in your code, where you'd be destroying a pickup/player right in the middle of its callback.
As far as I can see in streamer's include file there is no StreamIn
callback for dynamic pickups - anyway only place where I'm using DestroyDynamicPickup
without admin action is under OnPlayerPickupDynamicPickup
when players pick up statues around the map - but specially for this case I have added a log before DestroyDynamicPickup
and it's not present anywhere near the crash - so nobody has picked up any at that moment.
This is my plugins line: plugins crashdetect fixes2 sscanf mysql filemanager streamer pawncmd YSF mapandreas
I try to keep my GM clean from garbage so I don't really use any external includes. The fixes2 plugin only has timer precision fixes inside IIRC - it's stripped of other "fixes". Streamer is the newest version v2.9.5
How to reproduce the problem. I created a topic and left until the solution in case you are in a hurry. https://github.com/IllidanS4/YSF/issues/144