You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When building version 1.5.3 on FreeBSD, clang quits with an error:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_strptime.c: In function '_flb_strptime':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_strptime.c:480:21: error: wrong type argument to unary minus
480 | tm->tm_gmtoff = -(timezone);
| ^
To Reproduce
Using a FreeBSD-12.1 installation with a fresh ports tree, apply the patch below to the fluent-bit port directory and build the port.
Expected behavior
building without error :-)
Screenshots
cd /wrkdirs/usr/ports/sysutils/fluent-bit/work/.build/src && /usr/local/libexec/ccache/gcc9 -DFLB_CORE=1 -DFLB_CORO_STACK_SIZE=24576 -DFLB_DUMP_STACKTRACE=1 -DFLB_HAVE_ACCEPT4 -DFLB_HAVE_AWS -DFLB_HAVE_C_TLS -DFLB_HAVE_FORK -DFLB_HAVE_GMTOFF -DFLB_HAVE_LIBBACKTRACE -DFLB_HAVE_LUAJIT -DFLB_HAVE_PARSER -DFLB_HAVE_PROXY_GO -DFLB_HAVE_RECORD_ACCESSOR -DFLB_HAVE_REGEX -DFLB_HAVE_SIGNV4 -DFLB_HAVE_SQLDB -DFLB_HAVE_STREAM_PROCESSOR -DFLB_HAVE_SYSTEM_STRPTIME -DFLB_HAVE_TIMESPEC_GET -DFLB_HAVE_TLS -DFLB_HAVE_UNIX_SOCKET -DFLB_HAVE_UTF8_ENCODER -DJSMN_PARENT_LINKS -DJSMN_STRICT -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/flb_libco -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/rbtree -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/msgpack-3.2.0/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/chunkio/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/LuaJIT-2.1.0-beta3/src -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/monkey/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/mbedtls-2.16.5/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/sqlite-amalgamation-3310000 -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/mpack-amalgamation-1.0/src -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/miniz -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/onigmo -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/.build/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/lib/tutf8e/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/.build/backtrace-prefix/include -I/wrkdirs/usr/ports/sysutils/fluent-bit/work/.build/lib/msgpack-3.2.0/include -O2 -pipe -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc9 -fno-strict-aliasing -Wall -D__FILENAME__='"src/flb_ra_key.c"' -O2 -pipe -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc9 -fno-strict-aliasing -fPIC -o CMakeFiles/fluent-bit-static.dir/flb_ra_key.c.o -c /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_ra_key.c
In file included from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_input.h:30,
from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_storage.c:22:
In function 'flb_strdup',
inlined from 'flb_storage_create' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_storage.c:552:41:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_upstream.c:25:
In function 'flb_strdup',
inlined from 'flb_upstream_create' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_upstream.c:87:24:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_upstream.c: In function 'flb_upstream_create':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In file included from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c:24:
In function 'flb_strdup',
inlined from 'flb_parser_create' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c:178:22:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c: In function 'flb_parser_create':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_parser_create' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c:181:15:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c: In function 'flb_parser_create':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_parser_create' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c:184:28:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c: In function 'flb_parser_create':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_parser_create' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c:185:23:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c: In function 'flb_parser_create':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_parser_create' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c:286:23:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c: In function 'flb_parser_create':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_parser_frac' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c:813:15:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser.c: In function 'flb_parser_frac':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser_decoder.c: In function 'flb_parser_decoder_do':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser_decoder.c:498:16: warning: 'out_type' may be used uninitialized in this function [-Wmaybe-uninitialized]
498 | if (out_type == TYPE_OUT_STRING) {
| ^
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_parser_decoder.c:213:9: warning: 'in_type' may be used uninitialized in this function [-Wmaybe-uninitialized]
213 | int in_type;
| ^~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_io_tls.c: In function 'net_io_tls_handshake':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_io_tls.c:400:15: warning: 'flag' may be used uninitialized in this function [-Wmaybe-uninitialized]
400 | ret = mk_event_add(u->evl,
| ^~~~~~~~~~~~~~~~~~~~
401 | u_conn->event.fd,
| ~~~~~~~~~~~~~~~~~
402 | FLB_ENGINE_EV_THREAD,
| ~~~~~~~~~~~~~~~~~~~~~
403 | flag, &u_conn->event);
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_input.h:30,
from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_engine.h:27,
from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_output.h:39,
from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c:31:
In function 'flb_strdup',
inlined from 'flb_proxy_register_output' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c:107:18,
inlined from 'flb_plugin_proxy_register' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c:181:13:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c: In function 'flb_plugin_proxy_register':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_proxy_register_output' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c:108:24,
inlined from 'flb_plugin_proxy_register' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c:181:13:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c: In function 'flb_plugin_proxy_register':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_plugin_proxy_set' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c:266:18:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c: In function 'flb_plugin_proxy_set':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_plugin_proxy_set' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c:267:24:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_plugin_proxy.c: In function 'flb_plugin_proxy_set':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_strptime.c: In function '_flb_strptime':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_strptime.c:480:21: error: wrong type argument to unary minus
480 | tm->tm_gmtoff = -(timezone);
| ^
gmake[3]: *** [src/CMakeFiles/fluent-bit-static.dir/build.make:645: src/CMakeFiles/fluent-bit-static.dir/flb_strptime.c.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
In file included from /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_sqldb.c:22:
In function 'flb_strdup',
inlined from 'flb_sqldb_open' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_sqldb.c:87:16:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_sqldb.c: In function 'flb_sqldb_open':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
In function 'flb_strdup',
inlined from 'flb_sqldb_open' at /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_sqldb.c:88:16:
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:41:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
41 | strncpy(str, s, len);
| ^~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/src/flb_sqldb.c: In function 'flb_sqldb_open':
/wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-1.5.3/include/fluent-bit/flb_str.h:36:11: note: length computed here
36 | len = strlen(s);
| ^~~~~~~~~
gmake[3]: Leaving directory '/wrkdirs/usr/ports/sysutils/fluent-bit/work/.build'
gmake[2]: *** [CMakeFiles/Makefile2:4208: src/CMakeFiles/fluent-bit-static.dir/all] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/sysutils/fluent-bit/work/.build'
gmake[1]: *** [Makefile:175: all] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/fluent-bit/work/.build'
Bug Report
Describe the bug
When building version 1.5.3 on FreeBSD, clang quits with an error:
To Reproduce
Using a FreeBSD-12.1 installation with a fresh ports tree, apply the patch below to the fluent-bit port directory and build the port.
Expected behavior
building without error :-)
Screenshots
Your Environment
Apply this trivial patch to the FreeBSD port:
The text was updated successfully, but these errors were encountered: