[fpc-devel] Lazarus Apache module crashes during concurrent requests

ABorka fpc-devel at aborka.com
Wed Sep 24 10:58:56 CEST 2008


I'm not sure that something is changed to make it incompatible.
The apache modules compiled on windows are only crashing if multiple 
requests are coming at the same time, and they are crushing at 
function/procedure returns (Yes, on Linux it is even worse, since no 
module gets even loaded by apache. That might be some C API translation 
problem).

Even if reduced to this small code it crushes (but only if multiple 
calls are inside this code) on windows:
===========================
Function TCustomApacheApplication.ProcessRequest(P: PRequest_Rec) : Integer;

Var
   Req : TApacheRequest;
   Resp : TApacheResponse;
   i:integer;

begin
   Req:=TApacheRequest.CreateReq(Self,P);
   Try
     Resp:=TApacheResponse.CreateApache(Req);
     Try
for i := 0 to maxint do ;//Time wasting for multiple requests at the 
same time to run this code
//      HandleRequest(Req,Resp);
//      If Not Resp.ContentSent then
//        Resp.SendContent;
     Finally
       Result:=OK;
       Resp.Free;//<= crashes after here randomly for 2nd simultaneous 
caller
     end;
   Finally
     Req.Free;
   end;
end;
==============================
Sometimes when removing all the try/finally pairs from the function it 
works.
But then adding more code, even as simple as DateTimeToStr(Now), makes 
it crash. Sometimes more code can be added but then it will crash inside 
that code somewhere at function/procedure returns.

AB

Felipe Monteiro de Carvalho wrote:
> Try installing an older Apache.
> 
> I installed here with XAMMP, Apache 2.2.9 and it just quits without
> any error message when loading my Pascal module.
> 
> But when using the standard Apache 2.2.6 in Mandriva 2008 it works.
> Actually I can't get it to show the page (some config problem?), but
> it loads without problems, apache keeps working.
> 
> I think something changed in an incompatible way. This is pretty
> unexpected, as I hoped that they would keep compatibility between all
> 2.2.x series.
> 




More information about the fpc-devel mailing list