[ZBX-5473] Zabbix agent crash under FreeBSD when start it with "-p" Created: 2012 Aug 21  Updated: 2017 May 30  Resolved: 2012 Aug 30

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 2.0.1
Fix Version/s: 2.0.3rc1, 2.1.0

Type: Incident report Priority: Major
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: crash, freebsd
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

FreeBSD 8.1, 9.0



 Description   

Reported in forum (in Russian) http://www.zabbix.com/forum/showthread.php?p=107384

Affected agent version: 2.0.1
Version 2.0.0 is OK

test# zabbix_agentd -p
agent.hostname [s|test.dom]
...
vfs.fs.discovery [s|{
"data":[
{
"

{#FSNAME}":"\/",
"{#FSTYPE}":"ufs"},
{
"{#FSNAME}

":"\/dev",
"

{#FSTYPE}":"devfs"},
{
"{#FSNAME}":"\/tmp",
"{#FSTYPE}

":"ufs"},
{
"

{#FSNAME}":"\/usr",
"{#FSTYPE}":"ufs"},
{
"{#FSNAME}

":"\/var",
"

{#FSTYPE}":"ufs"},
{
"{#FSNAME}":"\/files",
"{#FSTYPE}

":"ufs"},
{
"

{#FSNAME}

":"\/home",
"

{#FSTYPE}

":"ufs"},]}]
Segmentation fault (core dumped)



 Comments   
Comment by Alexei Vladishev [ 2012 Aug 28 ]

I confirm this problem under FreeBSD 8.2 386 and Ubuntu 12.04 32bit. Also:

FreeBSD:
zabbix_agentd -t vfs.dev.read
Segmentation fault (core dumped)

Ubuntu:
zabbix_agentd -t vfs.dev.read
Segmentation fault (core dumped)

Comment by Alexei Vladishev [ 2012 Aug 28 ]

It seems that the problem is in diskstat_shm_init(), which does

if (1 == (collector>diskstat_shmid = zbx_shmget(shm_key, shm_size)))

but the collector is not initialized, so the line causes code dump.

Function vfs_dev_rw() calls collector_diskdevice_get(), which tries to initialize data if collector is not started:

if (0 == DISKDEVICE_COLLECTOR_STARTED(collector))

{ diskstat_shm_init(); // Here is the problem. The function assumed that collector structure is initialized, see above. }

else

{ diskstat_shm_reattach(); }
Comment by richlv [ 2012 Aug 29 ]

segfaults in ZBX-5502 might be related

Comment by Alexander Vladishev [ 2012 Aug 30 ]

Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5473

<zalex> successfully tested on fbsd 8.1

Comment by dimir [ 2012 Sep 05 ]

Successfully tested. Please review my small change in r30114.

<Sasha> Thanks, CLOSED

Comment by Alexander Vladishev [ 2012 Sep 05 ]

Fixed in pre-2.0.3 r30117 and pre-2.1.0 (trunk) r30118.

Comment by Oleksii Zagorskyi [ 2012 Oct 05 ]

This change caused another problem - ZBX-5661

Generated at Fri Mar 29 09:38:53 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.