-
Problem report
-
Resolution: Fixed
-
Trivial
-
6.0.0alpha1
-
Sprint 79 (Aug 2021)
-
1
Steps to reproduce:
- Create host using autoregistration.
- Turn of server and agent.
- Go to Autoregistration action and change operation to "Remove from host groups".
Choose host group that doesn't attached to created host (Hypervisors). - Turn on server and agent.
Result:
Server crashes.
Server logs:
1157554:20210817:112805.832 In op_groups_del() 1157554:20210817:112805.832 In select_discovered_host() eventid:81 1157554:20210817:112805.832 query [txnlev:1] [select h.hostid,h.name from hosts h,autoreg_host a where h.host=a.host and a.autoreg_hostid=1 and h.status in (0,1) limit 1] 1157554:20210817:112805.833 End of select_discovered_host():10416 1157554:20210817:112805.833 query [txnlev:1] [select groupid from hosts_groups where hostid=10416 and not groupid=7 limit 1] 1157554:20210817:112805.835 query [txnlev:1] [select hostgroupid from hosts_groups where hostid=10416 and groupid=7] 1157554:20210817:112805.835 query [txnlev:1] [delete from hosts_groups where hostid=10416 and groupid=7] 1157554:20210817:112805.836 Got signal [signal:11(SIGSEGV),reason:1,refaddr:(nil)]. Crashing ...
Valgrind logs:
==00:00:00:43.163 1160314== ERROR SUMMARY: 4 errors from 2 contexts (suppressed: 0 from 0)
==00:00:00:43.163 1160314==
==00:00:00:43.163 1160314== 1 errors in context 1 of 2:
==00:00:00:43.163 1160314== Invalid read of size 8
==00:00:00:43.163 1160314== at 0x2D18EF: zbx_audit_host_hostgroup_delete (audit.c:573)
==00:00:00:43.163 1160314== by 0x23F45A: op_groups_del (operations.c:932)
==00:00:00:43.163 1160314== by 0x237C66: execute_operations (actions.c:2898)
==00:00:00:43.163 1160314== by 0x237C66: process_actions (actions.c:3274)
==00:00:00:43.163 1160314== by 0x239DF5: flush_events (events.c:2130)
==00:00:00:43.163 1160314== by 0x23BC52: zbx_process_events (events.c:2847)
==00:00:00:43.163 1160314== by 0x33DC6E: DBregister_host_flush (db.c:1874)
==00:00:00:43.163 1160314== by 0x33E1C5: DBregister_host (db.c:1560)
==00:00:00:43.163 1160314== by 0x198767: db_register_host (active.c:87)
==00:00:00:43.163 1160314== by 0x198999: get_hostid_by_host (active.c:290)
==00:00:00:43.163 1160314== by 0x1996CB: send_list_of_active_checks_json (active.c:611)
==00:00:00:43.163 1160314== by 0x197413: process_trap (trapper.c:1049)
==00:00:00:43.163 1160314== by 0x198561: process_trapper_child (trapper.c:1169)
==00:00:00:43.163 1160314== by 0x198561: trapper_thread (trapper.c:1249)
==00:00:00:43.163 1160314== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==00:00:00:43.163 1160314==
==00:00:00:43.163 1160314==
==00:00:00:43.163 1160314== 3 errors in context 2 of 2:
==00:00:00:43.163 1160314== Conditional jump or move depends on uninitialised value(s)
==00:00:00:43.163 1160314== at 0x196A98: process_trap (trapper.c:1042)
==00:00:00:43.163 1160314== by 0x198561: process_trapper_child (trapper.c:1169)
==00:00:00:43.163 1160314== by 0x198561: trapper_thread (trapper.c:1249)
==00:00:00:43.163 1160314== by 0x2CC383: zbx_thread_start (threads.c:136)
==00:00:00:43.163 1160314== by 0x16BD16: MAIN_ZABBIX_ENTRY (server.c:1391)
==00:00:00:43.163 1160314== by 0x2BFCA8: daemon_start (daemon.c:411)
==00:00:00:43.163 1160314== by 0x163C98: main (server.c:1071)
==00:00:00:43.163 1160314== Uninitialised value was created by a stack allocation
==00:00:00:43.163 1160314== at 0x196732: process_trap (trapper.c:977)
==00:00:00:43.163 1160314==
==00:00:00:43.163 1160314== ERROR SUMMARY: 4 errors from 2 contexts (suppressed: 0 from 0)
--00:00:00:43.203 1160262-- Discarding syms at 0x84e25c0-0x84e8a1c in /usr/lib/x86_64-linux-gnu/libnss_files-2.31.so (have_dinfo 1)
--00:00:00:43.205 1160240-- Discarding syms at 0x84e25c0-0x84e8a1c in /usr/lib/x86_64-linux-gnu/libnss_files-2.31.so (have_dinfo 1)
--00:00:00:43.206 1160263-- Discarding syms at 0x84e25c0-0x84e8a1c in /usr/lib/x86_64-linux-gnu/libnss_files-2.31.so (have_dinfo 1)
Expected:
No crash
Checked on last master version.