SegFaults in p3scan and ping when no internet access

NethServer Version: NS7
Module: p3scan ping

A couple of days ago, it looks like my cable provider interrupted my service for a while. During this period, I started getting segfaults from both p3scan and ping:

May 14 05:35:51 Nethserver kernel: p3scan[10769]: segfault at 30 ip 00007f7dc67906b1 sp 00007ffc66c81e70 error 4 in libssl.so.1.0.1e[7f7dc674b000+64000]
May 14 05:36:02 Nethserver kernel: e1000e: eno1 NIC Link is Down
May 14 05:36:20 Nethserver kernel: p3scan[10773]: segfault at 30 ip 00007f7dc67906b1 sp 00007ffc66c81e70 error 4
May 14 05:36:20 Nethserver kernel: p3scan[10774]: segfault at 30 ip 00007f7dc67906b1 sp 00007ffc66c81e70 error 4
May 14 05:36:20 Nethserver kernel: in libssl.so.1.0.1e[7f7dc674b000+64000]
May 14 05:36:20 Nethserver kernel: in libssl.so.1.0.1e[7f7dc674b000+64000]
May 14 05:36:20 Nethserver kernel:
May 14 05:36:21 Nethserver kernel: e1000e: eno1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
May 14 05:36:36 Nethserver ddclient[1389]: WARNING:  cannot connect to myip.dnsdynamic.org:80 socket: IO::Socket::INET: Bad hostname 'myip.dnsdynamic.org'
May 14 05:36:49 Nethserver kernel: p3scan[10789]: segfault at 30 ip 00007f7dc67906b1 sp 00007ffc66c81e70 error 4 in libssl.so.1.0.1e[7f7dc674b000+64000]

Note, even though the interface was active again @ 05:36:21, there didn’t appear to be any connectivity for a while following that.

May 14 05:40:27 Nethserver collectd[1036]: ping plugin: host 64.6.65.6 has not answered 30 PING requests, triggering resolve
May 14 05:40:27 Nethserver kernel: ping[1038]: segfault at b00002000 ip 00007f6569b48020 sp 00007f6568f20a20 error 4 in liboping.so.0.2.9[7f6569b45000+4000]
May 14 05:40:27 Nethserver systemd: collectd.service: main process exited, code=killed, status=11/SEGV
May 14 05:40:27 Nethserver systemd: Unit collectd.service entered failed state.
May 14 05:40:27 Nethserver systemd: collectd.service failed.
May 14 05:40:27 Nethserver systemd: collectd.service holdoff time over, scheduling restart.

In all, I had this reported by logwatch:

--------------------- Kernel Begin ------------------------ 

 
 WARNING:  Segmentation Faults in these executables
    p3scan :  16 Time(s)
    ping :  59 Time(s)
 
 ---------------------- Kernel End ------------------------- 

Cheers.

I’ve seen collectd ping plugin segfaults on a test machine in the past. A quick search didn’t find anything relevant and I failed to reproduce the issue, so I forgot about it.
It seems hard to debug collectd. Some tips here: