Welcome! Log In Create A New Profile

Advanced

Re: Test the OOM situation

Peter Leonov
May 19, 2010 08:02AM
On 18.05.2010, at 23:26, Maxim Dounin wrote:

> Hello!
>
> On Tue, May 18, 2010 at 08:25:46PM +0400, Peter Leonov wrote:
>
>> Hello devels,
>>
>> There is a module that requires a heavy testing in environment with
>> low memory. Especialy it could be good to test how it goes if no
>> more memory is available in the system.
>>
>> So the questions are: is there a way to test such a module without a
>> virtual machines? and are there some tools which might be of help?
>
> You may tune memory limit for a given process instead of using
> virtual machine. Though this won't really help with testing nginx
> modules as pool allocator will protect most of allocations from
> seeing errors (while they still can happen with sligtly different
> config).

You mean that the module will be even left untouched as far
as the main request pool fail to be allocated. Understood.

>
> Injecting random errors into allocation routines proven to be much
> more usable. Just for completeness: attached trivial patch which
> I used while searching for allocation error handling bugs in nginx
> itself.

That is near what I was looking for :)

But it gives a very interesting results. For example a crash within the core:

40740 Bus error (core dumped)

#0 0x0000484b in ngx_destroy_pool (pool=0x3262b0) at src/core/ngx_palloc.c:74
74 for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {

#0 0x0000484b in ngx_destroy_pool (pool=0x3262b0) at src/core/ngx_palloc.c:74
#1 0x0002cd16 in ngx_http_close_connection (c=0x879e58) at src/http/ngx_http_request.c:3020
#2 0x0002f56a in ngx_http_set_keepalive [inlined] () at /Users/peter/pro/nginx/src/http/ngx_http_request.c:2559
#3 0x0002f56a in ngx_http_finalize_connection (r=<value temporarily unavailable, due to optimizations>) at src/http/ngx_http_request.c:2121
#4 0x0002ff66 in ngx_http_finalize_request (r=0x807c00, rc=0) at src/http/ngx_http_request.c:2029
#5 0x0003068a in ngx_http_writer (r=0x807c00) at src/http/ngx_http_request.c:2247
#6 0x0002ca70 in ngx_http_run_posted_requests (c=0x879e58) at src/http/ngx_http_request.c:1812
#7 0x0003eb06 in ngx_http_upstream_handler (ev=0x88fe78) at src/http/ngx_http_upstream.c:879
#8 0x00022ebe in ngx_kqueue_process_events (cycle=0x813628, timer=2990, flags=<value temporarily unavailable, due to optimizations>) at src/event/modules/ngx_kqueue_module.c:683
#9 0x00018d85 in ngx_process_events_and_timers (cycle=0x813628) at src/event/ngx_event.c:245
#10 0x0001fb44 in ngx_single_process_cycle (cycle=0x813628) at src/os/unix/ngx_process_cycle.c:306
#11 0x00003c5c in main (argc=7, argv=0xbffff558) at src/core/nginx.c:393


Best regards,
Peter.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Test the OOM situation

Peter Leonov 2665 May 18, 2010 12:26PM

Re: Test the OOM situation

Brian Pane 964 May 18, 2010 01:16PM

Re: Test the OOM situation

Peter Leonov 1041 May 19, 2010 07:48AM

Re: Test the OOM situation

Maxim Dounin 984 May 18, 2010 03:28PM

Re: Test the OOM situation

Peter Leonov 974 May 19, 2010 08:02AM

Re: Test the OOM situation

Maxim Dounin 1030 May 19, 2010 09:32AM

Re: Test the OOM situation

Peter Leonov 1317 May 19, 2010 05:26PM



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

Online Users

Guests: 280
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