Attempting to write a plugin

Mike Gagnon mikegagnon at gmail.com
Fri Mar 16 15:10:56 UTC 2012


I'm new to nginx myself, so I can't offer much nginx specific advice.

Are you familiar with the GDB debugger? It's very helpful for debugging
segfaults. The nginx core module also has some useful directives that help
with debugging, such as daemon and debug_points.

I only mention these basic tips because you said C isn't one of your strong
languages.

Cheers,
Mike Gagnon


On Fri, Mar 16, 2012 at 6:33 AM, <nginx.devlist.alias at fremnet.net> wrote:

> Hi
>
> I'm attempting to write my first plugin, it's going swimmingly except it's
> not.
>
> I'm trying to add to the SSI module the same way the perl module does and
> have spent a lot of time flicking between the two (c isn't one of my strong
> languages).
>
> It appears to work, the very last log line does get called, then it
> segfaults
>
> 2012/03/16 20:14:55 [emerg] 10663#0: *1 working with the bufferzzzzzz
> while sending response to client, client: 118.xx.xx.66, server:
> flatus.xx.net, request: "GET /index.html HTTP/1.1", host: "
> flatus.xx.net:8081"
>
> 2012/03/16 20:14:55 [emerg] 10663#0: *1 working with the buffer failing
> btw YqEgHCzpROFbVQPah9mA_w==,**1331892955 while sending response to
> client, client: 118.xx.xx.66, server: flatus.xx.net, request: "GET
> /index.html HTTP/1.1", host: "flatus.xx.net:8081"
>
> I've attached the plugin, such as it is...
>
> You get the log message from line 130
> ngx_log_error(NGX_LOG_EMERG, c->log, 0, "working with the buffer failing
> btw %V", &foo);
>
> but then it promptly crashes....
>
> Any ideas? I thought it was going along so well :(
>
> Thanks
>
> Shannon.
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20120316/6ef7792e/attachment-0001.html>


More information about the nginx-devel mailing list