Re: Seg fault when assigning value in AP_INIT_TAKE1 callback

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

 



Thank you for your input, Nick.  I see what you mean about using a full example; not yet understanding how modules work, it didn’t occur to me that cfg would be getting initialized somewhere else.  My c programming skills are also rudimentary.

Regarding mod_auth_form, I am using Apache 2.2.  I tried just loading a 2.4 module, but I get errors.  If I knew more about Apache and how modules work, I could probably understand why I am getting the errors.  Hence, the road I am on, as I find it helpful to learn this stuff anyway.  (I am on Ubuntu 10.04, and there is no official package for Apache 2.4 yet available, and being a nominal linux user I would rather stick with the mainstream)

Thanks for the help :-)

Allasso


On Dec 8, 2013, at 12:38 AM, Nick Kew <nick@xxxxxxxxxxxx> wrote:

> 
> 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
> 


---------------------------------------------------------------------
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