You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by shiva prasad <s....@gmail.com> on 2014/05/26 09:26:40 UTC

Apache 2.4: Segmentation fault with wrong reference from ap_get_module_config

Hello All,

OS: RHEL 6 64 bit machine.

Getting segmentation fault with the wrong reference pointer from
ap_get_module_config.

here while creating the ga_vs_config for module config in the code
below(vs_config apr_palloc (p, s), it's returning the address 0x8477930,
but while getting the reference from ap_get_module_config (vs_config =
(ga_vs_config *)ap_get_module_config), it's returning 0x2009 and causing
segmentation fault while assigning vsid to it (vs_config->vsid = vsid).

Note: The issue is specific to 32 bit webserver on 64 bit machine, the same
is working fine with 64 bit apache 2.4 webserver.

can you please advice on the same.

13807 - -143320688 - ga_create_server_config: no name 0x841a0a8 0x845b9f0
13807 - -143320688 - ga_create_server_config: rhel6
 0x841a0a8 0x8477930
13807 - -143320688 - cmd_gavsid: vs_config, module_index 27 0x2009 0x2009
13807 - -143320688 - cmd_gavsid: server_rec 0x84449c0
13807 - -143320688 - cmd_gavsid: server_rec->module_config 0x84449c0

typedef struct ga_vs_config
{
   char *vsid;
   char *vsname;          // Don't know if applicable yet
} ga_vs_config;


from   ga_create_server_config for creating the module config file

vs_config = (ga_vs_config *) apr_palloc (p, sizeof(ga_vs_config));



vs_config = (ga_vs_config *)ap_get_module_config((s)?s->module_config:NULL,
&ga_module);

                        if(vs_config)
                                vs_config->vsid = vsid;
                }


module AP_MODULE_DECLARE_DATA ga_module =
{
   STANDARD20_MODULE_STUFF,
      NULL,                    /* per-directory config creator */
      NULL,                    /* dir config merger */
      ga_create_server_config, /* server config creator */
      NULL,                    /* server config merger */
      ga_cmds,                 /* command table */
      ga_register_hooks,       /* set up other request processing hooks */
};


-- 
Regards,
Shivaprasad