help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.1.17 cfservd.c connection memory leak


From: Joe Buehler
Subject: Re: 2.1.17 cfservd.c connection memory leak
Date: Thu, 22 Dec 2005 16:50:31 -0500
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Mark Burgess wrote:

> Ah - I did find something. It could be a public key...

I just posted the things that look like obvious problems in
cfengine code.  There are lots of others that need some more
investigation -- but I'm leaving in a bit for a 2 week vacation,
so it will have to wait a bit.

Here are some leaks in cfagent if you want to fix them:

\"/home/project-releases/tmp/cfengine-2.1.17/src/parse.c\", line 1345:
(LEAK_ASSIGN)
>> VREPOSITORY = strdup(ebuff);

  Memory leaked due to pointer reassignment.

  Lost block : 0x200f4b18 thru 0x200f4b18 (1 byte)
               block allocated in strdup.c
                          malloc()  (interface)
                          strdup()
../../../../../../../src/bos/usr/ccs/lib/libc/strdup.c
                          strdup()  (interface)
                      Initialize()  cfagent.c, 218
                            main()  cfagent.c, 81
                         __start()  crt0main.s

  Stack trace where the error occurred:
                   SetRepository()  parse.c, 1345
            InstallControlRValue()  install.c, 198
                           yylex()  cflex.l, 474
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 101
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/install.c\", line 3987:
(LEAK_SCOPE)
>> InitializeAction();

  Memory leaked leaving scope: malloc(sizeof(struct TwoDimList))

  Lost block : 0x200e7958 thru 0x200e796b (20 bytes)
               malloc(sizeof(struct TwoDimList)), allocated at 2Dlist.c, 254
                          malloc()  (interface)
                AppendTwoDimItem()  2Dlist.c, 254
        Build2DListFromVarstring()  2Dlist.c, 146
                 InstallMakePath()  install.c, 3891
                  InstallPending()  install.c, 2548
                           yylex()  cflex.l, 191
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 101
                         __start()  crt0main.s

  Stack trace where the error occurred:
                 InstallMakePath()  install.c, 3987
                  InstallPending()  install.c, 2548
                           yylex()  cflex.l, 191
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 101
                         __start()  crt0main.s


\"/home/project-releases/tmp/cfengine-2.1.17/src/parse.c\", line 148:
(LEAK_ASSIGN)
>>  PKGVER = (char *) malloc(CF_BUFSIZE);

  Memory leaked due to pointer reassignment: PKGVER

  Lost block : 0x20139a88 thru 0x2013aa87 (4096 bytes)
               PKGVER, allocated at parse.c, 148
                          malloc()  (interface)
                       NewParser()  parse.c, 148
                  ParseInputFile()  parse.c, 57
                            main()  cfagent.c, 101
                         __start()  crt0main.s

  Stack trace where the error occurred:
                       NewParser()  parse.c, 148
                GetRemoteMethods()  image.c, 51
                  ParseInputFile()  parse.c, 114
                            main()  cfagent.c, 101
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/client.c\", line 417:
(LEAK_FREE)
>>    free(ip->cache);

  Memory leaked freeing block.

  Lost block : 0x200e2b38 thru 0x200e2b6b (52 bytes)
               block allocated in strdup.c
                          malloc()  (interface)
                          strdup()
../../../../../../../src/bos/usr/ccs/lib/libc/strdup.c
                          strdup()  (interface)
                        cf_rstat()  client.c, 277
                          cfstat()  image.c, 1342
                      MakeImages()  do.c, 2458
                          DoTree()  cfagent.c, 1267
                            main()  cfagent.c, 107
                         __start()  crt0main.s

  Stack trace where the error occurred:
                            free()  (interface)
                FlushClientCache()  client.c, 417
                      CheckImage()  image.c, 584
                      MakeImages()  do.c, 2506
                          DoTree()  cfagent.c, 1267
                            main()  cfagent.c, 107
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/do.c\", line 2626:
(LEAK_SCOPE)
>> for (pp = VPROCLIST; pp != NULL; pp=pp->next)

  Memory leaked leaving scope: malloc(sizeof(struct Item))

  Lost block : 0x200e2c18 thru 0x200e2c37 (32 bytes)
               malloc(sizeof(struct Item)), allocated at item.c, 316
                          malloc()  (interface)
                      AppendItem()  item.c, 316
                LoadProcessTable()  process.c, 62
                  CheckProcesses()  do.c, 2620
                          DoTree()  cfagent.c, 1287
                            main()  cfagent.c, 107
                         __start()  crt0main.s

  Stack trace where the error occurred:
                  CheckProcesses()  do.c, 2626
                          DoTree()  cfagent.c, 1287
                            main()  cfagent.c, 107
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/install.c\", line 1802:
(LEAK_SCOPE)
>> for (ip = list; ip != NULL; ip=ip->next)

  Memory leaked leaving scope: malloc(sizeof(struct Item))

  Lost block : 0x20105d78 thru 0x20105d97 (32 bytes)
               malloc(sizeof(struct Item)), allocated at item.c, 316
                          malloc()  (interface)
                      AppendItem()  item.c, 316
           SplitStringAsItemList()  item.c, 1138
                AppendNameServer()  install.c, 1800
                  InstallPending()  install.c, 2513
                           yylex()  cflex.l, 458
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 140
                         __start()  crt0main.s

  Stack trace where the error occurred:
                AppendNameServer()  install.c, 1802
                  InstallPending()  install.c, 2513
                           yylex()  cflex.l, 458
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 140
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/parse.c\", line 1250:
(LEAK_ASSIGN)
>>  VEXCLUDEPARSE = NULL;

  Memory leaked due to pointer reassignment: malloc(sizeof(struct Item))

  Lost block : 0x20105328 thru 0x20105347 (32 bytes)
               malloc(sizeof(struct Item)), allocated at item.c, 226
                          malloc()  (interface)
                     PrependItem()  item.c, 226
     HandleOptionalTidyAttribute()  install.c, 1001
                    HandleOption()  parse.c, 935
                           yylex()  cflex.l, 437
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 140
                         __start()  crt0main.s

  Stack trace where the error occurred:
                InitializeAction()  parse.c, 1250
                 InstallTidyPath()  install.c, 5924
                 InstallTidyItem()  install.c, 3863
                  InstallPending()  install.c, 2544
                           yylex()  cflex.l, 458
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 140
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/parse.c\", line 1254:
(LEAK_ASSIGN)
>>  VFILTERBUILD = NULL;

  Memory leaked due to pointer reassignment: malloc(sizeof(struct Item))

  Lost block : 0x200e8b28 thru 0x200e8b47 (32 bytes)
               malloc(sizeof(struct Item)), allocated at item.c, 226
                          malloc()  (interface)
                     PrependItem()  item.c, 226
     HandleOptionalTidyAttribute()  install.c, 1052
                    HandleOption()  parse.c, 935
                           yylex()  cflex.l, 437
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 140
                         __start()  crt0main.s

  Stack trace where the error occurred:
                InitializeAction()  parse.c, 1254
                 InstallTidyPath()  install.c, 5924
                 InstallTidyItem()  install.c, 3863
                  InstallPending()  install.c, 2544
                           yylex()  cflex.l, 458
                         yyparse()  bison.simple, 432
                       ParseFile()  parse.c, 1051
                  ParseInputFile()  parse.c, 82
                            main()  cfagent.c, 140
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/cfagent.c\", line 828:
(LEAK_ASSIGN)
>> VCANONICALFILE = strdup(CanonifyName(VINPUTFILE));

  Memory leaked due to pointer reassignment.

  Lost block : 0x200e23d8 thru 0x200e23e4 (13 bytes)
               block allocated in strdup.c
                          malloc()  (interface)
                          strdup()
../../../../../../../src/bos/usr/ccs/lib/libc/strdup.c
                          strdup()  (interface)
            CheckSystemVariables()  cfagent.c, 828
                            main()  cfagent.c, 103
                         __start()  crt0main.s

  Stack trace where the error occurred:
            CheckSystemVariables()  cfagent.c, 828
                            main()  cfagent.c, 174
                         __start()  crt0main.s

\"/home/project-releases/tmp/cfengine-2.1.17/src/cfagent.c\", line 1008:
(LEAK_ASSIGN)
>>    CHECKSUMDB = strdup(ebuff);

  Memory leaked due to pointer reassignment.

  Lost block : 0x200e2b08 thru 0x200e2b21 (26 bytes)
               block allocated in strdup.c
                          malloc()  (interface)
                          strdup()
../../../../../../../src/bos/usr/ccs/lib/libc/strdup.c
                          strdup()  (interface)
            CheckSystemVariables()  cfagent.c, 1008
                            main()  cfagent.c, 103
                         __start()  crt0main.s

  Stack trace where the error occurred:
            CheckSystemVariables()  cfagent.c, 1008
                            main()  cfagent.c, 174
                         __start()  crt0main.s

-- 
Joe Buehler





reply via email to

[Prev in Thread] Current Thread [Next in Thread]