Nagios 4.4.3 - signal 11, Segmentation fault

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mkessler_sw
Posts: 2
Joined: Mon Oct 09, 2017 9:07 am

Nagios 4.4.3 - signal 11, Segmentation fault

Post by mkessler_sw »

I have two crashes of Nagios core 4.4.3. Nagios was running since June with no issues. Running on CentOS 7, Linux SRV-97D8 3.10.0-1127.19.1.el7.x86_64. The core file shows a problem in add_macrox_environment_vars_r

The first kernel log shows the following. The crash occurred on October 7.

[4198897.547280] traps: nagios[30743] general protection ip:7f745c3cc665 sp:7ffda29dbba8 error:0 in libc-2.17.so[7f745c25d000+1c3000]

The back trace shows the following:

Core was generated by `/usr/sbin/nagios -d /etc/nagios/nagios.cfg'.
Program terminated with signal 11, Segmentation fault.
#0 __strlen_sse2_pminub () at ../sysdeps/x86_64/multiarch/strlen-sse2-pminub.S:49
49 pcmpeqb (%rax), %xmm0
(gdb) bt
#0 __strlen_sse2_pminub () at ../sysdeps/x86_64/multiarch/strlen-sse2-pminub.S:49
#1 0x000055b4df976d9a in kvvec_addkv_wlen (kvv=kvv@entry=0x55b4e6072150, key=0x55b4e2c9b310 "NAGIOS_TEMPFILE", keylen=keylen@entry=0,
value=0x72756f686b726f77 <Address 0x72756f686b726f77 out of bounds>, valuelen=valuelen@entry=0) at kvvec.c:97
#2 0x000055b4df93cbb0 in add_macrox_environment_vars_r (kvvp=0x55b4e6072150, mac=0x7ffda29dbd80) at ../common/macros.c:3372
#3 macros_to_kvv (mac=mac@entry=0x7ffda29dbd80) at ../common/macros.c:3317
#4 0x000055b4df9168bd in wproc_run_job (job=0x55b4e3eb8600, mac=mac@entry=0x7ffda29dbd80) at workers.c:1167
#5 0x000055b4df91850e in wproc_run_check (cr=cr@entry=0x55b4e7249c90, cmd=<optimized out>, mac=mac@entry=0x7ffda29dbd80) at workers.c:1284
#6 0x000055b4df919c20 in run_async_service_check (svc=svc@entry=0x55b4e0f8dd70, check_options=check_options@entry=0, latency=latency@entry=8.4999999671708792e-05,
scheduled_check=scheduled_check@entry=1, reschedule_check=reschedule_check@entry=1, time_is_valid=time_is_valid@entry=0x7ffda29dc47c,
preferred_time=preferred_time@entry=0x7ffda29dc488) at checks.c:318
#7 0x000055b4df91a0a1 in run_scheduled_service_check (svc=svc@entry=0x55b4e0f8dd70, check_options=0, latency=latency@entry=8.4999999671708792e-05) at checks.c:92
#8 0x000055b4df93210b in handle_timed_event (event=event@entry=0x55b4e48167a0) at events.c:1226
#9 0x000055b4df932c53 in event_execution_loop () at events.c:1165
#10 0x000055b4df910b1d in main (argc=<optimized out>, argv=<optimized out>) at nagios.c:846


Second crash occurred on November 9 and the kernel log shows

2020-11-09T23:40:07.271337+00:00 SRV-97D8 systemd[1]: nagios.service: main process exited, code=dumped, status=11/SEGV
2020-11-09T23:40:07.321622+00:00 SRV-97D8 kill[17824]: kill: cannot find process ""
2020-11-09T23:40:07.324440+00:00 SRV-97D8 systemd[1]: nagios.service: control process exited, code=exited status=1

The back trace shows the following:

Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/nagios -d /etc/nagios/nagios.cfg'.
Program terminated with signal 11, Segmentation fault.
#0 ___fprintf_chk (fp=fp@entry=0x3035363934303631, flag=flag@entry=1, format=format@entry=0x561a5437f890 "[%lu.%06lu] [%03d.%d] [pid=%lu] ") at fprintf_chk.c:31
31 _IO_acquire_lock_clear_flags2 (fp);
(gdb) bt
#0 ___fprintf_chk (fp=fp@entry=0x3035363934303631, flag=flag@entry=1, format=format@entry=0x561a5437f890 "[%lu.%06lu] [%03d.%d] [pid=%lu] ") at fprintf_chk.c:31
#1 0x0000561a54328623 in fprintf (__fmt=0x561a5437f890 "[%lu.%06lu] [%03d.%d] [pid=%lu] ", __stream=0x3035363934303631) at /usr/include/bits/stdio2.h:97
#2 log_debug_info (level=level@entry=1, verbosity=verbosity@entry=0, fmt=fmt@entry=0x561a5437f9aa "process_macros_r()\n") at logging.c:536
#3 0x0000561a5432b0a8 in process_macros_r (mac=mac@entry=0x7ffe1df95ec0, input_buffer=0x0, output_buffer=0x7ffe1df95c20, options=4) at ../common/macros.c:116
#4 0x0000561a543296e0 in grab_standard_host_macro_r (mac=mac@entry=0x7ffe1df95ec0, macro_type=macro_type@entry=74, temp_host=<optimized out>, output=output@entry=0x7ffe1df96110,
free_macro=0x7ffe1df95d4c) at ../common/macros.c:1884
#5 0x0000561a5432a49e in grab_macrox_value_r (mac=mac@entry=0x7ffe1df95ec0, macro_type=macro_type@entry=74, arg1=arg1@entry=0x0, arg2=arg2@entry=0x0, output=output@entry=0x7ffe1df96110,
free_macro=free_macro@entry=0x7ffe1df95d4c) at ../common/macros.c:778
#6 0x0000561a5432fc53 in add_macrox_environment_vars_r (kvvp=0x561a55f9e3e0, mac=0x7ffe1df95ec0) at ../common/macros.c:3362
#7 macros_to_kvv (mac=mac@entry=0x7ffe1df95ec0) at ../common/macros.c:3317
#8 0x0000561a543098bd in wproc_run_job (job=0x561a55f85fa0, mac=mac@entry=0x7ffe1df95ec0) at workers.c:1167
#9 0x0000561a5430b50e in wproc_run_check (cr=cr@entry=0x561a55f99f80, cmd=<optimized out>, mac=mac@entry=0x7ffe1df95ec0) at workers.c:1284
#10 0x0000561a5430cc20 in run_async_service_check (svc=svc@entry=0x561a565a75d0, check_options=check_options@entry=0, latency=latency@entry=0, scheduled_check=scheduled_check@entry=1,
reschedule_check=reschedule_check@entry=1, time_is_valid=time_is_valid@entry=0x7ffe1df965bc, preferred_time=preferred_time@entry=0x7ffe1df965c8) at checks.c:318
#11 0x0000561a5430d0a1 in run_scheduled_service_check (svc=svc@entry=0x561a565a75d0, check_options=0, latency=latency@entry=0) at checks.c:92
#12 0x0000561a5432510b in handle_timed_event (event=event@entry=0x561a55f48590) at events.c:1226
#13 0x0000561a54325c53 in event_execution_loop () at events.c:1165
#14 0x0000561a54303b1d in main (argc=<optimized out>, argv=<optimized out>) at nagios.c:846
Locked