Project

General

Profile

Actions

Bug #2108

closed

pfring: errors when compiled with asan/debug

Added by Peter Manev almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

Using the current git - Suricata version 4.0dev (rev 3ff5dc3)

when suri is compiled with debug/asan and pfring:

./autogen.sh &&  ./configure CC=clang CFLAGS="-ggdb3 -Werror -Wchar-subscripts -fno-strict-aliasing -fstack-protector-all -fsanitize=address -fno-omit-frame-pointer -Wno-unused-parameter -Wno-unused-function"  ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes  --enable-pfring --with-libpfring-includes=/usr/local/pfring/include --with-libpfring-libraries=/usr/local/pfring/lib --with-libnss-libraries=/usr/lib --with-libnss-includes=/usr/include/nss/ --with-libnspr-libraries=/usr/lib --with-libnspr-includes=/usr/include/nspr && make clean &&  make -j && make install

The following errs are observed:

runmode-pfring.c:121:35: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    if (ConfGet("pfring.threads", &threadsstr) != 1) {
                                  ^~~~~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
runmode-pfring.c:140:45: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    } else if (ConfGet("pfring.cluster-id", &tmpclusterid) != 1) {
                                            ^~~~~~~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
runmode-pfring.c:154:47: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    } else if (ConfGet("pfring.cluster-type", &tmpctype) != 1) {
                                              ^~~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
  CC       runmode-tile.o
runmode-pfring.c:242:70: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    if (ConfGetChildValueWithDefault(if_root, if_default, "threads", &threadsstr) != 1) {
                                                                     ^~~~~~~~~~~
./conf.h:88:109: note: passing argument to parameter 'vptr' here
int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr);
                                                                                                            ^
runmode-pfring.c:257:38: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    if (ConfGet("pfring.cluster-id", &tmpclusterid) == 1) {
                                     ^~~~~~~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
runmode-pfring.c:270:84: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        } else if (ConfGetChildValueWithDefault(if_root, if_default, "cluster-id", &tmpclusterid) != 1) {
                                                                                   ^~~~~~~~~~~~~
./conf.h:88:109: note: passing argument to parameter 'vptr' here
int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr);
                                                                                                            ^
runmode-pfring.c:282:31: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    if (ConfGet("bpf-filter", &bpf_filter) == 1) {
                              ^~~~~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
runmode-pfring.c:294:77: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        if (ConfGetChildValueWithDefault(if_root, if_default, "bpf-filter", &bpf_filter) == 1) {
                                                                            ^~~~~~~~~~~
./conf.h:88:109: note: passing argument to parameter 'vptr' here
int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr);
                                                                                                            ^
runmode-pfring.c:308:40: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    if (ConfGet("pfring.cluster-type", &tmpctype) == 1) {
                                       ^~~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
runmode-pfring.c:318:86: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        } else if (ConfGetChildValueWithDefault(if_root, if_default, "cluster-type", &tmpctype) != 1) {
                                                                                     ^~~~~~~~~
./conf.h:88:109: note: passing argument to parameter 'vptr' here
int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr);
                                                                                                            ^
runmode-pfring.c:343:78: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    if (ConfGetChildValueWithDefault(if_root, if_default, "checksum-checks", &tmpctype) == 1) {
                                                                             ^~~~~~~~~
./conf.h:88:109: note: passing argument to parameter 'vptr' here
int ConfGetChildValueWithDefault(const ConfNode *base, const ConfNode *dflt, const char *name, const char **vptr);
                                                                                                            ^
runmode-pfring.c:370:37: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    if (ConfGet("pfring.interface", &def_dev) != 1) {
                                    ^~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
runmode-pfring.c:380:39: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     ConfGet("pfring.live-interface", live_dev);
                                      ^~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
runmode-pfring.c:390:45: error: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
            if (ConfGet("pfring.interface", live_dev) == 1) {
                                            ^~~~~~~~
./conf.h:59:44: note: passing argument to parameter 'vptr' here
int ConfGet(const char *name, const char **vptr);
                                           ^
14 errors generated.
Makefile:1644: recipe for target 'runmode-pfring.o' failed
make[3]: *** [runmode-pfring.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/pevman/tests/git/oisf/src'
Makefile:1101: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/pevman/tests/git/oisf/src'
Makefile:479: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pevman/tests/git/oisf'
Makefile:409: recipe for target 'all' failed
make: *** [all] Error 2

Actions #1

Updated by Victor Julien almost 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Victor Julien
  • Target version set to 4.0beta1

This is the result of my compiler warning work. Hadn't tested pfring. Testing a fix.

Actions #2

Updated by Victor Julien almost 7 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF