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

in_stdin, out_stdout: Simple non-JSON test causes crash #650

Closed
chlunde opened this issue Jun 19, 2018 · 1 comment
Closed

in_stdin, out_stdout: Simple non-JSON test causes crash #650

chlunde opened this issue Jun 19, 2018 · 1 comment
Assignees

Comments

@chlunde
Copy link
Contributor

chlunde commented Jun 19, 2018

A simple test like this might be one of the first things a new user tries, but it causes a crash:

echo '2018-01-01T18:00:00 foo' | ./build/bin/fluent-bit  -i stdin -o stdout

This is probably because in_stdin expects JSON. I think this should not crash because it will not leave a good first impression. I'm not sure what the best solution is, maybe it should print a warning once if we get invalid JSON?

Actual output:

Fluent-Bit v0.14.0
Copyright (C) Treasure Data

[2018/06/19 21:08:20] [ info] [engine] started (pid=53252)
[2018/06/19 21:08:20] [ warn] [in_stdin] end of file (stdin closed by remote end)
[2018/06/19 21:08:20] [ info] [input] pausing stdin.0
[engine] caught signal (SIGSEGV)
[0] stdin.0: [#0  0x444471            in  flb_time_pop_from_msgpack() at src/flb_time.c:155
#1  0x473dee            in  cb_stdout_flush() at plugins/out_stdout/stdout.c:56
#2  0x4339c2            in  output_pre_cb_flush() at include/fluent-bit/flb_output.h:311
#3  0x4f9765            in  co_init() at lib/flb_libco/amd64.c:117
#4  0xffffffffffffffff  in  ???() at ???:0
Aborted (core dumped)

In general, I wonder if there should be some more asserts for msgpack types. Here it crashes because it expects an array but it gets a number.

@edsiper edsiper self-assigned this Jul 3, 2018
edsiper added a commit that referenced this issue Jul 3, 2018
@edsiper edsiper added the bug label Jul 3, 2018
@edsiper
Copy link
Member

edsiper commented Jul 3, 2018

thanks for reporting this issue.

I've pushed the fix 2a4d62b which allows to detect the content type and pack as raw text if is not a valid JSON (it should be merged shortly in GIT master)

@edsiper edsiper added the fixed label Jul 3, 2018
@edsiper edsiper closed this as completed Jul 3, 2018
edsiper added a commit that referenced this issue Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants