Skip to content

test: stream_processor: Plug a SEGV for macOS - #10404

Merged
edsiper merged 1 commit into
masterfrom
cosmo0920-plug-internal-test-of-stream_processor-segv-on-macos
May 30, 2025
Merged

test: stream_processor: Plug a SEGV for macOS#10404
edsiper merged 1 commit into
masterfrom
cosmo0920-plug-internal-test-of-stream_processor-segv-on-macos

Conversation

@cosmo0920

Copy link
Copy Markdown
Contributor

Without TLS initialization, we got the following error on macOS:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100b0defc flb-it-stream_processor`_mk_event_timeout_create(ctx=0x0000000000000000, sec=0, nsec=500000000, data=0x0000600001608460) at mk_event_kqueue.c:222:23
   219         EV_SET(&ke, fd, EVFILT_TIMER, EV_ADD, 0, (sec * 1000) + (nsec / 1000000) , event);
   220     #endif
   221
-> 222         ret = kevent(ctx->kfd, &ke, 1, NULL, 0, NULL);
   223         if (ret < 0) {
   224             close(fd);
   225             mk_libc_error("kevent");
Target 0: (flb-it-stream_processor) stopped.

This can be plugged by TLS initialization for eventloop.


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
  • Debug log output from testing the change
  • 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.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

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.

Without TLS initialization, we got the following error on macOS:

```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100b0defc flb-it-stream_processor`_mk_event_timeout_create(ctx=0x0000000000000000, sec=0, nsec=500000000, data=0x0000600001608460) at mk_event_kqueue.c:222:23
   219         EV_SET(&ke, fd, EVFILT_TIMER, EV_ADD, 0, (sec * 1000) + (nsec / 1000000) , event);
   220     #endif
   221
-> 222         ret = kevent(ctx->kfd, &ke, 1, NULL, 0, NULL);
   223         if (ret < 0) {
   224             close(fd);
   225             mk_libc_error("kevent");
Target 0: (flb-it-stream_processor) stopped.
```

This can be plugged by TLS initialization for eventloop.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@cosmo0920 cosmo0920 added this to the Fluent bit v4.0.3 milestone May 30, 2025
@edsiper
edsiper merged commit 0d44756 into master May 30, 2025
@edsiper
edsiper deleted the cosmo0920-plug-internal-test-of-stream_processor-segv-on-macos branch May 30, 2025 12:39
rghouzra pushed a commit to rghouzra/fluent-bit_oracle that referenced this pull request Jun 14, 2025
Without TLS initialization, we got the following error on macOS:

```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100b0defc flb-it-stream_processor`_mk_event_timeout_create(ctx=0x0000000000000000, sec=0, nsec=500000000, data=0x0000600001608460) at mk_event_kqueue.c:222:23
   219         EV_SET(&ke, fd, EVFILT_TIMER, EV_ADD, 0, (sec * 1000) + (nsec / 1000000) , event);
   220     #endif
   221
-> 222         ret = kevent(ctx->kfd, &ke, 1, NULL, 0, NULL);
   223         if (ret < 0) {
   224             close(fd);
   225             mk_libc_error("kevent");
Target 0: (flb-it-stream_processor) stopped.
```

This can be plugged by TLS initialization for eventloop.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
nourdouf pushed a commit to seveas/fluent-bit that referenced this pull request Sep 23, 2025
Without TLS initialization, we got the following error on macOS:

```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100b0defc flb-it-stream_processor`_mk_event_timeout_create(ctx=0x0000000000000000, sec=0, nsec=500000000, data=0x0000600001608460) at mk_event_kqueue.c:222:23
   219         EV_SET(&ke, fd, EVFILT_TIMER, EV_ADD, 0, (sec * 1000) + (nsec / 1000000) , event);
   220     #endif
   221
-> 222         ret = kevent(ctx->kfd, &ke, 1, NULL, 0, NULL);
   223         if (ret < 0) {
   224             close(fd);
   225             mk_libc_error("kevent");
Target 0: (flb-it-stream_processor) stopped.
```

This can be plugged by TLS initialization for eventloop.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
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.

2 participants