[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Texmacs-dev] Using Valgrind and first results
From: |
David MENTRE |
Subject: |
[Texmacs-dev] Using Valgrind and first results |
Date: |
Tue, 25 May 2004 10:25:02 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Hello,
I've tried to configure Valgrind to look for TeXmacs memory leaks.
First, I have modified with following line the texmacs sh script:
exec valgrind --leak-check=yes --gen-suppressions=yes
--suppressions=texmacs.supp -v texmacs.bin "$@"
The --gen-suppressions=yes allows valgrind to generate copy/paste-ready
suppression entries for the texmacs.supp file. For those who haven't
read valgrind doc, suppressions are supposed or real errors we don't
want to track.
Using an iterative approach, I have generated attached texmacs.supp
file. I would advise TeXmacs hackers to read it and check that I
haven't suppressed real or potential TeXmacs leak or error.
With this setting, valgrind runs without to much errors/warnings. Be
aware that valgrind slows TeXmacs a lot. Right now, my test procedure is
to start TeXmacs and then quit it (C-x C-c).
With this setting, I have following result:
==4199== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 115742 from 11)
--4199--
--4199-- supp: 45 Ugly strchr error in /lib/ld-2.3.2.so
--4199-- supp: 11 Unitialized value in edit_env_rep::decode_length(string)
(env_exec.cpp:1656)
I have added the above one at potential TeXmacs error. See end of
texmacs.supp.
--4199-- supp: 4 TLS Syscall param writev(vector[...]) contains
uninitialised or unaddressable byte(s)
--4199-- supp: 2 Guile GC uninitialised value of size 4 in scm_markstream
--4199-- supp: 16 Guile GC scm_c_hook_run
--4199-- supp: 963 Guile GC scm_c_hook_run
--4199-- supp: 11459 Guile GC scm_igc
--4199-- supp: 15758 Guile GC marking
--4199-- supp: 17544 Guile GC marking
--4199-- supp: 69421 Guile GC marking
--4199-- supp: 519 __libc_sigaction (in /lib/tls/libc-2.3.2.so
==4199== malloc/free: in use at exit: 5604984 bytes in 13895 blocks.
==4199== malloc/free: 36887 allocs, 22992 frees, 8319394 bytes allocated.
==4199==
==4199== searching for pointers to 13895 not-freed blocks.
==4199== checked 13398108 bytes.
==4199==
==4199== ---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- n
==4199==
==4199== 5520 bytes in 3 blocks are definitely lost in loss record 94 of 105
==4199== at 0x3C01F40D: malloc (vg_replace_malloc.c:105)
==4199== by 0x817EED0: safe_malloc(unsigned) (fast_alloc.cpp:35)
==4199== by 0x80570E7: operator new[](unsigned) (basic.cpp:62)
==4199== by 0x8273F2D: as_charp(string) (string.cpp:235)
Is there a leak here?
==4199==
==4199== ---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- n
==4199==
==4199==
==4199== 1007792 bytes in 287 blocks are possibly lost in loss record 103 of 105
==4199== at 0x3C01F40D: malloc (vg_replace_malloc.c:105)
==4199== by 0x817EED0: safe_malloc(unsigned) (fast_alloc.cpp:35)
==4199== by 0x80570E7: operator new[](unsigned) (basic.cpp:62)
==4199== by 0x80CE2B0: hashmap_rep<tree_label, tag_info>::resize(int)
(hashmap.cpp:54)
And here?
==4199==
==4199== ---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- n
==4199==
==4199== ---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- y
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_Z11safe_mallocj
fun:_Z14enlarge_mallocj
fun:_Znwj
}
I don't know for this one.
==4199==
==4199== LEAK SUMMARY:
==4199== definitely lost: 5520 bytes in 3 blocks.
==4199== possibly lost: 1007792 bytes in 287 blocks.
Apparently, some memory is lost.
==4199== still reachable: 1114928 bytes in 30 blocks.
==4199== suppressed: 3476744 bytes in 13575 blocks.
==4199== Reachable blocks (those to which a pointer was found) are not shown.
==4199== To see them, rerun with: --show-reachable=yes
In the future, we could even try the --show-reachable=yes.
--4199-- TT/TC: 0 tc sectors discarded.
--4199-- 44558 chainings, 0 unchainings.
--4199-- translate: new 54815 (931135 -> 11394609; ratio 122:10)
--4199-- discard 0 (0 -> 0; ratio 0:10).
--4199-- dispatch: 918050000 jumps (bb entries), of which 276153172 (30%) were
unchained.
--4199-- 34842/732903 major/minor sched events. 607401 tt_fast
misses.
--4199-- reg-alloc: 12646 t-req-spill, 2047933+60867 orig+spill uis, 289456
total-reg-r.
--4199-- sanity: 30358 cheap, 1215 expensive checks.
--4199-- ccalls: 261426 C calls, 59% saves+restores avoided (924728 bytes)
--4199-- 378610 args, avg 0.91 setup instrs each (64908 bytes)
--4199-- 0% clear the stack (783960 bytes)
--4199-- 66700 retvals, 28% of reg-reg movs avoided (36644 bytes)
{
__libc_sigaction (in /lib/tls/libc-2.3.2.so
Memcheck:Param
sigaction(act)
fun:__libc_sigaction
}
{
Guile GC marking
Memcheck:Cond
obj:/usr/lib/libguile.so.12.3.0
fun:scm_mark_locations
}
{
Guile GC marking
Memcheck:Cond
fun:scm_gc_mark
}
{
Guile GC marking
Memcheck:Value4
fun:scm_gc_mark
}
{
Guile GC sweeping
Memcheck:Cond
obj:/usr/lib/libguile.so.12.3.0
fun:scm_gc_sweep
}
{
Guile GC scm_igc
Memcheck:Cond
obj:/usr/lib/libguile.so.12.3.0
fun:scm_igc
}
{
Guile GC scm_c_hook_run
Memcheck:Cond
obj:/usr/lib/libguile.so.12.3.0
fun:scm_c_hook_run
}
{
Guile GC scm_c_hook_run
Memcheck:Value4
obj:/usr/lib/libguile.so.12.3.0
fun:scm_c_hook_run
}
{
Guile GC uninitialised value of size 4 in scm_markstream
Memcheck:Value4
fun:scm_markstream
}
{
Guile GC (supposed) leak
Memcheck:Leak
fun:malloc
fun:scm_c_make_rstate
}
{
Guile GC newcell
Memcheck:Leak
fun:realloc
obj:/usr/lib/libguile.so.12.3.0
fun:scm_gc_for_newcell
}
{
Guile GC scm_add_to_port_table
Memcheck:Leak
fun:realloc
fun:scm_add_to_port_table
}
{
Guile GC scm_make_port_type
Memcheck:Leak
fun:realloc
fun:scm_make_port_type
obj:/usr/lib/libguile.so.12.3.0
}
{
<insert a suppression name here>
Memcheck:Leak
fun:realloc
fun:scm_must_realloc
fun:scm_c_make_subr
obj:/usr/lib/libguile.so.12.3.0
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
obj:/usr/lib/libguile.so.12.3.0
obj:/usr/lib/libguile.so.12.3.0
obj:/usr/lib/libguile.so.12.3.0
}
{
TLS Syscall param writev(vector[...]) contains uninitialised or
unaddressable byte(s)
Memcheck:Param
writev(vector[...])
obj:/lib/tls/libc-2.3.2.so
}
# library Leaks
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
fun:_X11TransOpenCOTSClient
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_XlcResolveLocaleName
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_XlcCreateLC
fun:_XlcDefaultLoader
fun:_XlcDynamicLoad
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
fun:XrmGetStringDatabase
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_XrmDefaultInitParseInfo
fun:_XrmInitParseInfo
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_X11TransConnectDisplay
fun:XOpenDisplay
fun:_ZN13x_display_repC1EiPPc
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
fun:realloc
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_XlcAddLoader
fun:_XlcInitLoader
fun:_XOpenLC
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_XOpenLC
fun:_XrmInitParseInfo
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/X11R6/lib/libX11.so.6.2
fun:_XlcCreateLC
fun:_XlcDefaultLoader
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
obj:/lib/tls/libdl-2.3.2.so
obj:/usr/lib/valgrind/libpthread.so
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/X11R6/lib/libX11.so.6.2
fun:XrmGetStringDatabase
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/lib/libXrender.so.1.2.2
fun:XRenderFindDisplay
fun:XRenderQueryExtension
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:XInitExtension
obj:/usr/lib/libXrender.so.1.2.2
fun:XRenderFindDisplay
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/X11R6/lib/libX11.so.6.2
fun:_X11TransConnect
fun:_X11TransConnectDisplay
}
{
<insert a suppression name here>
Memcheck:Leak
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
obj:/lib/tls/libc-2.3.2.so
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:XkbGetMap
obj:/usr/X11R6/lib/libX11.so.6.2
fun:XkbLookupKeySym
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:FT_New_Memory
fun:FT_Init_FreeType
fun:_Z13ft_initializev
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:_XcmsAddCmapRec
obj:/usr/X11R6/lib/libX11.so.6.2
fun:XcmsCCCOfColormap
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_dl_map_object_deps
obj:/lib/tls/libc-2.3.2.so
fun:_dl_catch_error
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
obj:/usr/X11R6/lib/libX11.so.6.2
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/lib/libguile.so.12.3.0
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:_XcmsInitScrnInfo
fun:XcmsDefaultCCC
fun:XcmsCreateCCC
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:XcmsCreateCCC
obj:/usr/X11R6/lib/libX11.so.6.2
fun:XcmsCCCOfColormap
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:_XcmsInitDefaultCCCs
fun:XcmsDefaultCCC
fun:XcmsCreateCCC
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:XAddExtension
fun:_XcursorGetDisplayInfo
fun:XcursorSupportsARGB
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/lib/ld-2.3.2.so
obj:/lib/ld-2.3.2.so
fun:_dl_map_object
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:XInitExtension
obj:/usr/lib/libXrender.so.1.2.2
fun:XRenderFindDisplay
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:XkbAllocClientMap
obj:/usr/X11R6/lib/libX11.so.6.2
fun:_XkbReadGetMapReply
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
obj:/usr/X11R6/lib/libX11.so.6.2
fun:XInternAtom
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_dl_map_object
obj:/lib/tls/libc-2.3.2.so
fun:_dl_catch_error
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/lib/libguile-ltdl.so.1.0.0
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:_dl_check_map_versions
obj:/lib/tls/libc-2.3.2.so
fun:_dl_catch_error
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:_XcursorGetDisplayInfo
fun:XcursorSupportsARGB
fun:XcursorNoticeCreateBitmap
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:XRenderQueryFormats
fun:XRenderQueryVersion
fun:_XcursorGetDisplayInfo
}
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
obj:/lib/ld-2.3.2.so
obj:/lib/ld-2.3.2.so
fun:_dl_map_object
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
obj:/usr/lib/libfreetype.so.6.3.5
fun:FT_Alloc
fun:FT_New_Library
}
# Valgrind leak?
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:get_or_allocate_specifics_ptr
fun:pthread_key_create
}
# TeXmacs leaks?
{
<insert a suppression name here>
Memcheck:Leak
fun:calloc
fun:XAllocClassHint
fun:_ZN12x_window_rep9set_hintsEiiii
fun:_ZN12x_window_rep10initializeEv
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:XStringListToTextProperty
fun:_ZN12x_window_rep9set_hintsEiiii
fun:_ZN12x_window_rep10initializeEv
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:XOpenDisplay
fun:_ZN13x_display_repC1EiPPc
fun:_Z12open_displayiPPc
}
{
<insert a suppression name here>
Memcheck:Leak
fun:malloc
fun:XCreateGC
fun:XOpenDisplay
fun:_ZN13x_display_repC1EiPPc
}
# TeXmacs uninitialized value?
{
Unitialized value in edit_env_rep::decode_length(string) (env_exec.cpp:1656)
Memcheck:Value8
fun:_ZN12edit_env_rep13decode_lengthE6string
}
Yours,
d.
--
David Mentré <address@hidden>
- [Texmacs-dev] Using Valgrind and first results,
David MENTRE <=