Author Topic: Client crashes when trying to cure Gorbiak  (Read 985 times)

Bereror

  • Hydlaa Notable
  • *
  • Posts: 773
    • View Profile
    • Planeshift API
Client crashes when trying to cure Gorbiak
« 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}
PlaneShift Sources
PlaneShift API
"Words never spoken
Are the strongest resounding"

DaveG

  • Forum Addict
  • *
  • Posts: 2058
    • View Profile
(No subject)
« Reply #1 on: December 04, 2005, 09:35:39 pm »
Is the NPC trying to do a /me?

::  PlaneShift Team Programmer  ::

Bereror

  • Hydlaa Notable
  • *
  • Posts: 773
    • View Profile
    • Planeshift API
Some more information about this quest and the client crash.
« Reply #2 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.
PlaneShift Sources
PlaneShift API
"Words never spoken
Are the strongest resounding"

DaveG

  • Forum Addict
  • *
  • Posts: 2058
    • View Profile
(No subject)
« Reply #3 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.

::  PlaneShift Team Programmer  ::

AryHann

  • Veteran
  • *
  • Posts: 1244
  • WonderWoman
    • View Profile
(No subject)
« Reply #4 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.
AryHann

http://www.reflex.lth.se/culture/annelov - Virtual Annelöv -
Engine Dep. - One of Talad's Angels - Aka ww & Ahrijani's Goddess