GNU gdb 2001-07-05-cvs (MI_OUT) Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". (gdb) file kernel Reading symbols from kernel...done. (gdb) b panic Breakpoint 1 at 0x1feb66: file ../libc/gen/panic.c, line 31. (gdb) target remote /dev/ttyS0 Remote debugging using /dev/ttyS0 0x00112960 in main (argc=163168, argv=0x1) at ../gnumach/oskit/x86/main.c:89 89 } (gdb) c Continuing. Breakpoint 1, panic (fmt=0x1ff9c0 "LMM unexpectedly out of physical pages") at ../libc/gen/panic.c:31 31 va_start(vl, fmt); (gdb) bt #0 panic (fmt=0x1ff9c0 "LMM unexpectedly out of physical pages") at ../libc/gen/panic.c:31 #1 0x001006ac in consider_lmm_collect () at ../gnumach/oskit/osenv_mem.c:478 #2 0x0010e914 in vm_pageout_scan () at ../gnumach/vm/vm_pageout.c:564 #3 0x0010edc5 in vm_pageout_continue () at ../gnumach/vm/vm_pageout.c:921 (gdb) up #1 0x001006ac in consider_lmm_collect () at ../gnumach/oskit/osenv_mem.c:478 warning: Source file is more recent than executable. 478 panic ("LMM unexpectedly out of physical pages"); (gdb) l 473 { 474 /* This allocation should never fail, since we keep track 475 of the number of pages available in the lmm. */ 476 pages[i] = lmm_alloc_page (&malloc_lmm, 0); 477 if (pages[i] == 0) 478 panic ("LMM unexpectedly out of physical pages"); 479 debug_protect_page (pages[i]); 480 } 481 482 update_counts (); (gdb) where #0 panic (fmt=0x1ff9c0 "LMM unexpectedly out of physical pages") at ../libc/gen/panic.c:31 #1 0x001006ac in consider_lmm_collect () at ../gnumach/oskit/osenv_mem.c:478 #2 0x0010e914 in vm_pageout_scan () at ../gnumach/vm/vm_pageout.c:564 #3 0x0010edc5 in vm_pageout_continue () at ../gnumach/vm/vm_pageout.c:921 (gdb) up #2 0x0010edc5 in vm_pageout_continue () at ../gnumach/vm/vm_pageout.c:921 921 vm_pageout_scan(); (gdb) l 916 * zero, to check vm_page_free_target and 917 * vm_page_inactive_target. 918 */ 919 920 for (;;) { 921 vm_pageout_scan(); 922 /* we hold vm_page_queue_free_lock now */ 923 assert(vm_page_free_wanted == 0); 924 925 assert_wait(&vm_page_free_wanted, FALSE); (gdb) up Initial frame selected; you cannot go up. (gdb) down #1 0x0010e914 in vm_pageout_scan () at ../gnumach/vm/vm_pageout.c:564 564 consider_lmm_collect(); (gdb) l 559 */ 560 561 Restart: 562 stack_collect(); 563 net_kmsg_collect(); 564 consider_lmm_collect(); 565 consider_task_collect(); 566 consider_thread_collect(); 567 consider_zone_gc(); 568 (gdb) 569 for (burst_count = 0;;) { 570 register vm_page_t m; 571 register vm_object_t object; 572 unsigned int free_count; 573 574 /* 575 * Recalculate vm_page_inactivate_target. 576 */ 577 578 vm_page_lock_queues(); (gdb) where #0 panic (fmt=0x1ff9c0 "LMM unexpectedly out of physical pages") at ../libc/gen/panic.c:31 #1 0x001006ac in consider_lmm_collect () at ../gnumach/oskit/osenv_mem.c:478 #2 0x0010e914 in vm_pageout_scan () at ../gnumach/vm/vm_pageout.c:564 #3 0x0010edc5 in vm_pageout_continue () at ../gnumach/vm/vm_pageout.c:921 (gdb) down #0 0x001006ac in consider_lmm_collect () at ../gnumach/oskit/osenv_mem.c:478 478 panic ("LMM unexpectedly out of physical pages"); (gdb) l 473 { 474 /* This allocation should never fail, since we keep track 475 of the number of pages available in the lmm. */ 476 pages[i] = lmm_alloc_page (&malloc_lmm, 0); 477 if (pages[i] == 0) 478 panic ("LMM unexpectedly out of physical pages"); 479 debug_protect_page (pages[i]); 480 } 481 482 update_counts (); (gdb) p pages $1 = {0x98000, 0x99000, 0x9a000, 0x9b000, 0x9c000, 0x9d000, 0x9e000, 0x0, 0x80000, 0x81000, 0x82000, 0x83000, 0x84000, 0x85000, 0x86000, 0x87000, 0x88000, 0x89000, 0x8a000, 0x8b000, 0x8c000, 0x8d000, 0x8e000, 0x8f000, 0x90000, 0x91000, 0x92000, 0x93000, 0x94000, 0x95000, 0x96000, 0x97000} (gdb) p i $2 = 7 (gdb) p malloc_lmm $3 = {regions = 0x2821e0} (gdb) whatis malloc_lmm type = lmm_t (gdb) whatis malloc_lmm->regions type = struct lmm_region * (gdb) p *malloc_lmm->regions $4 = {next = 0x2821a0, nodes = 0x54ac7a8, min = 16777216, max = 4294967288, flags = 0, pri = 0, free = 8856} (gdb) bt #0 panic (fmt=0x1ff9c0 "LMM unexpectedly out of physical pages") at ../libc/gen/panic.c:31 #1 0x001006ac in consider_lmm_collect () at ../gnumach/oskit/osenv_mem.c:478 #2 0x0010e914 in vm_pageout_scan () at ../gnumach/vm/vm_pageout.c:564 #3 0x0010edc5 in vm_pageout_continue () at ../gnumach/vm/vm_pageout.c:921 (gdb) p vm_page_unqueued_count $5 = 3292 (gdb) p lmm_wants_pages $6 = 0 (gdb) vm_page_queue_free_count $7 = 7109 (gdb) p vm_page_unqueued_count $8 = 3292 (gdb) p lmm_wants_pages $10 = 0 (gdb) p vm_page_queue_free_count $11 = 7109 (gdb) p vm_page_unqueued_count $12 = 3292 (gdb) p need $13 = 686 (gdb) p batch $14 = 32 (gdb) p i $15 = 7 (gdb) l lmm_alloc_page 19 20 #include "lmm.h" 21 22 void *lmm_alloc_page(lmm_t *lmm, lmm_flags_t flags) 23 { 24 return lmm_alloc_gen(lmm, PAGE_SIZE, flags, PAGE_SHIFT, 0, 25 (oskit_addr_t)0, (oskit_size_t)-1); 26 } 27 (gdb) l lmm_alloc_gen 18 #include "lmm.h" 19 20 void *lmm_alloc_gen(lmm_t *lmm, oskit_size_t size, lmm_flags_t flags, 21 int align_bits, oskit_addr_t align_ofs, 22 oskit_addr_t in_min, oskit_size_t in_size) 23 { 24 oskit_addr_t in_max = in_min + in_size; 25 struct lmm_region *reg; 26 27 #if 0 (gdb) p *malloc_lmm $16 = {regions = 0x2821e0} (gdb) p *malloc_lmm->regions $17 = {next = 0x2821a0, nodes = 0x54ac7a8, min = 16777216, max = 4294967288, flags = 0, pri = 0, free = 8856} (gdb) p *malloc_lmm->regions->nodes $18 = {next = 0x54afaa8, size = 1632} (gdb) set $n=malloc_lmm->regions->nodes Undefined command: "". Try "help". (gdb) set $n=malloc_lmm->regions->nodes (gdb) p *($n=$n->next) $19 = {next = 0x54b0780, size = 24} (gdb) p *($n=$n->next) $20 = {next = 0x54b1e40, size = 2560} (gdb) p *($n=$n->next) $21 = {next = 0x54b5200, size = 192} (gdb) p *($n=$n->next) $22 = {next = 0x54b63e0, size = 1312} (gdb) p *($n=$n->next) $23 = {next = 0x54b7ca0, size = 1440} (gdb) p *($n=$n->next) $24 = {next = 0x6914cc0, size = 864} (gdb) p *($n=$n->next) $25 = {next = 0x0, size = 832} (gdb) p *($n=$n->next) Cannot access memory at address 0x0 (gdb) set $r=malloc_lmm->regions (gdb) p *($r=$r->next) $26 = {next = 0x282160, nodes = 0x29ca38, min = 1048576, max = 16777216, flags = 2, pri = -1, free = 13438504} (gdb) p *($r=$r->next) (gdb) set $r=malloc_lmm->regions (gdb) p *($n=$n->next) (gdb) set $r=malloc_lmm->regions (gdb) p *($r=$r->next) (gdb) p *($n=$r->nodes) $27 = {next = 0x0, size = 1480} (gdb) p *($n=$r->next) (gdb) set $r=malloc_lmm->regions (gdb) p *($n=$n->next) (gdb) set $r=malloc_lmm->regions (gdb) p *($r=$r->next) $28 = {next = 0x0, nodes = 0x2060, min = 0, max = 1048576, flags = 3, pri = -2, free = 11152} (gdb) p *($r=$r->next[1@n=$r->noder=$r->next) (gdb) set $r=malloc_lmm->regions (gdb) p *($n=$r->nodes) $29 = {next = 0x1d000, size = 4000} (gdb) p *($n=$r->noder=$r->next[1@n=$r->noder=$r->next) (gdb) set $r=malloc_lmm->regions (gdb) p *($n=$n->next) $30 = {next = 0x1d390, size = 896} (gdb) p *($n=$n->next) $31 = {next = 0x9f000, size = 3184} (gdb) p *($n=$n->next) $32 = {next = 0x0, size = 3072} (gdb) p *($n=$n->next) Cannot access memory at address 0x0 (gdb) p *($r=$r->next) Cannot access memory at address 0x0 (gdb) c Continuing. Interrupted while waiting for the program. Give up (and stop debugging it)? (y or n) y (gdb) q corum:/gnu/local/src/gnumach-build# exit Script done on Mon Jul 23 19:30:19 2001