Skip to content

Segfault at flb_input_chunk_destroy as failure of flb_input_chunk_get_tag() is not handled #2875

@manojna10

Description

@manojna10

Bug Report

if flb_input_chunk_get_tag() returns -1, its not handled in flb_input_chunk_destroy() resulting in SIGSEGV as shown below

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 29373]
0x00007f0c4dd5a1f5 in XXH3_hashLong_64b_default.constprop.9 () from /lib/libfluent-bit.so
(gdb) bt
#0 0x00007f0c4dd5a1f5 in XXH3_hashLong_64b_default.constprop.9 () at /lib/libfluent-bit.so
#1 0x00007f0c4dd08529 in flb_hash_del_ptr () at /lib/libfluent-bit.so
#2 0x00007f0c4dd0f9bc in flb_input_chunk_destroy () at /lib/libfluent-bit.so
#3 0x00007f0c4dd1d08c in flb_task_destroy () at /lib/libfluent-bit.so
#4 0x00007f0c4dd0fcee in flb_input_chunk_find_space_new_data () at /lib/libfluent-bit.so
#5 0x00007f0c4dd0fdc4 in flb_input_chunk_place_new_chunk () at /lib/libfluent-bit.so
#6 0x00007f0c4dd1047f in flb_input_chunk_append_raw () at /lib/libfluent-bit.so
#7 0x00007f0c4dd7ccf0 in in_lib_collect () at /lib/libfluent-bit.so
#8 0x00007f0c4dd0ef35 in flb_input_collector_fd () at /lib/libfluent-bit.so
#9 0x00007f0c4dd1b104 in flb_engine_start () at /lib/libfluent-bit.so
#10 0x00007f0c4dd061d1 in flb_lib_worker () at /lib/libfluent-bit.so
#11 0x00007f0c5779bea5 in start_thread () at /lib64/libpthread.so.0
#12 0x00007f0c4d9c98dd in clone () at /lib64/libc.so.6
(gdb)
To Reproduce

  • Steps to reproduce the problem:
    The server is down, so the logs are being stored in disk, after it reaches storage.total_limit_size, when its destroying old chunks, it seg faulting.

I
Expected behavior
should not crash

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions