On 22.12.2006, at 12:12, Zoran Vasiljevic wrote:
Something troubles him. This is on Mac OSX.
The same thing on Solaris x86
-bash-3.00$ gdb ./vmalloctest
GNU gdb 6.0
Copyright 2003 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 "i386-pc-solaris2.8"...
(gdb) run
Starting program: /usr/local/homes/zv/vmalloc/vmalloctest
warning: Lowest section in /usr/lib/libpthread.so.1 is .dynamic at
00000074
vmalloc: threads 4, loops 50000, buffer 16384: [New LWP 1]
[New LWP 2]
[New LWP 3]
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 2]
0x08051542 in cacheAlloc (cache=0x8063228, bucket=10) at vmalloc.c:315
315 page->magic = MAGIC;
(gdb) print page
$1 = (Page *) 0xffffffff
(gdb) print cache
$2 = (Cache *) 0x8063228
(gdb) print *cache
$3 = {objs = 0x0, pages = {0x0 <repeats 28 times>}, stats = {nallocs
= 1, nfrees = 0, npages = 1, npages_g = 0, nobjs = 0}}
(gdb)