Question

What is proper use of Apache method apr_pool_create_ex in Delphi XE?

I’ve created Apache modules before, but all were Handlers. Now I’m working on developing a Service provider. A skeleton module has been created and my child_init call back method is being called by Apache. In the child_init method I call ap_pool_create_ex* successfully (returns APR_SUCCESS), but after leaving the child_it call, I receive an access violation either during the (httpd.exe) spawning of the third or the fourth worker thread (third is showing in the event log).

procedure provider_child_init(pchild: Papr_pool_t; s: Pserver_rec); cdecl;
var
  rv  : apr_status_t;
  mypool : Papr_pool_t;
begin
  rv := -1;
  rv := apr_pool_create_ex(@mypool,pchild,nil,nil);
end;

The AV message is:

“Project C:\Apache2.2\bin\http.exe raised too many consecutive exceptions: ‘access violation at 0x00000000: read of address 0x00000000’. Process Stopped. Use Step or Run to continues”

Event Log:

…
Thread Start: Thread ID: 5652. Process httpd.exe (4212)
Thread Start: Thread ID: 5132. Process httpd.exe (4212)
Thread Start: Thread ID: 5988. Process httpd.exe (4212) 

NOTE: The AV occurs in Thread ID 5988 and 4212 is the Parent httpd.exe process.

  • The windows “libapr-1.dll” does not include “apr_pool_create”, that is why I’m using the “_ex” version. Any idea why apr_pool_create is missing? I see apr_pool_create being used in other successful modules although they are written in ‘C’.

OS: Windows 7 Enterprise 64-bit

Apache: 2.2.17.0

IDE: Delphi XE

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top