Skip to content

Conversation

nokute78
Copy link
Collaborator

Fixes #6519
This patch is to fix to use FLB_DEFINITION to define FLB_HAVE_*.

FLB_HAVE_CHUNK_TRACE should be defined in flb_info.h.
However it isn't defined since it is defined using add_definitions.

It causes struct size mismatch between fluent-bit and fluent-bit-plugin since the size will be changed FLB_HAVE_CHUNK_TRACE is defined or not.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Dockerfile

It is to test issue #6519

FROM ubuntu:jammy

RUN apt update -qq && apt install -y cmake make g++ vim tree pkg-config libyaml-dev flex bison git libssl-dev
#RUN git clone https://github.com/fluent/fluent-bit.git && cd /fluent-bit/build && cmake .. && make
RUN git clone https://github.com/nokute78/fluent-bit.git && cd /fluent-bit/build && git checkout use_flb_definition_for_flb_have && cmake .. && make
RUN cd / && git clone https://github.com/brisa-robotics/fluent-bit-plugin && cd fluent-bit-plugin && git checkout in_bug && mkdir build && cp -r /fluent-bit/build/lib/monkey/include/monkey/mk_core/ /fluent-bit/include/
RUN cd /fluent-bit-plugin/build && cmake -DFLB_SOURCE=/fluent-bit -DPLUGIN_NAME=in_dummy2 ../ && make 
$ sudo docker run -it --rm <created container image id>
# /fluent-bit/build/bin/fluent-bit -e /fluent-bit-plugin/build/flb-in_dummy2.so -i dummy2 -o stdout
Fluent Bit v2.0.8
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2022/12/23 01:33:54] [ info] [fluent bit] version=2.0.8, commit=64c3f2cfd0, pid=13
[2022/12/23 01:33:54] [ info] [storage] ver=1.4.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2022/12/23 01:33:54] [ info] [cmetrics] version=0.5.7
[2022/12/23 01:33:54] [ info] [ctraces ] version=0.2.5
[2022/12/23 01:33:54] [ info] [input:dummy2:dummy2.0] initializing
[2022/12/23 01:33:54] [ info] [input:dummy2:dummy2.0] storage_strategy='memory' (memory only)
[2022/12/23 01:33:54] [ info] [sp] stream processor started
[2022/12/23 01:33:54] [ info] [output:stdout:stdout.0] worker #0 started
[0] dummy2.0: [1671759234.951397405, {"message"=>"dummy"}]
^C[2022/12/23 01:33:56] [engine] caught signal (SIGINT)

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@edsiper edsiper merged commit 7b593de into fluent:master Dec 23, 2022
@nokute78 nokute78 deleted the use_flb_definition_for_flb_have branch December 23, 2022 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use external C input plugin leads to crash on flb_config_map_set ()

2 participants