[ZBX-23110] zabbix agent 6.4.3 crashes regularly under win11 Created: 2023 Jul 17  Updated: 2025 Feb 10  Resolved: 2023 Sep 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 6.4.3
Fix Version/s: 6.0.22rc1, 6.4.7rc1, 7.0.0alpha5, 7.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Jona Assignee: Michael Veksler
Resolution: Fixed Votes: 0
Labels: crash
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 11


Attachments: Text File zabbix_agentd-1.log     File zabbix_agentd-v64-dbg1.7z     File zabbix_agentd-v64-dbg2-rwl.7z     Text File zabbix_agentd.log    
Issue Links:
Related
related to ZBX-21703 Zabbix Agent2 is no longer retrieving... Reopened
Sub-task
depends on ZBX-22996 Zabbix agent 6.4 not working on Windo... Closed
depends on ZBX-21549 Windows agent template not compatible... Closed
Team: Team B
Sprint: Sprint 103 (Aug 2023), Sprint 104 (Sep 2023)
Story Points: 0.75

 Description   

Under win 11 the zabbix agent version 6.4.3 and previous cash regularly after around 1 day. All the rest running under this os is not affected, just zabbix agent.

This is my log file from the win11 vm.

 12272:20230716:184720.310 **************************
 12272:20230716:184720.310 using configuration file: C:\Program Files\Zabbix Agent\zabbix_agentd.conf
 12272:20230716:184722.728 agent #0 started [main process]
  6044:20230716:184722.728 agent #1 started [collector]
 12120:20230716:184722.729 agent #2 started [listener #1]
 12152:20230716:184722.729 agent #3 started [listener #2]
 12168:20230716:184722.729 agent #4 started [listener #3]
 12120:20230717:063524.879 Unhandled exception c0000005 detected at 0x00007FFA0522BE7D. Crashing ...
 12120:20230717:063524.879 ====== Fatal information: ======
 12120:20230717:063524.880 Program counter: 0x0522be7d
 12120:20230717:063524.880 === Registers: ===
 12120:20230717:063524.880 r8      =                0 =                    0 =                    0
 12120:20230717:063524.880 r9      =                0 =                    0 =                    0
 12120:20230717:063524.881 r10     =                3 =                    3 =                    3
 12120:20230717:063524.881 r11     =          290b860 =             43038816 =             43038816
 12120:20230717:063524.881 r12     =                0 =                    0 =                    0
 12120:20230717:063524.882 r13     =           4d0000 =              5046272 =              5046272
 12120:20230717:063524.882 r14     =                0 =                    0 =                    0
 12120:20230717:063524.882 r15     =                0 =                    0 =                    0
 12120:20230717:063524.883 rdi     =                0 =                    0 =                    0
 12120:20230717:063524.883 rsi     =             7810 =                30736 =                30736
 12120:20230717:063524.883 rbp     =             7800 =                30720 =                30720
 12120:20230717:063524.883 rbx     =           4d0000 =              5046272 =              5046272
 12120:20230717:063524.884 rdx     =             7810 =                30736 =                30736
 12120:20230717:063524.884 rax     =                1 =                    1 =                    1
 12120:20230717:063524.884 rcx     =           4d0000 =              5046272 =              5046272
 12120:20230717:063524.885 rsp     =          290b7d0 =             43038672 =             43038672
 12120:20230717:063524.885 efl     =            10246 =                66118 =                66118
 12120:20230717:063524.885 csgsfs  =         332b5300 =            858477312 =            858477312
 12120:20230717:063524.885 === Backtrace: ===


 Comments   
Comment by Elina Kuzyutkina (Inactive) [ 2023 Jul 18 ]

Hi,
Is it 64x agent? How you have get it? (download from official repo, compiled by yourself, etc)
Please increase log level for the agent to 4 (in conf file) and attach logs with at least few crashes

Regards, Elina

Comment by Jona [ 2023 Jul 21 ]

Please find attached the log file with enhanced logging.
Yes it is a 64bit agent, downloaded directly from zabbix website.

Comment by Michael Veksler [ 2023 Jul 21 ]

Hi jona,

Be so kind to attach logs with log level = 5 (new exception handler only works in trace mode)

Comment by Jona [ 2023 Jul 23 ]

@Michael Veksler I have just uploaded the log 5 file with the latest crash.

Comment by Michael Veksler [ 2023 Jul 24 ]

Hi jona,

Thanks for log, but the log zabbix_agentd-1.log for LogLevel=4

I suspect that you didn't restart agent after changing LogLevel parameter

Comment by Michael Veksler [ 2023 Jul 24 ]

Hi jona ,

Be so kind to test zabbix_agentd-v64-dbg1.7z

with refresh_object_cache() commented out (LogLevel=4 is enough)

diff --git a/src/libs/zbxsysinfo/win32/pdhmon.c b/src/libs/zbxsysinfo/win32/pdhmon.c
index 1e58c7a01fc..e46b6b10c2f 100644
--- a/src/libs/zbxsysinfo/win32/pdhmon.c
+++ b/src/libs/zbxsysinfo/win32/pdhmon.c
@@ -172,6 +172,7 @@ int perf_instance_discovery_ex(const char *function, AGENT_REQUEST *request, AGE
        else
                object_name = zbx_utf8_to_unicode(tmp);
 
+/*
        if (SUCCEED != refresh_object_cache())
        {
                SET_MSG_RESULT(result, zbx_strdup(NULL, "Cannot refresh object cache."));
@@ -189,7 +190,7 @@ int perf_instance_discovery_ex(const char *function, AGENT_REQUEST *request, AGE
                SET_MSG_RESULT(result, zbx_strdup(NULL, "Cannot obtain required buffer size."));
                goto err;
        }
-
+*/
        if (0 == inst_len)
        {
                SET_MSG_RESULT(result, zbx_strdup(NULL, "Object does not support variable instances."));
Comment by Jona [ 2023 Jul 26 ]

Thanks @Michael

I changed the file and restarted with log level 4, waiting to get stuck

Comment by Jona [ 2023 Aug 01 ]

Hi.
Just wanted to give a quick feedback.
For now it's working perfectly, no interruptions, no nothing.

But now that I'm using a special executable, I'm wondering if the difference, and maybe the root cause too, is that your exe was build under debug and the production ready one under release?
We've had that issue in another project, where build definiitons (of course) differ for debug and release. In the end it was a missing dependency for release...
Is this also possible here?

Comment by Michael Veksler [ 2023 Aug 02 ]

Hi jona,

As concerns your problem - my build just removes concurrent access to win API connected with PdhEnumObjects

We will add RWLock to a future build

Comment by Michael Veksler [ 2023 Aug 30 ]

Hi jona,

Be so kind to test zabbix_agentd-v64-dbg2-rwl.7z version.

If you confirm that this approach works, we will apply these changes.

Comment by Jona [ 2023 Sep 01 ]

Hi @Michael,

I've deployed it this morning and will give feedback in around 2 days.

 

Comment by Jona [ 2023 Sep 03 ]

Hi Michael.

It works perfeclty fine.

Comment by Michael Veksler [ 2023 Sep 04 ]

Hi jona,

Thanks for the help. If you will get additional problems - give information

Comment by Robin Roevens [ 2023 Sep 06 ]

Hi @Michael

I too experienced the classic agent crashes, first thinking it was related to ZBX-21703, but there I was pointed this issue.
I also tried the 6.4.6rc1 release you posted here on one machine and had no agent crash there since then. So the fix seems to be working fine.

Comment by Michael Veksler [ 2023 Sep 14 ]

Available in:

Generated at Wed Apr 16 05:42:49 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.