diff --git a/CHANGELOG.md b/CHANGELOG.md index 58d553c..36487ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [0.6.2] - 2024-03-04 + +### Fixed + +- Fix segfaulting issues in k8s/kind + ## [0.6.1] - 2024-02-23 ### Added @@ -289,7 +295,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - First release candidate of SysFlow Collector. -[Unreleased]: https://github.com/sysflow-telemetry/sf-collector/compare/0.6.1...HEAD +[Unreleased]: https://github.com/sysflow-telemetry/sf-collector/compare/0.6.2...HEAD +[0.6.2]: https://github.com/sysflow-telemetry/sf-collector/compare/0.6.1...0.6.2 [0.6.1]: https://github.com/sysflow-telemetry/sf-collector/compare/0.6.0...0.6.1 [0.6.0]: https://github.com/sysflow-telemetry/sf-collector/compare/0.5.1...0.6.0 [0.5.1]: https://github.com/sysflow-telemetry/sf-collector/compare/0.5.0...0.5.1 diff --git a/README.md b/README.md index 81263bd..6b2e164 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # Supported tags and respective `Dockerfile` links -- [`0.6.1`, `latest`](https://github.com/sysflow-telemetry/sf-collector/blob/0.6.1/Dockerfile), [`edge`](https://github.com/sysflow-telemetry/sf-collector/blob/master/Dockerfile), [`dev`](https://github.com/sysflow-telemetry/sf-collector/blob/dev/Dockerfile) +- [`0.6.2`, `latest`](https://github.com/sysflow-telemetry/sf-collector/blob/0.6.2/Dockerfile), [`edge`](https://github.com/sysflow-telemetry/sf-collector/blob/master/Dockerfile), [`dev`](https://github.com/sysflow-telemetry/sf-collector/blob/dev/Dockerfile) # Quick reference @@ -26,7 +26,7 @@ [docker hub](https://hub.docker.com/u/sysflowtelemetry) | [GHCR](https://github.com/orgs/sysflow-telemetry/packages) - **Binary packages**: - [deb](https://github.com/sysflow-telemetry/sf-collector/releases/tag/0.6.1/sfcollector-0.6.1-x86_64.deb) | [rpm](https://github.com/sysflow-telemetry/sf-collector/releases/tag/0.6.1/sfcollector-0.6.1-x86_64.rpm) | [tgz](https://github.com/sysflow-telemetry/sf-collector/releases/tag/0.6.1/sfcollector-0.6.1-x86_64.tar.gz) + [deb](https://github.com/sysflow-telemetry/sf-collector/releases/tag/0.6.2/sfcollector-0.6.2-x86_64.deb) | [rpm](https://github.com/sysflow-telemetry/sf-collector/releases/tag/0.6.2/sfcollector-0.6.2-x86_64.rpm) | [tgz](https://github.com/sysflow-telemetry/sf-collector/releases/tag/0.6.2/sfcollector-0.6.2-x86_64.tar.gz) # What is SysFlow? diff --git a/makefile.manifest.inc b/makefile.manifest.inc index 64b4def..ca8f6d6 100644 --- a/makefile.manifest.inc +++ b/makefile.manifest.inc @@ -16,7 +16,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -SYSFLOW_VERSION?=0.6.1 +SYSFLOW_VERSION?=0.6.2 SYSFLOW_BUILD_NUMBER?=1 FALCO_VERSION=0.36.2 FALCO_LIBS_VERSION=0.13.4 diff --git a/src/libs/controlflowprocessor.cpp b/src/libs/controlflowprocessor.cpp index 31f5f8f..8404c1d 100644 --- a/src/libs/controlflowprocessor.cpp +++ b/src/libs/controlflowprocessor.cpp @@ -103,6 +103,10 @@ inline void ControlFlowProcessor::removeAndWriteProcessFlow(ProcessObj *proc) { int ControlFlowProcessor::handleProcEvent(sinsp_evt *ev, OpFlags flag) { sinsp_threadinfo *ti = ev->get_thread_info(); + if (ti == nullptr) { + SF_DEBUG(m_logger, "ti is NULL in handleProcEvent for flag " << flag); + return -1; + } switch (flag) { case OP_EXIT: { diff --git a/src/libs/processcontext.cpp b/src/libs/processcontext.cpp index 0028414..5b264eb 100644 --- a/src/libs/processcontext.cpp +++ b/src/libs/processcontext.cpp @@ -69,7 +69,14 @@ ProcessObj *ProcessContext::createProcess(sinsp_threadinfo *ti, sinsp_evt *ev, if (parent != nullptr) { OID poid; - parent = parent->is_main_thread() ? parent : parent->get_main_thread(); + if (!parent->is_main_thread()) { + sinsp_threadinfo *main = parent->get_main_thread(); + if (main != nullptr) { + parent = main; + } else { + SF_DEBUG(m_logger, "Parent main thread is NULL."); + } + } poid.createTS = parent->m_clone_ts; poid.hpid = parent->m_pid; p->proc.poid.set_OID(poid); @@ -252,7 +259,12 @@ ProcessObj *ProcessContext::getProcess(sinsp_evt *ev, SFObjectState state, mt = mt->get_parent_thread(); while (mt != nullptr && mt->m_tid != -1) { - mt = mt->is_main_thread() ? mt : mt->get_main_thread(); + if (mt->is_main_thread()) { + sinsp_threadinfo *tmp = mt->get_main_thread(); + if (tmp != nullptr) { + mt = tmp; + } + } if (mt->m_clone_ts == 0 && mt->m_pid == 0) { ct = mt; mt = mt->get_parent_thread(); diff --git a/src/libs/sysflowcontext.cpp b/src/libs/sysflowcontext.cpp index 1f6969f..a9a5da8 100644 --- a/src/libs/sysflowcontext.cpp +++ b/src/libs/sysflowcontext.cpp @@ -162,7 +162,7 @@ SysFlowContext::SysFlowContext(SysFlowConfig *config) m_inspector->set_snaplen(0); } m_offline = !config->scapInputPath.empty(); - m_hasPrefix = (config->filePath.back() != '/'); + m_hasPrefix = ((!config->filePath.empty()) && config->filePath.back() != '/'); m_callback = config->callback; }