Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with omhttp enabled #5357

Open
ftapajos opened this issue Apr 8, 2024 · 1 comment
Open

Compilation error with omhttp enabled #5357

ftapajos opened this issue Apr 8, 2024 · 1 comment

Comments

@ftapajos
Copy link
Contributor

ftapajos commented Apr 8, 2024

Expected behavior

rsyslog should compile with omhttp enabled

Actual behavior

Compilation error:

In file included from ../../runtime/prop.h:25,
                 from ../../runtime/glbl.h:38,
                 from ../../runtime/stream.h:75,
                 from ../../runtime/obj.h:48,
                 from ../../runtime/rsyslog.h:764,
                 from omhttp.c:27:
omhttp.c: In function 'newActInst':
omhttp.c:2308:61: error: 'instanceData' {aka 'struct instanceConf_s'} has no member named 'mutHttpRequestsTimeMs'; did you mean 'httpRequestsTimeMs'?
 2308 |         STATSCOUNTER_INIT(pData->httpRequestsTimeMs, pData->mutHttpRequestsTimeMs);
      |                                                             ^~~~~~~~~~~~~~~~~~~~~
../../runtime/atomic.h:261:65: note: in definition of macro 'INIT_ATOMIC_HELPER_MUT64'
  261 | #       define INIT_ATOMIC_HELPER_MUT64(x) pthread_mutex_init(&(x), NULL)
      |                                                                 ^
omhttp.c:2308:9: note: in expansion of macro 'STATSCOUNTER_INIT'
 2308 |         STATSCOUNTER_INIT(pData->httpRequestsTimeMs, pData->mutHttpRequestsTimeMs);
      |         ^~~~~~~~~~~~~~~~~

Steps to reproduce the behavior

Compiling with the settings:

rsyslog will be compiled with the following settings:
    Large file support enabled:               yes
    Networking support enabled:               yes
    Regular expressions support enabled:      yes
    rsyslog runtime will be built:            yes
    rsyslogd will be built:                   yes
    have to generate man pages:               no
    Unlimited select() support enabled:       no
    uuid support enabled:                     no
    Log file signing support via KSI LS12:    no
    Log file encryption support:              no
    Log file compression via zstd support:    no
    anonymization support enabled:            yes
    message counting support enabled:         no
    liblogging-stdlog support enabled:        no
    libsystemd enabled:                       no
    kafka static linking enabled:             no
    qpid proton static linking enabled:       no
    atomic operations enabled:                yes
    libcap-ng support enabled:                no
---{ input plugins }---
    Klog functionality enabled:               yes (linux)
configure: WARNING: unrecognized options: --disable-gtk-doc, --disable-gtk-doc-html, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop, --enable-ipv6, --disable-nls
    /dev/kmsg functionality enabled:          no
    plain tcp input module enabled:           yes
    DTLS udp input module enabled:            no
    imdiag enabled:                           yes
    file input module enabled:                yes
    docker log input module enabled:          yes
    Solaris input module enabled:             no
    periodic statistics module enabled:       yes
    imczmq input module enabled:              no
    imjournal input module enabled:           no
    imbatchreport input module enabled:       no
    imkafka module will be compiled:          no
    impcap input module enabled:              no
    imtuxedoulog module will be compiled:     no
    improg input module enabled:              no
    imhttp input module enabled:              no
    imhiredis input module enabled:           no
---{ output plugins }---
    Mail support enabled:                     yes
    omfile-hardened module will be compiled:  no
    omprog module will be compiled:           yes
    omstdout module will be compiled:         yes
    omjournal module will be compiled:        no
    omhdfs module will be compiled:           no
    omelasticsearch module will be compiled:  yes
    omclickhouse module will be compiled:     yes
    omhttp module will be compiled:           yes
    omruleset module will be compiled:        yes
    omudpspoof module will be compiled:       no
    omuxsock module will be compiled:         yes
    omczmq module will be compiled:           no
    omrabbitmq module will be compiled:       no
    omhttpfs module will be compiled:         yes
    omamqp1 module will be compiled:          no
    omtcl module will be compiled:            no
    omkafka module will be compiled:          no
    omhiredis module will be compiled:        no
    omazureeventhubs module will be compiled: no
    omdtls module will be compiled:           no
---{ parser modules }---
    pmlastmsg module will be compiled:        yes
    pmcisconames module will be compiled:     yes
    pmciscoios module will be compiled:       yes
    pmnull module will be compiled:           no
    pmnormalize module will be compiled:      no
    pmaixforwardedfrom module w.be compiled:  yes
    pmsnare module will be compiled:          yes
    pmdb2diag module will be compiled:        no
    pmpanngfw module will be compiled:        no
---{ message modification modules }---
    mmnormalize module will be compiled:      no
    mmjsonparse module will be compiled:      yes
    mmgrok module will be compiled:           no
    mmjaduit module will be compiled:         yes
    mmsnmptrapd module will be compiled:      no
    mmutf8fix enabled:                        yes
    mmrfc5424addhmac enabled:                 no
    mmpstrucdata enabled:                     yes
    mmsequence enabled:                       yes
    mmdblookup enabled:                       no
    mmdarwin enabled:                         no
    mmfields enabled:                         yes
    mmrm1stspace module enabled:              no
    mmkubernetes enabled:                     no
    mmtaghostname enabled:                    no
---{ database support }---
    MySql support enabled:                    no
    libdbi support enabled:                   yes
    PostgreSQL support enabled:               no
    mongodb support enabled:                  no
    hiredis support enabled:                  no
---{ protocol support }---
    openssl network stream driver enabled:    no
    GnuTLS network stream driver enabled:     no
    GSSAPI Kerberos 5 support enabled:        no
    RELP support enabled:                     no
    SNMP support enabled:                     no
---{ function modules }---
    fmhttp enabled:                           yes
    fmhash enabled:                           yes
    fmhash with xxhash enabled:               no
    fmunflatten enabled:                      no
    ffaup enabled:                            no
---{ debugging support }---
    distcheck workaround enabled:             no
    Testbench enabled:                        no
    valgrind tests enabled:                   
    valgrind helgrind tests enabled:          yes
    Default tests enabled:                    yes
    Testbench libfaketime tests enabled:      no
    Extended Testbench enabled:               no
    MySQL Tests enabled:                      no
    Elasticsearch Tests:                      no
    ClickHouse Tests:                         no
    PostgreSQL Tests enabled:                 no
    Kafka Tests enabled:                      no
    Redis Tests enabled:                      no
    Omazureeventhubs Tests enabled:           no
    Imdocker Tests enabled:                   no
    gnutls tests enabled:                     no
    imfile tests enabled:                     yes
    systemd journal tests enabled:            no
    SNMP Tests enabled:                       no
    Debug mode enabled:                       no
    (total) debugless mode enabled:           no
    Diagnostic tools enabled:                 no
    End-User tools enabled:                   no
    Valgrind support settings enabled:        no

Environment

  • rsyslog version: 8.2404.0
  • platform: buildroot

a67af36 from #5302 introduced typos that prevent proper compilation. In order to compile properly, the following patch should be applied, I cannot test this changes, since I am not using this module. It is only enabled by the design of the distribution I am using

diff --git a/contrib/omhttp/omhttp.c b/contrib/omhttp/omhttp.c
index 14b98c17b..e3503221f 100644
--- a/contrib/omhttp/omhttp.c
+++ b/contrib/omhttp/omhttp.c
@@ -163,7 +163,7 @@ typedef struct instanceConf_s {
 	statsobj_t *stats;
 	STATSCOUNTER_DEF(ctrHttpRequestsCount, mutCtrHttpRequestsCount); // Number of attempted HTTP requests
 	STATSCOUNTER_DEF(httpRequestsBytes, mutHttpRequestsBytes);
-	STATSCOUNTER_DEF(httpRequestsTimeMs, muthttphttpRequestsTimeMs);
+	STATSCOUNTER_DEF(httpRequestsTimeMs, mutHttpRequestsTimeMs);
 	STATSCOUNTER_DEF(ctrHttpRequestsStatus0xx, mutCtrHttpRequestsStatus0xx); // HTTP requests returning 0xx
 	STATSCOUNTER_DEF(ctrHttpRequestsStatus1xx, mutCtrHttpRequestsStatus1xx); // HTTP requests returning 1xx
 	STATSCOUNTER_DEF(ctrHttpRequestsStatus2xx, mutCtrHttpRequestsStatus2xx); // HTTP requests returning 2xx
@@ -1287,7 +1287,7 @@ curlPost(wrkrInstanceData_t *pWrkrData, uchar *message, int msglen, uchar **tpls
 	curlCode = curl_easy_perform(curl);
 	DBGPRINTF("omhttp: curlPost curl returned %lld\n", (long long) curlCode);
 	STATSCOUNTER_INC(ctrHttpRequestCount, mutCtrHttpRequestCount);
-	STATSCOUNTER_INC(pWrkrData->pData->ctrHttpRequestsCount, pWorkerData->pData->mutCtrHttpRequestsCount);
+	STATSCOUNTER_INC(pWrkrData->pData->ctrHttpRequestsCount, pWrkrData->pData->mutCtrHttpRequestsCount);
 
 	if (curlCode != CURLE_OK) {
 		STATSCOUNTER_INC(ctrHttpRequestFail, mutCtrHttpRequestFail);
@n2yen
Copy link
Contributor

n2yen commented Apr 8, 2024

apologies on this @ftapajos - will push up a PR to get this fixed - cc: @rgerhards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants