Author Topic: AutopatcherServer Crashed  (Read 12166 times)

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
AutopatcherServer Crashed
« on: February 10, 2012, 01:56:39 AM »
I want to test the AutopatcherServer .So I modfiy the client that make it loop patch . But when I open several clients . The Server Crashed.

Here is the client source code.

Thank U for any help.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: AutopatcherServer Crashed
« Reply #1 on: February 10, 2012, 02:03:31 AM »
This is with unmodified server code? Is USE_TCP defined in AutopatcherServerTest.cpp?

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #2 on: February 10, 2012, 02:13:05 AM »
Thank u for your answer.  Unmodified Server .   I  use  USE_TCP.

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #3 on: February 10, 2012, 02:20:04 AM »
By the way. It crashed when I close the client.
And I try remove ‘#define USE_TCP’  in client and server ,It not crashed. 

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: AutopatcherServer Crashed
« Reply #4 on: February 10, 2012, 10:55:41 AM »
Make this change in AutopatcherServer.cpp

Code: [Select]
void AutopatcherServer::OnGetChangelistSinceDateInt(Packet *packet)
{
RakNet::BitStream inBitStream(packet->data, packet->length, false);
ThreadData threadData;
inBitStream.IgnoreBits(8);
inBitStream.ReadCompressed(threadData.applicationName);
inBitStream.Read(threadData.lastUpdateDate);

if (IncrementPatchingUserCount(packet->systemAddress))
{
CallPacketCallback(packet, AutopatcherServerLoadNotifier::QO_POPPED_ONTO_TO_PROCESSING_THREAD);

threadData.server=this;
threadData.systemAddress=packet->systemAddress;
threadData.clientList=0;
threadPool.AddInput(GetChangelistSinceDateCB, threadData);
}
}

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #5 on: February 10, 2012, 10:26:34 PM »
 :)   Thank U for your help .
I have tried it. But it doesnt work .  So I try to add "threadData.clientList=0; " to "void AutopatcherServer::OnGetPatchInt(Packet *packet)" and "PluginReceiveResult AutopatcherServer::OnGetPatch(Packet *packet)" . It works fun.  Thank U again. ;)

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: AutopatcherServer Crashed
« Reply #6 on: February 10, 2012, 10:56:59 PM »
Why would you set it to 0 in OnGetPatchInt when it is allocating something to it there?

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #7 on: February 11, 2012, 02:29:01 AM »
Yes.  You are right.  Only need  add ''threadData.clientList=0;" into "void AutopatcherServer::OnGetChangelistSinceDateInt(Packet *packet)".
But I have another error  when I delete files in clients.

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #8 on: February 11, 2012, 02:32:05 AM »
Attach

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: AutopatcherServer Crashed
« Reply #9 on: February 11, 2012, 11:23:17 AM »
Sorry, SendIRIToAddressCB is a huge function and the error could be in many places. It's probably a threading error which makes it even harder to track down. Next time you see it I need a screenshot at each level of the callstack, but especially SendIRIToAddressCB. Also add to the watch window some variable values that are being used where it crashed.

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #10 on: February 11, 2012, 01:16:53 PM »
Thank U.   You can test on your computer use the  Attach "AutopatcherClientTest.cpp"  .  Use the latest raknet version AutopatcherServer in Debug. Open  several  clients .Than delete several pathed files.  The server  will crashed in Debug model.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: AutopatcherServer Crashed
« Reply #11 on: February 12, 2012, 12:36:36 AM »
You didn't attach the file. In any case, I don't think your test is going to be significantly different than mine to cause the bug. The reason you see the error is because you have a different computer that handles threading differently. Can you just give me the callstack and line numbers as I asked?

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #12 on: February 12, 2012, 06:16:43 AM »
I only modifies one place in the AutopatcherClient.cpp
In the main fuction.

if (kbhit())
   ch=getch();
else
   ch=0;

i replace it by "
      //if (kbhit())
      //   ch=getch();
      //else
      //   ch=0;

      ch='p';
"


lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #13 on: February 12, 2012, 06:17:28 AM »
Attach

lovesxw

  • Not-a-newbie
  • *
  • Posts: 26
  • Karma: 0
    • View Profile
Re: AutopatcherServer Crashed
« Reply #14 on: February 12, 2012, 06:18:48 AM »
Attach