[AWS] Conditional jump or move depends on uninitialised value(s) when GZip'ing content - bug in AWS or?

Thomas Løcke thomas.granvej6 at gmail.com
Wed Mar 30 22:29:53 CEST 2011


I'm seeing some weird output from valgrind when using the latest AWS:

    ==31760== Thread 7:
    ==31760== Conditional jump or move depends on uninitialised value(s)
    ==31760==    at 0x672E60: longest_match (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x6744E0: deflate_slow (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x6738AF: deflate (in /home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x671F97: zlib__translate_auto (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x6725A9: zlib__translate_gzip (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x6727B6: zlib__translate (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x6727F6: zlib__flush (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x4FEC5E:
aws__resources__streams__memory__zlib__flush (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x4FECD7:
aws__resources__streams__memory__zlib__size (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x52DEE9:
aws__server__http_utils__send__send_data.13468 (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x52E343: aws__server__http_utils__send (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x5315B8:
aws__server__http_utils__answer_to_client (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==  Uninitialised value was created by a heap allocation
    ==31760==    at 0x4C26C8E: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==31760==    by 0x67536C: deflateInit2_ (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x67154B: zlib__thin__deflate_init (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x672AAA: zlib__deflate_init (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x52810B: aws__response__set__data_encoding (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x58F960: aws__response(bool, int __restrict,
long, double) (in /home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x447D54: view__syndication__generate
(view-syndication.adb:65)
    ==31760==    by 0x4CED4B:
aws__services__dispatchers__uri__dispatch__2 (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x530EE4:
aws__server__http_utils__answer_to_client__build_answer.8046 (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x53155E:
aws__server__http_utils__answer_to_client (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x4DBBCA: aws__server__protocol_handler (in
/home/thomas/Ada/Yolk/exe/yolk_demo)
    ==31760==    by 0x4DD124: aws__server__lineTB (in
/home/thomas/Ada/Yolk/exe/yolk_demo)

The offending code is this little snippet:

      if Is_Supported (Request, GZip) then
         Encoding := GZip;
      end if;

      return Build (Content_Type  => Text_XML,
                         Message_Body  => Get_XML_String (Feed),
                         Encoding      => Encoding);

If I get rid of the GZip part and just go with plain Identity, then
all is well. As soon is I GZip the content, the above output show up.

The string that is returned by Get_XML_String (Feed) is:

    <?xml version="1.0" encoding="utf-8"?>
    <feed base="/base_uri" lang="da" xmlns="http://www.w3.org/2005/Atom">
        <updated>2011-03-30T20:26:54Z</updated>
    </feed>

Nothing special.

I've tracked down the commit that brought about this problem/change:

This commit _DOES_ have the "bug":

    commit 2120bf7cf5f6c071ee9722a5e1a9184554922466
    Author: Pascal Obry <obry at adacore.com>
    Date:   Fri Mar 11 15:11:35 2011 +0100

        Always copy the static libz.

        This library is always built for AWS own use. We now install it to
        cover the case where the dynamic libz is installed in the OS but
        not the static version. If the OS static version is present it
        will be used anyway.

       Should fix K310-011.

This commit does _NOT_ have the "bug":

    commit 1915ca69cc73e29088cefe7cd615b28b7d5de1ba
    Author: Pascal Obry <obry at adacore.com>
    Date:   Fri Mar 11 14:20:53 2011 +0100

        Update 0208_cache_page_server test to pass on VxWorks.

        Part of J817-008.

Is this an AWS problem, or something else?

:o)
Thomas Løcke


More information about the AWS mailing list