Open nokute78 opened 1 year ago
Patched plugin works.
$ valgrind --leak-check=full ../../bin/fluent-bit -e ./flb-out_stdout2.so -i dummy -o stdout2
==12138== Memcheck, a memory error detector
==12138== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==12138== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==12138== Command: ../../bin/fluent-bit -e ./flb-out_stdout2.so -i dummy -o stdout2
==12138==
Fluent Bit v2.0.7
* 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/10 08:18:11] [ info] [fluent bit] version=2.0.7, commit=0397d01126, pid=12138
[2022/12/10 08:18:11] [ info] [storage] ver=1.2.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2022/12/10 08:18:11] [ info] [cmetrics] version=0.5.7
[2022/12/10 08:18:11] [ info] [ctraces ] version=0.2.5
[2022/12/10 08:18:11] [ info] [input:dummy:dummy.0] initializing
[2022/12/10 08:18:11] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2022/12/10 08:18:11] [ info] [sp] stream processor started
==12138== Warning: client switching stacks? SP change: 0x5ff95a8 --> 0x54a2a10
==12138== to suppress, use: --max-stackframe=11889560 or greater
==12138== Warning: client switching stacks? SP change: 0x54a2968 --> 0x5ff95a8
==12138== to suppress, use: --max-stackframe=11889728 or greater
==12138== Warning: client switching stacks? SP change: 0x5ff97e8 --> 0x54a2968
==12138== to suppress, use: --max-stackframe=11890304 or greater
==12138== further instances of this message will not be shown.
[0] [1670627891.982745855, {"message"=>"dummy"}]
[0] [1670627892.975489926, {"message"=>"dummy"}]
^C[2022/12/10 08:18:14] [engine] caught signal (SIGINT)
[2022/12/10 08:18:14] [ warn] [engine] service will shutdown in max 5 seconds
[2022/12/10 08:18:14] [ info] [input] pausing dummy.0
[0] [1670627893.956161450, {"message"=>"dummy"}]
[2022/12/10 08:18:14] [ info] [engine] service has stopped (0 pending tasks)
[2022/12/10 08:18:14] [ info] [input] pausing dummy.0
==12138==
==12138== HEAP SUMMARY:
==12138== in use at exit: 0 bytes in 0 blocks
==12138== total heap usage: 1,444 allocs, 1,444 frees, 1,245,991 bytes allocated
==12138==
==12138== All heap blocks were freed -- no leaks are possible
==12138==
==12138== For lists of detected and suppressed errors, rerun with: -s
==12138== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Current code uses old function prototypes. It causes following build warning and sigsegv.
This patch is to support fluent-bit v2 prototypes. https://github.com/fluent/fluent-bit/blob/v2.0.6/include/fluent-bit/flb_output.h#L199
Warning:
SIGSEGV: