HexHive / Gramatron

Coverage-guided grammar aware fuzzer that uses grammar automatons
Apache License 2.0
62 stars 5 forks source link

Error install with clang 12 #2

Open CityOfLight77 opened 2 years ago

CityOfLight77 commented 2 years ago

I got error when running setup.sh script. I'm on ubuntu 20.04 with clang 12

Here is the log

/usr/bin/ld: gramfuzz-helpers.o:(.bss+0x4): multiple definition of `curr_state'; gramfuzz.o:(.bss+0x8): first defined here
/usr/bin/ld: gramfuzz-helpers.o:(.bss+0x8): multiple definition of `final_state'; gramfuzz.o:(.bss+0xc): first defined here
/usr/bin/ld: gramfuzz-helpers.o:(.bss+0x0): multiple definition of `init_state'; gramfuzz.o:(.bss+0x4): first defined here
/usr/bin/ld: gramfuzz-helpers.o:(.bss+0xc): multiple definition of `numstates'; gramfuzz.o:(.bss+0x0): first defined here
/usr/bin/ld: gramfuzz-helpers.o:(.bss+0x10): multiple definition of `potential'; gramfuzz.o:(.bss+0x10): first defined here
/usr/bin/ld: gramfuzz-mutators.o:(.bss+0x0): multiple definition of `curr_state'; gramfuzz.o:(.bss+0x8): first defined here
/usr/bin/ld: gramfuzz-mutators.o:(.bss+0xc): multiple definition of `final_state'; gramfuzz.o:(.bss+0xc): first defined here
/usr/bin/ld: gramfuzz-mutators.o:(.bss+0x8): multiple definition of `init_state'; gramfuzz.o:(.bss+0x4): first defined here
/usr/bin/ld: gramfuzz-mutators.o:(.bss+0x4): multiple definition of `numstates'; gramfuzz.o:(.bss+0x0): first defined here
/usr/bin/ld: gramfuzz-mutators.o:(.bss+0x10): multiple definition of `potential'; gramfuzz.o:(.bss+0x10): first defined here
/usr/bin/ld: gramfuzz-util.o:(.bss+0x4): multiple definition of `curr_state'; gramfuzz.o:(.bss+0x8): first defined here
/usr/bin/ld: gramfuzz-util.o:(.bss+0x8): multiple definition of `final_state'; gramfuzz.o:(.bss+0xc): first defined here
/usr/bin/ld: gramfuzz-util.o:(.bss+0x0): multiple definition of `init_state'; gramfuzz.o:(.bss+0x4): first defined here
/usr/bin/ld: gramfuzz-util.o:(.bss+0xc): multiple definition of `numstates'; gramfuzz.o:(.bss+0x0): first defined here
/usr/bin/ld: gramfuzz-util.o:(.bss+0x10): multiple definition of `potential'; gramfuzz.o:(.bss+0x10): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [GNUmakefile:19: gramfuzz-mutator.so] Error 1
src/afl-fuzz-init.c:827:16: warning: variable 'nfn_aut_orig' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (src_id-- && s) {
               ^~~~~~~~~~~~~
src/afl-fuzz-init.c:876:18: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                 ^~~~~~~~~~~~
src/afl-fuzz-init.c:827:16: note: remove the condition if it is always true
        while (src_id-- && s) {
               ^~~~~~~~~~~~~
               1
src/afl-fuzz-init.c:827:16: warning: variable 'nfn_aut_orig' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
        while (src_id-- && s) {
               ^~~~~~~~
src/afl-fuzz-init.c:876:18: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                 ^~~~~~~~~~~~
src/afl-fuzz-init.c:827:16: note: remove the '&&' if its condition is always true
        while (src_id-- && s) {
               ^~~~~~~~~~~
src/afl-fuzz-init.c:824:11: warning: variable 'nfn_aut_orig' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/afl-fuzz-init.c:876:18: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                 ^~~~~~~~~~~~
src/afl-fuzz-init.c:824:7: note: remove the 'if' if its condition is always true
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/afl-fuzz-init.c:824:11: warning: variable 'nfn_aut_orig' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
          ^~~~~~~
src/afl-fuzz-init.c:876:18: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                 ^~~~~~~~~~~~
src/afl-fuzz-init.c:824:11: note: remove the '&&' if its condition is always true
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
          ^~~~~~~~~~
src/afl-fuzz-init.c:793:37: note: initialize the variable 'nfn_aut_orig' to silence this warning
    u8 *nfn, *nfn_aut, *nfn_aut_orig, *rsl = strrchr(q->fname, '/');
                                    ^
                                     = NULL
src/afl-fuzz-init.c:827:16: warning: variable 'nfn_aut' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
        while (src_id-- && s) {
               ^~~~~~~~~~~~~
src/afl-fuzz-init.c:876:32: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                               ^~~~~~~
src/afl-fuzz-init.c:827:16: note: remove the condition if it is always true
        while (src_id-- && s) {
               ^~~~~~~~~~~~~
               1
src/afl-fuzz-init.c:827:16: warning: variable 'nfn_aut' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
        while (src_id-- && s) {
               ^~~~~~~~
src/afl-fuzz-init.c:876:32: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                               ^~~~~~~
src/afl-fuzz-init.c:827:16: note: remove the '&&' if its condition is always true
        while (src_id-- && s) {
               ^~~~~~~~~~~
src/afl-fuzz-init.c:824:11: warning: variable 'nfn_aut' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/afl-fuzz-init.c:876:32: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                               ^~~~~~~
src/afl-fuzz-init.c:824:7: note: remove the 'if' if its condition is always true
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/afl-fuzz-init.c:824:11: warning: variable 'nfn_aut' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
          ^~~~~~~
src/afl-fuzz-init.c:876:32: note: uninitialized use occurs here
    link_or_copy(nfn_aut_orig, nfn_aut);
                               ^~~~~~~
src/afl-fuzz-init.c:824:11: note: remove the '&&' if its condition is always true
      if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
          ^~~~~~~~~~
src/afl-fuzz-init.c:793:22: note: initialize the variable 'nfn_aut' to silence this warning
    u8 *nfn, *nfn_aut, *nfn_aut_orig, *rsl = strrchr(q->fname, '/');
                     ^
                      = NULL
src/afl-fuzz-init.c:2435:23: warning: unused variable 'ii2' [-Wunused-variable]
    int arraylen, ii, ii2, trigger_len, error;
                      ^
src/afl-fuzz-init.c:2435:9: warning: unused variable 'arraylen' [-Wunused-variable]
    int arraylen, ii, ii2, trigger_len, error;
        ^
src/afl-fuzz-init.c:2435:41: warning: unused variable 'error' [-Wunused-variable]
    int arraylen, ii, ii2, trigger_len, error;
                                        ^
src/afl-fuzz-init.c:2461:20: warning: unused variable 'type' [-Wunused-variable]
    enum json_type type;
                   ^
12 warnings generated.
/usr/bin/ld: /tmp/afl-fuzz-queue-6039a0.o (symbol from plugin): in function `mark_as_det_done':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-queue-6039a0.o (symbol from plugin): in function `mark_as_det_done':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-queue-6039a0.o (symbol from plugin): in function `mark_as_det_done':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-queue-6039a0.o (symbol from plugin): in function `mark_as_det_done':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-queue-6039a0.o (symbol from plugin): in function `mark_as_det_done':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-cmplog-ac8f72.o (symbol from plugin): in function `cmplog_exec_child':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-cmplog-ac8f72.o (symbol from plugin): in function `cmplog_exec_child':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-cmplog-ac8f72.o (symbol from plugin): in function `cmplog_exec_child':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-cmplog-ac8f72.o (symbol from plugin): in function `cmplog_exec_child':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-cmplog-ac8f72.o (symbol from plugin): in function `cmplog_exec_child':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-one-dee6ed.o (symbol from plugin): in function `fuzz_one_original':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-one-dee6ed.o (symbol from plugin): in function `fuzz_one_original':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-one-dee6ed.o (symbol from plugin): in function `fuzz_one_original':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-one-dee6ed.o (symbol from plugin): in function `fuzz_one_original':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-one-dee6ed.o (symbol from plugin): in function `fuzz_one_original':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-python-e8ab8c.o (symbol from plugin): in function `finalize_py_module':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-python-e8ab8c.o (symbol from plugin): in function `finalize_py_module':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-python-e8ab8c.o (symbol from plugin): in function `finalize_py_module':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-python-e8ab8c.o (symbol from plugin): in function `finalize_py_module':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-python-e8ab8c.o (symbol from plugin): in function `finalize_py_module':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-mutators-69a20c.o (symbol from plugin): in function `setup_custom_mutators':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-mutators-69a20c.o (symbol from plugin): in function `setup_custom_mutators':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-mutators-69a20c.o (symbol from plugin): in function `setup_custom_mutators':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-mutators-69a20c.o (symbol from plugin): in function `setup_custom_mutators':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-mutators-69a20c.o (symbol from plugin): in function `setup_custom_mutators':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-stats-f6d207.o (symbol from plugin): in function `write_stats_file':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-stats-f6d207.o (symbol from plugin): in function `write_stats_file':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-stats-f6d207.o (symbol from plugin): in function `write_stats_file':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-stats-f6d207.o (symbol from plugin): in function `write_stats_file':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-stats-f6d207.o (symbol from plugin): in function `write_stats_file':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-state-2a3b9a.o (symbol from plugin): in function `afl_state_init':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-state-2a3b9a.o (symbol from plugin): in function `afl_state_init':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-state-2a3b9a.o (symbol from plugin): in function `afl_state_init':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-state-2a3b9a.o (symbol from plugin): in function `afl_state_init':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-state-2a3b9a.o (symbol from plugin): in function `afl_state_init':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-redqueen-d69bc7.o (symbol from plugin): in function `input_to_state_stage':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-redqueen-d69bc7.o (symbol from plugin): in function `input_to_state_stage':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-redqueen-d69bc7.o (symbol from plugin): in function `input_to_state_stage':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-redqueen-d69bc7.o (symbol from plugin): in function `input_to_state_stage':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-redqueen-d69bc7.o (symbol from plugin): in function `input_to_state_stage':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-init-9af367.o (symbol from plugin): in function `bind_to_free_cpu':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-init-9af367.o (symbol from plugin): in function `bind_to_free_cpu':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-init-9af367.o (symbol from plugin): in function `bind_to_free_cpu':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-init-9af367.o (symbol from plugin): in function `bind_to_free_cpu':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-init-9af367.o (symbol from plugin): in function `bind_to_free_cpu':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-fc19f1.o (symbol from plugin): in function `main':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-fc19f1.o (symbol from plugin): in function `main':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-fc19f1.o (symbol from plugin): in function `main':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-fc19f1.o (symbol from plugin): in function `main':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-fc19f1.o (symbol from plugin): in function `main':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-bitmap-6e8318.o (symbol from plugin): in function `write_bitmap':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-bitmap-6e8318.o (symbol from plugin): in function `write_bitmap':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-bitmap-6e8318.o (symbol from plugin): in function `write_bitmap':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-bitmap-6e8318.o (symbol from plugin): in function `write_bitmap':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-bitmap-6e8318.o (symbol from plugin): in function `write_bitmap':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-run-a32deb.o (symbol from plugin): in function `fuzz_run_target':
(.text+0x0): multiple definition of `init_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-run-a32deb.o (symbol from plugin): in function `fuzz_run_target':
(.text+0x0): multiple definition of `curr_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-run-a32deb.o (symbol from plugin): in function `fuzz_run_target':
(.text+0x0): multiple definition of `final_state'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-run-a32deb.o (symbol from plugin): in function `fuzz_run_target':
(.text+0x0): multiple definition of `numstates'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: /tmp/afl-fuzz-run-a32deb.o (symbol from plugin): in function `fuzz_run_target':
(.text+0x0): multiple definition of `potential'; /tmp/afl-fuzz-extras-1ec72d.o (symbol from plugin):(.text+0x0): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [GNUmakefile:387: afl-fuzz] Error 1
GNUmakefile:56: llvm_mode only supports llvm versions 3.4 up to 11
gramfuzz-util.c:116:12: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    strcpy(unparsed, term_ptr->symbol);
           ^~~~~~~~
/usr/include/string.h:122:39: note: passing argument to parameter '__dest' here
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
                                      ^
gramfuzz-util.c:120:16: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        strcat(unparsed, term_ptr->symbol);
               ^~~~~~~~
/usr/include/string.h:130:39: note: passing argument to parameter '__dest' here
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
                                      ^
gramfuzz-util.c:130:17: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    if (access (fn, F_OK) != -1) {
                ^~
/usr/include/unistd.h:287:32: note: passing argument to parameter '__name' here
extern int access (const char *__name, int __type) __THROW __nonnull ((1));
                               ^
gramfuzz-util.c:134:16: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    fp = fopen(fn, "wbx+");
               ^~
/usr/include/stdio.h:246:44: note: passing argument to parameter '__filename' here
extern FILE *fopen (const char *__restrict __filename,
                                           ^
gramfuzz-util.c:160:16: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    fp = fopen(fn, "rb");
               ^~
/usr/include/stdio.h:246:44: note: passing argument to parameter '__filename' here
extern FILE *fopen (const char *__restrict __filename,
                                           ^
5 warnings generated.
test.c:14:41: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    parsed_json = json_object_from_file(automaton_file);
                                        ^~~~~~~~~~~~~~
/usr/local/include/json-c/json_util.h:43:67: note: passing argument to parameter 'filename' here
JSON_EXPORT struct json_object* json_object_from_file(const char *filename);
                                                                  ^
test.c:86:29: warning: passing 'char *' to parameter of type 'u8 *' (aka 'unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    state* pda = create_pda(automaton_path);
                            ^~~~~~~~~~~~~~
test.c:6:23: note: passing argument to parameter 'automaton_file' here
state *create_pda(u8* automaton_file) {
                      ^
2 warnings generated.
/usr/bin/ld: /tmp/gramfuzz-mutators-064c8c.o:(.bss+0x0): multiple definition of `curr_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x4): first defined here
/usr/bin/ld: /tmp/gramfuzz-mutators-064c8c.o:(.bss+0xc): multiple definition of `final_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/gramfuzz-mutators-064c8c.o:(.bss+0x8): multiple definition of `init_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/gramfuzz-mutators-064c8c.o:(.bss+0x4): multiple definition of `numstates'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0xc): first defined here
/usr/bin/ld: /tmp/gramfuzz-mutators-064c8c.o:(.bss+0x10): multiple definition of `potential'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x10): first defined here
/usr/bin/ld: /tmp/gramfuzz-util-8a26e8.o:(.bss+0x4): multiple definition of `curr_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x4): first defined here
/usr/bin/ld: /tmp/gramfuzz-util-8a26e8.o:(.bss+0x8): multiple definition of `final_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/gramfuzz-util-8a26e8.o:(.bss+0x0): multiple definition of `init_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/gramfuzz-util-8a26e8.o:(.bss+0xc): multiple definition of `numstates'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0xc): first defined here
/usr/bin/ld: /tmp/gramfuzz-util-8a26e8.o:(.bss+0x10): multiple definition of `potential'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x10): first defined here
/usr/bin/ld: /tmp/test-b62e22.o:(.bss+0xc): multiple definition of `curr_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x4): first defined here
/usr/bin/ld: /tmp/test-b62e22.o:(.bss+0x0): multiple definition of `final_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/test-b62e22.o:(.bss+0x4): multiple definition of `init_state'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/test-b62e22.o:(.bss+0x8): multiple definition of `numstates'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0xc): first defined here
/usr/bin/ld: /tmp/test-b62e22.o:(.bss+0x10): multiple definition of `potential'; /tmp/gramfuzz-helpers-6f952d.o:(.bss+0x10): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [GNUmakefile:25: test] Error 1
prashast commented 2 years ago

Hmm, interesting, I haven't seen this issue before. I recently pushed some fixes to get it setup on 20.04. Can you try again and see if this issue still persists? I tested with 20.04 and Clang-10. There is a docker image with a setup for focal that you can get using the instructions here

CityOfLight77 commented 2 years ago

Hmm, interesting, I haven't seen this issue before. I recently pushed some fixes to get it setup on 20.04. Can you try again and see if this issue still persists? I tested with 20.04 and Clang-10. There is a docker image with a setup for focal that you can get using the instructions here

Now I can compile gramatron on ubuntu focal, thanks But I can't compile gramatron on newest AFL++ as custom mutator

...
...
[+] Json-c successfully prepared!
[+] Builing gramatron now.
gramfuzz.c:48:39: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
  parsed_json = json_object_from_file(automaton_file);
                                      ^~~~~~~~~~~~~~
./json-c/json_util.h:43:67: note: passing argument to parameter 'filename' here
JSON_EXPORT struct json_object* json_object_from_file(const char *filename);
                                                                  ^
gramfuzz.c:165:22: warning: passing 'char *' to parameter of type 'u8 *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
    pda = create_pda(automaton_file);
                     ^~~~~~~~~~~~~~
gramfuzz.c:38:23: note: passing argument to parameter 'automaton_file' here
state *create_pda(u8 *automaton_file) {
                      ^
gramfuzz.c:293:16: warning: passing 'const uint8_t *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    if (unlink(filename_new_queue)) {
               ^~~~~~~~~~~~~~~~~~
/usr/include/unistd.h:825:32: note: passing argument to parameter '__name' here
extern int unlink (const char *__name) __THROW __nonnull ((1));
                               ^
gramfuzz.c:300:15: warning: passing 'const uint8_t *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    fd = open(filename_new_queue, O_WRONLY | O_CREAT | O_TRUNC,
              ^~~~~~~~~~~~~~~~~~
/usr/include/fcntl.h:168:30: note: passing argument to parameter '__file' here
extern int open (const char *__file, int __oflag, ...) __nonnull ((1));
                             ^
4 warnings generated.
gramfuzz-util.c:161:10: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
  strcpy(unparsed, term_ptr->symbol);
         ^~~~~~~~
/usr/include/string.h:122:39: note: passing argument to parameter '__dest' here
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
                                      ^
gramfuzz-util.c:166:12: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    strcat(unparsed, term_ptr->symbol);
           ^~~~~~~~
/usr/include/string.h:130:39: note: passing argument to parameter '__dest' here
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
                                      ^
gramfuzz-util.c:180:14: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
  if (access(fn, F_OK) != -1) { return; }
             ^~
/usr/include/unistd.h:287:32: note: passing argument to parameter '__name' here
extern int access (const char *__name, int __type) __THROW __nonnull ((1));
                               ^
gramfuzz-util.c:182:14: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
  fp = fopen(fn, "wbx+");
             ^~
/usr/include/stdio.h:246:44: note: passing argument to parameter '__filename' here
extern FILE *fopen (const char *__restrict __filename,
                                           ^
gramfuzz-util.c:255:14: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
  fp = fopen(fn, "rb");
             ^~
/usr/include/stdio.h:246:44: note: passing argument to parameter '__filename' here
extern FILE *fopen (const char *__restrict __filename,
                                           ^
5 warnings generated.
/usr/bin/ld: ../../src/afl-performance.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
clang: error: linker command failed with exit code 1 (use -v to see invocation)