Re: GtkFileChooserDialog and profilers



Jared Kells ha scritto lo scorso 28/10/2004 19:36:
I pasted the code you gave in your first email into an empty file. Compiled with cc main.c `pkg-config gtk+-2.0 --libs --cflags`
it worked fine. Running ./a.out produced a filechooser window.
Application ended when i closed it....

My gtk install may be slightly out of date its a farily old instalation
of debian sarge.
kared sasuke:~/gtk$ pkg-config gtk+-2.0 --modversion
2.4.3
kared sasuke:~/gtk$


So do I (gcc main.c `pkg-config gtk+-2.0 --libs --cflags` -g -O0, and the resulted a.out is perfectly running and doing what is intended for (i.e. nothing but showing a filechooser dialog).

Problems arise when I try to perform memory checks on it, by using valgrind or memprof. In case of valgrind, I got the following:

$ valgrind a.out
==2783== Memcheck, a memory error detector for x86-linux.
==2783== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==2783== Using valgrind-2.1.2, a program supervision framework for x86-linux.
==2783== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==2783== For more details, rerun with: -v
==2783==
==2783== Syscall param write(buf) contains uninitialised or unaddressable byte(s)
==2783==    at 0x1BE97F2E: write (in /lib/tls/libc-2.3.2.so)
==2783==    by 0x1BF589FE: _X11TransWrite (in /usr/X11R6/lib/libX11.so.6.2)
==2783==    by 0x1BF38261: (within /usr/X11R6/lib/libX11.so.6.2)
==2783==    by 0x1BF3990C: _XReply (in /usr/X11R6/lib/libX11.so.6.2)
==2783== Address 0x1C1C0D18 is 128 bytes inside a block of size 2048 alloc'd
==2783==    at 0x1B905901: calloc (vg_replace_malloc.c:176)
==2783==    by 0x1BF2A09C: XOpenDisplay (in /usr/X11R6/lib/libX11.so.6.2)
==2783== by 0x1BC23FE1: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.400.13) ==2783== by 0x1BC03BA5: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.400.13)
==2783==
==2783== Thread 2:
==2783== Conditional jump or move depends on uninitialised value(s)
==2783==    at 0x1C555A1E: thread_wrapper (vg_libpthread.c:836)
==2783==    by 0xB000FE6D: do__quit (vg_scheduler.c:1861)
==2783==
==2783== Thread 2:
==2783== Conditional jump or move depends on uninitialised value(s)
==2783==    at 0x1C555A31: thread_wrapper (vg_libpthread.c:839)
==2783==    by 0xB000FE6D: do__quit (vg_scheduler.c:1861)

** ERROR **: file linc-connection.c: line 544 (link_connection_do_initiate): assertion failed: (CNX_IS_LOCKED (0))
aborting...
==2783==
==2783== Process terminating with default action of signal 6 (SIGABRT)
==2783==    at 0x1BDF3201: kill (in /lib/tls/libc-2.3.2.so)
==2783==    by 0x1B8FEC2D: gsignal (vg_intercept.c:93)
==2783==    by 0x1BDF4780: abort (in /lib/tls/libc-2.3.2.so)
==2783==    by 0x1BD74B93: g_log (in /usr/lib/libglib-2.0.so.0.400.7)
==2783==
==2783== ERROR SUMMARY: 4 errors from 3 contexts (suppressed: 185 from 1)
==2783== malloc/free: in use at exit: 477395 bytes in 10591 blocks.
==2783== malloc/free: 16971 allocs, 6380 frees, 835215 bytes allocated.
==2783== For a detailed leak analysis,  rerun with: --leak-check=yes
==2783== For counts of detected errors, rerun with: -v
Abortito

Any clue?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]