Recent

Author Topic: lnet GetMessage problem under FreeBSD  (Read 3549 times)

fastblade

  • New Member
  • *
  • Posts: 20
lnet GetMessage problem under FreeBSD
« on: December 20, 2011, 03:50:29 am »
Hi,

I have a server side running under FreeBSD, when I use lnet 0.6.2, there is no problem, but after I change to 0.6.5, I meet 'Access violation'. I can locate the point where the exception raised. class TServerConnections manage all tcp connections from network and listen for all new connection request.
 The code is:

procedure TServerConnections.OnRead(aSocket : TLSocket);
Var
 ....
begin
 i := FCon.GetMessage(s,aSocket);
 if i > 0 then
 begin
  if aSocket.UserData = nil then
   begin
    aSocket.disconnect;
    exit;
   end;
  pUser := TSingleUser(aSocket.UserData);
  pUser.Buffer := pUser.Buffer + s;
  ...
 end;
end;

If I use 0.6.5, this code will raise exception randomly, maybe after the server run 1 hour or 10 hours, or
the concurrent connections exceed 80 or 200 etc...
The exception raised at FCon.GetMessage(s), there is a BUFFER_SIZE in lcommon.pp, in 0.6.2, value is 65535, but in 0.6.5, value is 262144, is this difference makes the problem occur?




Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: lnet GetMessage problem under FreeBSD
« Reply #1 on: January 06, 2012, 11:13:29 pm »
That's odd, could you please try changing it back to 65k and see if it is really related? Random crashes however are usually deeper problems, like memory corruption etc...

 

TinyPortal © 2005-2018