[gtkada] memory allocation problems in Gtkada 3.4.2?

Rob Groen robgr at xs4all.nl
Thu Mar 20 18:14:06 CET 2014


 

Hello, 

I am using Gtkada on WinXP 

In Gtkada 2.24.2 I had an application that took as input a list of Gtk
widget names, like "GtkLabel", "GtkNotebook" etc. The application does a
sort of Object introspection. The application created
Glib.Object.Gobjects, using 

 function Widget_New (T : Glib.Gtype) return System.Address; 

 pragma Import (C, Widget_New, "ada_g_object_new"); 

 function Get_Type_Button return Glib.Gtype; 

 pragma Import (C, Get_Type_Button, "gtk_button_get_type"); 

 Widget := Widget_New (Get_Type_Button); 

 Object := new Gobject_Record; 

 Set_Object (Object, Widget); 

It then queried the created object for its parent types, its properties
and its signals. This was done for a large number of Gtk widgets, i.e.
the ones that derive from Gobject_Record, that are not interfaces and
that have a Gtk_New method. I programmed it this way because I don't
want to "with" all the required Gtk.xxx packages, to tedious and
inflexible. In Gtkada 2.24.2 this all works well. 

In Gtkada 3.4.2, however, this application crashes all over the place.
If I add debug statements, the place were it crashes changes time and
again. A catch all exception handler is not called. If I run the
application in de GPS debugger, the debugger seems to hang, until I
forcefully close the DOS-box. Then a segmentation violation is visible
and the folowing lines in the stack trace are repeat umpteen times: 

 27 0x0051d764 <__gnat_raise_exception> (e=0x53c8cc <storage_error>,
message=...) a-except.adb:982
 28 0x0051f489 system.memory.check_available_memory ()
 29 0x0051f523 __gnat_malloc ()
 30 0x0051ca78 ada.exceptions.exception_propagation.allocate_occurrence
() a-exexpr.adb:310
<...>
 489 0x0051f523 __gnat_malloc ()
 490 0x0051ca78 ada.exceptions.exception_propagation.allocate_occurrence
() a-exexpr.adb:310
 491 0x0051d764 <__gnat_raise_exception> (e=0x53c8cc <storage_error>,
message=...) a-except.adb:982
 492 0x0051f489 system.memory.check_available_memory ()
 493 0x0051f523 __gnat_malloc ()
 494 0x0051ca78 ada.exceptions.exception_propagation.allocate_occurrence
() a-exexpr.adb:310
 495 0x0051d764 <__gnat_raise_exception> (e=0x53c8cc <storage_error>,
message=...) a-except.adb:982
 496 0x0051f489 system.memory.check_available_memory ()
 497 0x0051f523 __gnat_malloc ()
 498 0x0051ca78 ada.exceptions.exception_propagation.allocate_occurrence
() a-exexpr.adb:310 

Has the use of the imported functions changed? Is there another way of
achieving the same functionality (without using "with Gtk.<...>"), or is
it a bug? 

Best regards Rob Groen 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20140320/711ad2e6/attachment.html>


More information about the gtkada mailing list