Welcome! Log In Create A New Profile

Advanced

nginx dso coredump

洪志道
August 30, 2016 06:34AM
Hi, guys

I found a coredump file generated on production.


(gdb) print ngx_http_abc_module
$7 = {ctx_index = 18446744073709551615, index = 18446744073709551615, name
= 0x0, spare0 = 0, spare1 = 0, version = 1010001, signature = 0x3520
<Address 0x3520 out of bounds>,
ctx = 0x204800, commands = 0x204840, type = 1347703880, init_master = 0,
init_module = 0, init_process = 0, init_thread = 0, exit_thread = 0,
exit_process = 0,
exit_master = 0, spare_hook0 = 0, spare_hook1 = 0, spare_hook2 = 0,
spare_hook3 = 0, spare_hook4 = 0, spare_hook5 = 0, spare_hook6 = 0,
spare_hook7 = 0}


The ngx_http_'abc'_module is a simple module written by ourself.
It runed well in the past time, and I just changed the following structure
defined in the module.

typedef struct {

ngx_flag_t valid;

...

ngx_uint_t member1; # added

ngx_uint_t member2; # added

...

} ngx_http_abc_ctx_t;


nginx.conf

load_module modules/....;
load_module modules/ngx_http_abc_module_3.so; # This module is in the
last postion, the other modules seems right.

And there is tiny detail. I generate so file named
'ngx_http_abc_module.so', then I copy as ngx_http_abc_module_3.so

And here are short codes about this module.

static ngx_int_t

ngx_http_abc_handler(ngx_http_request_t *r)

{

...

ngx_http_abc_ctx_t *ctx;

ngx_http_abc_loc_conf_t *vlcf;

vlcf = ngx_http_get_module_loc_conf(r, ngx_http_abc_module);

if (vlcf->enable == 0) {

return NGX_DECLINED;

}

ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_abc_ctx_t));

if (ctx == NULL) {

return NGX_ERROR;

}

ngx_http_set_ctx(r, ctx, ngx_http_abc_module);



}


config

ngx_addon_name="ngx_http_abc_module"

ngx_module_type=HTTP

ngx_module_name=ngx_http_abc_module

ngx_module_incs="$ngx_addon_dir"

ngx_module_srcs="$ngx_addon_dir/ngx_http_abc_module.c"

.. auto/module


It's sad that I can't regenerate coredump file now.

By the way, It's so convinient that use dso instead of upgrading static
module.

Thanks so much.


B.R.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

nginx dso coredump

洪志道 416 August 30, 2016 06:34AM

Re: nginx dso coredump

洪志道 187 August 30, 2016 06:56AM

Re: nginx dso coredump

Maxim Dounin 182 August 30, 2016 07:24AM

Re: nginx dso coredump

洪志道 187 August 30, 2016 08:48AM

Re: nginx dso coredump

Maxim Dounin 168 August 30, 2016 10:52AM

Re: nginx dso coredump

洪志道 187 August 30, 2016 11:26AM

Re: nginx dso coredump

Maxim Dounin 173 August 30, 2016 12:16PM

Re: nginx dso coredump

洪志道 171 August 30, 2016 01:20PM

Re: nginx dso coredump

Maxim Dounin 169 August 31, 2016 12:52PM

Re: nginx dso coredump

洪志道 182 August 31, 2016 08:22PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 200
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready