xpz / cssmatch-plugin

Automatically exported from code.google.com/p/cssmatch-plugin
0 stars 0 forks source link

Crash au déchargement du plugin #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Le plugin crash lorsqu'il est déchargé (et donc quand le serveur est quitté).

Original issue reported on code.google.com by dani...@hotmail.com on 29 Jun 2010 at 6:23

GoogleCodeExporter commented 8 years ago
J'ai remarqué qu'il ne crashe qu'au déchargement du serveur. Si on décharge 
le Plugin via la commande rcon plugin_unload, le serveur ne crash pas.

Original comment by nathan.p...@gmail.com on 30 Jun 2010 at 1:07

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Alors sans débogage on peut déjà dire que le crash vient du destructeur de 
ServerPlugin :)

Original comment by dani...@hotmail.com on 30 Jun 2010 at 7:37

GoogleCodeExporter commented 8 years ago
Ou pas ^^ Avec quelques Msg par-ci par-la voila ce que donne un plugin_unload: 

CSSMatch: unloading...
CSSMatch: unloaded
CSSMatch: [DEBUG] Killing plugin!
CSSMatch: [DEBUG] Trying to removeTimers()!
CSSMatch: [DEBUG] Trying to remove Players)!
CSSMatch: [DEBUG] KILLED!
Unloaded plugin "0"
rcon from "88.86.232.163:1678": command "plugin_unload 0"

Et un exit:

PreMinidumpCallback: updating dump comment
./srcds_run: line 341:  4734 Segmentation fault      $HL_CMD
Add "-debug" to the ./srcds_run command line to generate a debug.log to help 
with solving this problem
Wed Jun 30 12:53:20 CEST 2010: Server restart in 10 seconds

Le premier message n'est pas affiché, donc le bug doit venir d'autre part.

Original comment by nathan.p...@gmail.com on 30 Jun 2010 at 10:54

GoogleCodeExporter commented 8 years ago
En provoquant le crash avec le débogueur de VC++ CSSMatch n'est pas dans le 
pile d'appel. 

Avec gdb j'obtiens ce backtrace qui laisse penser qu'il y a un rapport avec les 
ConCommands ou les Convars :

Program received signal SIGSEGV, Segmentation fault.
0x001d0eca in CCvar::UnregisterConCommands(int) () from ./bin/libvstdlib.so
(gdb) bt
#0  0x001d0eca in CCvar::UnregisterConCommands(int) () from ./bin/libvstdlib.so
#1  0x03820fb9 in ConVar_Unregister() () from 
/home/nico/srcds/orangebox/cstrike/bin/server.so
#2  0x034fa415 in CServerGameDLL::DLLShutdown() () from 
/home/nico/srcds/orangebox/cstrike/bin/server.so
#3  0x00a18e9a in SV_ShutdownGameDLL() () from 
/home/nico/srcds/orangebox/bin/engine.so
#4  0x00a3c550 in CModAppSystemGroup::Main() () from 
/home/nico/srcds/orangebox/bin/engine.so
#5  0x00a54ee5 in CAppSystemGroup::Run() () from 
/home/nico/srcds/orangebox/bin/engine.so
#6  0x00a3c8d9 in CDedicatedServerAPI::ModInit(ModInfo_t&) () from 
/home/nico/srcds/orangebox/bin/engine.so
#7  0x0080ffbe in CDedicatedAppSystemGroup::Main() () from ./bin/dedicated.so
#8  0x00813565 in CAppSystemGroup::Run() () from ./bin/dedicated.so
#9  0x00814fa7 in CSteamApplication::Main() () from ./bin/dedicated.so
#10 0x00813565 in CAppSystemGroup::Run() () from ./bin/dedicated.so
#11 0x00810339 in main () from ./bin/dedicated.so
#12 0x0081129e in DedicatedMain () from ./bin/dedicated.so
#13 0x080488e0 in main ()

Original comment by dani...@hotmail.com on 30 Jun 2010 at 1:21

GoogleCodeExporter commented 8 years ago
Il semble y avoir 2 problèmes.

Dans la fonction ServerPlugin::Load j'ai commenté les appels à hookConCommand 
et ConVarsAccessor::initializeInterface (puis tout ce qui utilise 
interfaces.convars->getConVarInterface). Le plugin ne plante plus lorsque le 
jeu est quitté.

Les 2 problèmes ont probablement la même origine. Mais ça aide à cerner ce 
qui ne tourne pas rond.

Original comment by dani...@hotmail.com on 30 Jun 2010 at 3:21

GoogleCodeExporter commented 8 years ago
Ce n'est pas tout simplement a cause du TODO : delete les ConVar pendant le 
destructor?

Original comment by nathan.p...@gmail.com on 30 Jun 2010 at 6:44

GoogleCodeExporter commented 8 years ago
Nope. Valve ne donne pas la possibilité de supprimer nous-même les 
ConVar/ConCommand. Le lien que donne en dessous de ce TODO donne une astuce 
pour défiler les ConVar/ConCommand, les supprimer et ne laisser qu'une seule 
ConVar pour éviter les problèmes. Mais est-ce vraiment indispensable d'en 
arriver là pour un plugin comme CSSMatch.

Original comment by dani...@hotmail.com on 30 Jun 2010 at 10:16

GoogleCodeExporter commented 8 years ago
Ouais non en fait ^^

Original comment by nathan.p...@gmail.com on 30 Jun 2010 at 10:18

GoogleCodeExporter commented 8 years ago
Ce patch corrige le crash qui avait lieu dès l'instant qu'on enregistrait les 
ConVar/ConCommand en appelant ConVarsAccessor::initializeInterface. Il manquait 
un appel à ConVar_Unregister(); (nouveau du Orange Box).

Il reste un crash lié aux hooks. Si on commente les appels à hookConCommand, 
le crash n'est plus là.

Original comment by dani...@hotmail.com on 30 Jun 2010 at 10:19

Attachments:

GoogleCodeExporter commented 8 years ago
J'ai oublié de dire que je n'arrive à reproduire le crash avec les hooks que 
sur Windows. J'aimerais bien me débarrasser de celui-là aussi parce que 
planter à chaque fois qu'on a besoin de fermer le jeu... c'est chiant :)

Original comment by dani...@hotmail.com on 30 Jun 2010 at 10:29

GoogleCodeExporter commented 8 years ago

Original comment by dani...@hotmail.com on 30 Jun 2010 at 11:24

GoogleCodeExporter commented 8 years ago

Original comment by dani...@hotmail.com on 1 Jul 2010 at 1:59

GoogleCodeExporter commented 8 years ago

Original comment by dani...@hotmail.com on 1 Jul 2010 at 2:03

GoogleCodeExporter commented 8 years ago
Sur une autre machine j'ai rencontré le problème au chargement du plugin. 
Mettre en commentaire les hookConCommand évitait aussi le crash.

Original comment by dani...@hotmail.com on 4 Jul 2010 at 10:27

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r346.

Le new de ServerPlugin::hookConCommand destiné à copier le nom de la commande 
à hooker n'allouait pas assez. La chaîne n'était pas terminée par \0 et le 
plugin tapait 1 octet trop loin lors de la copie.

Original comment by dani...@hotmail.com on 4 Jul 2010 at 11:35