logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Apache crashes when loaded module call nspr function PR_Init
Author
kshitiz_s



Joined: 29 Oct 2010
Posts: 1

PostPosted: Fri 29 Oct '10 12:31    Post subject: Apache crashes when loaded module call nspr function PR_Init Reply with quote

Platform : Windows 2008 R2, Windows 2003 Advanced Server
Apache version : Apache 2.2.17(httpd-2.2.17-win32-x86-no_ssl.msi/httpd-2.2.17-win32-x86-openssl-0.9.8o.msi)

Created a Apache module which calls PR_Init :

Code:

extern "C"

{

#include "httpd.h"

#include "http_config.h"

#include "ap_compat.h"

#include "apr_tables.h"

#include "prthread.h"

#include "nspr.h"

}



static command_rec config_lbplugin_cmds[] = {

   { NULL }

};



/* Initialization of my module */

static int apacheMyModule_init( apr_pool_t *p, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s )

{

        PR_Init( PR_USER_THREAD, PR_PRIORITY_NORMAL, 1);

   return OK;

}



static void apacheMyModule_register_hooks(apr_pool_t *p)

{

   ap_hook_post_config( apacheMyModule_init, NULL, NULL, APR_HOOK_MIDDLE );

}



extern "C" module MODULE_VAR_EXPORT apacheMyModule_module = {

   STANDARD20_MODULE_STUFF,

   NULL,          /* dir config creator */

   NULL,          /* dir merger --- default is to override */

   NULL,          /* server config */

   NULL,          /* merge server config */

   config_lbplugin_cmds,       /* command table */

   apacheMyModule_register_hooks

};


Compile and link this module to libnspr4.dll library.

When you load this module in Apache, it starts crashing with memory corruption.

Any help or suggestion is appreciated.

Thanks,
Kshitiz
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 16 Nov '10 12:06    Post subject: Reply with quote

Which compiler do you use? VC6? VC9? Used the debugger?
Back to top


Reply to topic   Topic: Apache crashes when loaded module call nspr function PR_Init View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads