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

Segfault in cf-promises policy parsing (afl)

    XMLWordPrintable

    Details

      Description

      root@ip-172-31-44-144 ~ $ cf-promises test.cf 
      Segmentation fault (core dumped)
      root@ip-172-31-44-144 ~ $ ls
      afl  afl_inputs  afl_output  afl_outputs  afl_output.tgz  core	test.cf
      root@ip-172-31-44-144 ~ $ gdb /var/cfengine/bin/cf-promises core
      GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
      Copyright (C) 2018 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
      and "show warranty" for details.
      This GDB was configured as "x86_64-linux-gnu".
      Type "show configuration" for configuration details.
      For bug reporting instructions, please see:
      <http://www.gnu.org/software/gdb/bugs/>.
      Find the GDB manual and other documentation resources online at:
      <http://www.gnu.org/software/gdb/documentation/>.
      For help, type "help".
      Type "apropos word" to search for commands related to "word"...
      Reading symbols from /var/cfengine/bin/cf-promises...done.
      [New LWP 21079]
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
      Core was generated by `cf-promises test.cf'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  _int_malloc (av=av@entry=0x7f2d1c863c40 <main_arena>, bytes=bytes@entry=11) at malloc.c:3779
      3779	malloc.c: No such file or directory.
      (gdb) bt
      #0  _int_malloc (av=av@entry=0x7f2d1c863c40 <main_arena>, bytes=bytes@entry=11) at malloc.c:3779
      #1  0x00007f2d1c50f0fc in __GI___libc_malloc (bytes=bytes@entry=11) at malloc.c:3057
      #2  0x00007f2d1c5159ba in __GI___strdup (s=s@entry=0x55e49f4b5890 " reports:\n") at strdup.c:42
      #3  0x00007f2d1cc3a501 in xstrdup (str=str@entry=0x55e49f4b5890 " reports:\n") at alloc.c:58
      #4  0x00007f2d1cad77d0 in yylex () at cf3lex.l:388
      #5  0x00007f2d1cacd3aa in yyparse () at cf3parse.c:1325
      #6  0x00007f2d1cbde9c5 in ParserParseFile (agent_type=<optimized out>, path=path@entry=0x55e49f46b350 "test.cf", warnings=268435455, warnings_error=0) at parser.c:130
      #7  0x00007f2d1cb9f9fe in Cf3ParseFile (config=config@entry=0x55e49f46b260, input_path=input_path@entry=0x55e49f46b350 "test.cf") at loading.c:135
      #8  0x00007f2d1cb9ff24 in LoadPolicyFile (ctx=ctx@entry=0x55e49f46b390, config=config@entry=0x55e49f46b260, policy_file=0x55e49f46b350 "test.cf", policy_files_hashes=policy_files_hashes@entry=0x55e49f4b4720, 
          parsed_files_checksums=parsed_files_checksums@entry=0x55e49f4b5620, failed_files=failed_files@entry=0x55e49f4b5780) at loading.c:342
      #9  0x00007f2d1cba1e5b in LoadPolicy (ctx=0x55e49f46b390, config=0x55e49f46b260) at loading.c:502
      #10 0x000055e49e5749a1 in main (argc=2, argv=0x7ffe84326958) at cf-promises.c:139
      (gdb) 

        Attachments

        1. afl_output.tgz
          1.47 MB
        2. test.cf
          0.2 kB

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel