Re: Seg fault when assigning value in AP_INIT_TAKE1 callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx






[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux