Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2591

valgrind: Writing uninitialized byte(s) (syscall from lmdb)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Higher
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.13.0
    • Component/s: None
    • Labels:
      None

      Description

      I get these errors running valgrind cf-agent on ubuntu 14.

      Policy:

      bundle agent main
      {
        reports:
      
          any::
      
            "Hello World!";
      
      }
      

      Valgrind output:

      20:17:33 client:vagrant core $ sudo valgrind --leak-check=full --track-origins=yes /var/cfengine/bin/cf-agent -f  /example.cf
      ==6640== Memcheck, a memory error detector
      ==6640== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
      ==6640== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
      ==6640== Command: /var/cfengine/bin/cf-agent -f /example.cf
      ==6640==
      ==6640== Syscall param pwrite64(buf) points to uninitialised byte(s)
      ==6640==    at 0x5A22D03: __pwrite_nocancel (syscall-template.S:81)
      ==6640==    by 0x670AD99: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x671402C: mdb_txn_commit (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x4E8F524: DBPrivCommit (dbm_lmdb.c:372)
      ==6640==    by 0x4E8E077: CloseDB (dbm_api.c:432)
      ==6640==    by 0x4EC0B23: CloseLock (locks.c:1170)
      ==6640==    by 0x4EC09DD: WriteLock (locks.c:1116)
      ==6640==    by 0x4EBED77: WaitForCriticalSection (locks.c:328)
      ==6640==    by 0x4EBFCF8: AcquireLock (locks.c:733)
      ==6640==    by 0x4EE0965: VerifyReportPromise (verify_reports.c:59)
      ==6640==    by 0x40E13E: KeepAgentPromise (cf-agent.c:1663)
      ==6640==    by 0x4EAC055: ExpandPromiseAndDo (expand.c:215)
      ==6640==  Address 0xb5fb032 is 1,522 bytes inside a block of size 4,096 alloc'd
      ==6640==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==6640==    by 0x670BB4C: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x670DF58: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x670E059: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x670FB33: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x67124FF: mdb_cursor_put (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x67148B9: mdb_put (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x4E8F8F1: DBPrivWrite (dbm_lmdb.c:475)
      ==6640==    by 0x4E8E2A1: WriteDB (dbm_api.c:491)
      ==6640==    by 0x4EBE644: WriteLockData (locks.c:158)
      ==6640==    by 0x4EBE6ED: WriteLockDataCurrent (locks.c:175)
      ==6640==    by 0x4EC09D1: WriteLock (locks.c:1114)
      ==6640==  Uninitialised value was created by a stack allocation
      ==6640==    at 0x4EBE6A1: WriteLockDataCurrent (locks.c:168)
      ==6640==
      ==6640== Syscall param writev(vector[...]) points to uninitialised byte(s)
      ==6640==    at 0x5D222C7: writev (writev.c:49)
      ==6640==    by 0x670AD2E: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x671402C: mdb_txn_commit (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x4E8F524: DBPrivCommit (dbm_lmdb.c:372)
      ==6640==    by 0x4E8E077: CloseDB (dbm_api.c:432)
      ==6640==    by 0x4EC0B23: CloseLock (locks.c:1170)
      ==6640==    by 0x4EC09DD: WriteLock (locks.c:1116)
      ==6640==    by 0x4EBFF92: AcquireLock (locks.c:801)
      ==6640==    by 0x4EE0965: VerifyReportPromise (verify_reports.c:59)
      ==6640==    by 0x40E13E: KeepAgentPromise (cf-agent.c:1663)
      ==6640==    by 0x4EAC055: ExpandPromiseAndDo (expand.c:215)
      ==6640==    by 0x4EAC27E: ExpandPromise (expand.c:283)
      ==6640==  Address 0xbe89bcb is 1,963 bytes inside a block of size 4,096 alloc'd
      ==6640==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==6640==    by 0x670BB4C: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x670DF58: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x670E059: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x670FB33: ??? (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x67124FF: mdb_cursor_put (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x67148B9: mdb_put (in /usr/lib/x86_64-linux-gnu/liblmdb.so.0.0.0)
      ==6640==    by 0x4E8F8F1: DBPrivWrite (dbm_lmdb.c:475)
      ==6640==    by 0x4E8E2A1: WriteDB (dbm_api.c:491)
      ==6640==    by 0x4EBE644: WriteLockData (locks.c:158)
      ==6640==    by 0x4EBE6ED: WriteLockDataCurrent (locks.c:175)
      ==6640==    by 0x4EC09D1: WriteLock (locks.c:1114)
      ==6640==  Uninitialised value was created by a stack allocation
      ==6640==    at 0x4EBE6A1: WriteLockDataCurrent (locks.c:168)
      ==6640==
      R: Hello World!
      ==6640==
      ==6640== HEAP SUMMARY:
      ==6640==     in use at exit: 85,043 bytes in 48 blocks
      ==6640==   total heap usage: 19,125 allocs, 19,077 frees, 74,440,242 bytes allocated
      ==6640==
      ==6640== LEAK SUMMARY:
      ==6640==    definitely lost: 0 bytes in 0 blocks
      ==6640==    indirectly lost: 0 bytes in 0 blocks
      ==6640==      possibly lost: 0 bytes in 0 blocks
      ==6640==    still reachable: 85,043 bytes in 48 blocks
      ==6640==         suppressed: 0 bytes in 0 blocks
      ==6640== Reachable blocks (those to which a pointer was found) are not shown.
      ==6640== To see them, rerun with: --leak-check=full --show-leak-kinds=all
      ==6640==
      ==6640== For counts of detected and suppressed errors, rerun with: -v
      ==6640== ERROR SUMMARY: 9 errors from 2 contexts (suppressed: 0 from 0)
      20:18:03 client:vagrant core $
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olehermanse Ole Herman Schumacher Elgesem
                Reporter:
                olehermanse Ole Herman Schumacher Elgesem
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel