On Wed, Jun 21, 2006 at 06:43:28PM +0200, Frank Hofmann wrote: > Hi Yandong, > > the variable 'umem_stack_depth' (defaults to 15) controls the default > number of frames recorded. You can increase that value up to a maximum of > UMEM_MAX_STACK_DEPTH. See the umem sourcecode, > ... > > I'm not sure if you need to recompile (or binhack) libumem, or if it's > sufficient to create an 'extern int umem_stack_depth = 100' in your > application source. Give it a try.
Please don't. It's not an exported library symbol, so the second solution won't work. The first will work, but is a tad extreme (and modifying system libraries is dangerous). The number of stack frames can be modified by using the "audit=frames" command in UMEM_DEBUG, as documented in umem_debug(3MALLOC). Cheers, - jonathan > FrankH. > > On Wed, 21 Jun 2006, yandong yao wrote: > > >Hi guys, > > when i use libumem and mdb to find memory leaks, use below command: > >--------------------------------------------------------- > >>::findleaks -d > >BYTES LEAKED VMEM_SEG CALLER > >8192 1 f7afa000 MMAP > >------------------------------------------------------------------------ > > Total 1 oversized leak, 8192 bytes > > > >CACHE LEAKED BUFCTL CALLER > >0004bc08 1 00106000 libX11.so.4`ia_find_display+0x48 > >0004bc08 1 002bb2c0 libglib-2.0.so.0.1000.2`g_malloc+0x4c > >0004be08 1 00961f68 libglib-2.0.so.0.1000.2`g_malloc+0x4c > >0004be08 1 001fed20 libglib-2.0.so.0.1000.2`g_malloc0+0x4c > >------------------------------------------------------------------------ > > Total 4 buffers, 112 bytes > > > >mmap(2) leak: [f7afa000, f7afc000), 8192 bytes > >umem_alloc_24 leak: 1 buffer, 24 bytes > > ADDR BUFADDR TIMESTAMP THREAD > > CACHE LASTLOG CONTENTS > > 106000 108100 52a506242bb8 1 > > 4bc08 476a8 0 > > libumem.so.1`umem_cache_alloc+0x144 > > libumem.so.1`umem_alloc+0x58 > > libumem.so.1`malloc+0x28 > > libX11.so.4`ia_find_display+0x48 > > libX11.so.4`XSolarisIASetProcessInfo+4 > > libX11.so.4`XOpenDisplay+0x1358 > > libgdk-x11-2.0.so.0.800.17`gdk_display_open+0x18 > > > > libgdk-x11-2.0.so.0.800.17`gdk_display_open_default_libgtk_only+0x98 > > libgtk-x11-2.0.so.0.800.17`gtk_init_check+0x24 > > libgtk-x11-2.0.so.0.800.17`gtk_init+0x1c > > libbonoboui-2.so.0.0.0`bonobo_ui_gtk_post_args_parse+0xa0 > > libgnome-2.so.0.1401.0`gnome_program_postinit+0x100 > > libgnome-2.so.0.1401.0`gnome_program_init_common+0x440 > > libgnome-2.so.0.1401.0`gnome_program_initv+0x34 > > libgnome-2.so.0.1401.0`gnome_program_init+0x30 > > > >umem_alloc_24 leak: 1 buffer, 24 bytes > > ADDR BUFADDR TIMESTAMP THREAD > > CACHE LASTLOG CONTENTS > > 2bb2c0 2b8588 52a51837a240 1 > > 4bc08 407d0 0 > > libumem.so.1`umem_cache_alloc+0x144 > > libumem.so.1`umem_alloc+0x58 > > libumem.so.1`malloc+0x28 > > libglib-2.0.so.0.1000.2`g_malloc+0x4c > > libglib-2.0.so.0.1000.2`g_strdup+0x1c > > fsexam_treeview_construct+4 > > fsexam_construct_ui+0x46c > > main+0x23c > > _start+0x108 > >--------------------------------------------------------- > >it seems that the default call stack depth is 15, thus i can't see 'main' > >in the first case while i can see it in the second case. How can i change > >this depth? > > > >thank you! > > > > > >This message posted from opensolaris.org > >_______________________________________________ > >mdb-discuss mailing list > >mdb-discuss at opensolaris.org > > > > ============================================================================ > No good can come from selling your freedom, not for all gold of the world, > for the value of this heavenly gift exceeds that of any fortune on earth. > ============================================================================ > _______________________________________________ > mdb-discuss mailing list > mdb-discuss at opensolaris.org -- Jonathan Adams, Solaris Kernel Development