httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: [users@httpd] Seg fault when assigning value in AP_INIT_TAKE1 callback
Date Sun, 08 Dec 2013 07:38:46 GMT

On 8 Dec 2013, at 04:17, Allasso Travesser wrote:

> Hello,
> 
> Learning to create modules, I want to read configuration directives. I used the following
example out of “The Apache Modules Book” (Nick Kew).  It compiles fine, however, when
I restart apache, I get segmentation fault:

So why not start with a complete example, then reduce it step-by-step
to what you have?  That way you see where it falls apart and figure out
why what you just lost mattered.

In this case ...

> The fault seems to be a result of this line of code (no error results if it is removed):
> 
>   ((txt_cfg*)cfg)->header = val ;

… cfg needs to have been initialised, but ...

> module AP_MODULE_DECLARE_DATA customauthform_module =
> {
>     STANDARD20_MODULE_STUFF,
>     NULL,
>     NULL,
>     NULL,
>     NULL,
>     mod_cmds,
>     register_hooks,
> };

… your initialisation function is NULL.

(judging by the name of your module, maybe the now-standard
mod_auth_form would be a good startingpoint for you?)

-- 
Nick Kew
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message