[AWS] GNAT GPL 2011 + AWS = Boatload of leaks!

Thomas Løcke thomas.granvej6 at gmail.com
Wed Jun 22 16:06:15 CEST 2011


I've started building a small toolbox of packages for use in my
ongoing move from Apache/PHP to AWS. These packages rely, obviously,
heavily on AWS. So when GNAT GPL 2011 and AWS 2011 was released, I was
excited to see how things would pan out when compiling my code. As
expected, it all went flawlessly.

Except for two things:

    1. The executable of my test program went from 6.8mb to 7.5mb in size.
    2. valgrind reports _massive_ amounts of "possibly" leaks everywhere.

The leak reports look like this:

    ==13929== 48 bytes in 1 blocks are possibly lost in loss record 134 of 238
    ==13929==    at 0x4C283AD: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==13929==    by 0x7A4464: __gnat_malloc (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x7A9ACB: system__pool_global__allocate (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x774A7D:
ada__finalization__heap_management__allocate (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4E84C0:
templates_parser__data__parse__build.17726 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4E8983: templates_parser__data__parseX (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4EE908: templates_parser__load__parse.28246 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4EB9A1: templates_parser__load (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4FA11B: templates_parser__parse__4 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4FA395: templates_parser__parse__3 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x40ADB0: view__build_response__2 (view.adb:45)

and

    ==13929== 48 bytes in 1 blocks are possibly lost in loss record 141 of 238
    ==13929==    at 0x4C283AD: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==13929==    by 0x7A4464: __gnat_malloc (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x7A9ACB: system__pool_global__allocate (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x774A7D:
ada__finalization__heap_management__allocate (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4E7CBA:
templates_parser__expr__parse__term.19196 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4E7D0F:
templates_parser__expr__parse__relation.19198 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4E7E0E:
templates_parser__expr__parse__expr.19194 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4E7E89: templates_parser__expr__parseX (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4ED70A: templates_parser__load__parse.28246 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4EE93A: templates_parser__load__parse.28246 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4EDA58: templates_parser__load__parse.28246 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)
    ==13929==    by 0x4EE93A: templates_parser__load__parse.28246 (in
/home/thomas/Ada/yolk/demo/exe/yolk_demo)

All of them are related to Templates_Parser.

If I compile with GNAT GPL 2010 and AWS 2011, then all is well:
Executable size is down ~10% and there are no leak reports at all.
Well, except for the one relating to my earlier email
(AWS.Client.Send), which is reported no matter what version of GNAT
I'm using.

Am I the only one seeing this, and if so, should I be worried?

:o)
Thomas Løcke


More information about the AWS mailing list