PlaneShift

Support => Technical Help: IN GAME bugs (after loading world) => Topic started by: Bereror on December 04, 2005, 06:01:35 pm

Title: Client crashes when trying to cure Gorbiak
Post by: Bereror on December 04, 2005, 06:01:35 pm
As the subject says, client crashes when trying to cure Gorbiak with a segmentation fault error.

It happens when executing the following line in chatwindow.cpp:
Code: [Select]
   case CHAT_SERVER_TELL:

        // allows /tell /me sits down for a private action
        [COLOR=red]if (!strncmp(msg.sText,\"/me \",4))[/COLOR]
            cs_snprintf(buff,1024,\"%s %s\",(const char *)msg.sPerson,((const char *)msg.sText)+4);
        else if (!strncmp(msg.sText,\"/my \",4))


And here are the msg object fields right before the crash:
Code: [Select]

$1 = { = {_vptr.psMessageCracker = 0x8395420,
    static msghandler = 0x85c3cd8, msg = 0x0, valid = false}, iChatType = 13,
  sPerson = {> = {<> = {},
      minibuff = \"Gorbiak\\000\\000\\000\\000\\000\\000\\000\\200?\", \'\\0\' , \"\\200?žME\\b\", miniused = 8}, },
  sText = {> = {<> = {},
      minibuff = \"?7??\\220:??/9????;??\\a\\030\\v\\b:??\\220:????;?\\000\\000\\000\",
      miniused = 0}, }, translate = false}
Title:
Post by: DaveG on December 04, 2005, 09:35:39 pm
Is the NPC trying to do a /me?
Title: Some more information about this quest and the client crash.
Post by: Bereror on December 05, 2005, 09:36:26 pm
Gorbiak is trying to tell us something when we offer him the cure potion, but he fails terribly (msg.sText returns NULL).

With some effort I survived whatever Gorbiak was trying to tell me, but the cure potion was still wrong and he didn\'t want it.
Title:
Post by: DaveG on December 06, 2005, 05:23:47 am
Ok, msg.sText is a csString, so I\'m switching those checks to StartsWith() which internally checks for NULLs.  That should prevent the client from crashing, but there may also be a bug server-side.
Title:
Post by: AryHann on December 09, 2005, 09:28:15 am
Bereror, I get even problems loading the quest in my server and when I do it, it simply crashes at startup.
I really think there is something wrong with the quest itself and not the code. Despite that some \"check for null\" in the messages would have been more than enough.