Running gnat-gps under valgrind revealed many, many errors. One
seemed related to #400876 and #400883, which I was investigating at
the time; it looked like a double deallocation problem:
==25342== Address 0x9F3D820 is 48 bytes inside a block of size 840 free'd
==25342== at 0x4A1B46D: free (vg_replace_malloc.c:233)
==25342== by 0x435A39: __gnat_free (s-memory.adb:82)
==25342== by 0x70929A: vfs__unchecked_free (vfs.adb:458)
==25342== by 0x6F4A7C: directory_tree__read_directory
(directory_tree.adb:1161)
==25342== by 0x6F3A13: directory_tree__read_directory
(directory_tree.adb:1115)
==25342== by 0x6F7869: directory_tree__file_append_directory
(directory_tree.adb:1309)
==25342== by 0x6FD1F2: directory_tree__refresh (directory_tree.adb:1713)
==25342== by 0x6F8F61: directory_tree__initialize (directory_tree.adb:1434)
==25342== by 0x6F81AF: directory_tree__gtk_new (directory_tree.adb:1368)
Removing just the call to VFS.Unchecked_Free which triggers the error
solves only part of the problem, as GPS hangs when I click on OK or
Close in the file selector.
Turning VFS.Unchecked_Free into a no-op introduces memory leaks, but
makes the problems described in both bugs disappear. That's what the
patch below does.
Kevin, could you please try it and report back? I don't think this
patch solves the problem, it just prevents it from being triggered.
--
Ludovic Brenta.
Index: common/src/vfs.adb
===================================================================
--- common/src/vfs.adb.orig 2006-11-29 15:42:12.723222000 +0100
+++ common/src/vfs.adb 2006-11-29 15:42:54.917859250 +0100
@@ -452,10 +452,8 @@
--------------------
procedure Unchecked_Free (Arr : in out File_Array_Access) is
- procedure Internal is new Ada.Unchecked_Deallocation
- (File_Array, File_Array_Access);
begin
- Internal (Arr);
+ null;
end Unchecked_Free;
---------------------
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]