From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7e55e7403c5154a3,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.98 with SMTP id wh2mr9103576pbc.7.1337241047223; Thu, 17 May 2012 00:50:47 -0700 (PDT) Path: pr3ni8290pbb.0!nntp.google.com!news2.google.com!goblin3!goblin.stu.neva.ru!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Windows 7, MinGW, GNAT, mysterious problem Date: Thu, 17 May 2012 09:50:40 +0200 Organization: cbb software GmbH Message-ID: <13h8n68f1p7vb.1nhqipf6bkgpu$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 4RFYTQ6jM/dAKFJoI0fUkg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-05-17T09:50:40+02:00 List-Id: There seems to be some very weird problem which I cannot identify. Maybe somebody familiar with MinGW and GNAT/GCC innards can shed some light. It started as a GtkAda problem, but now I am not sure if it really is. So I reduced the sample code which originally was Ada to bare C in order to exclude any Ada/C calling issues. The code: ------------------------- test.c ------------------------- #include #include const gchar *test = "Test"; GtkVBox *vbox; GtkWindow *win; gboolean Timer (gpointer user_data) { gtk_widget_queue_draw (GTK_WIDGET (vbox)); return 1; } int main(int argc, char **argv) { gtk_init(&argc, &argv); win = (GtkWindow*)gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(win, test); vbox = (GtkVBox*)gtk_vbox_new(TRUE, 1); gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(vbox)); g_timeout_add (200, Timer, 0); gtk_widget_show_all(GTK_WIDGET(win)); gtk_main(); return 0; } -------------------------------------------------------------------- The project file: ------------- test.gpr ------------------------------------------ with "gtkada.gpr"; project Test is for Languages use ("C"); for Main use ("test.c"); for Source_Files use ("test.c"); for Exec_Dir use "."; package Compiler is for Default_Switches ("c") use ("-mms-bitfields", "-I../../lib/gtk-2.0/include", "-I../../lib/gdk-2.0/include", "-I../../lib/glib-2.0/include", "-I../../include", "-I../../include/atk-1.0", "-I../../include/gdk-pixbuf-2.0", "-I../../include/cairo", "-I../../include/pango-1.0", "-I../../include/gio-win32-2.0", "-I../../include/glib-2.0", "-I../../include/gtk-2.0", "-g"); end Compiler; package Linker is for Default_Switches ("c") use Gtkada.Linker'Default_Switches ("c") & "-g" & "-mwindows"; end Linker; end Test; -------------------------------------------------------------------- The program opens a window with a single box inside it and periodically (200ms) calls gtk_widget_queue_draw on that box. The GTK implementation of queue draw is, as far I can understand their code, basically invalidating the window region for later refresh. It was tested with the newest Windows GTK version 2.24.10, various GNAT compilers (up to GNAT PRO 7.0.1), no difference. Now the problem. 1. When compiled under Windows 7 64-bit, statically or dynamically linked, the resulted program leaks. Slowly but steadily as the task manager shows. 2. When compiled under Windows XP 32- or 64-bit it does not leak. 3. An executable built on Windows XP and linked statically does not leak when run under Windows 7. Dynamically linked executable leaks. 4. The most puzzling part is that when compiled under Windows XP 32 running on a Windows 7 VirtualBox it leaks! (I didn't checked all possible combinations because I have no access to all platforms) Any ideas? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de