[ZBX-2946] agent does not compile on freebsd 7.3 Created: 2010 Aug 26  Updated: 2017 May 30  Resolved: 2011 Aug 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Installation (I)
Affects Version/s: 1.8.3
Fix Version/s: 1.8.6

Type: Incident report Priority: Major
Reporter: Aleksandrs Saveljevs Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive Archive.zip    

 Description   

Building an agent on FreeBSD 7.3 fails with the following error:

Making all in zabbix_agent
cc -DZABBIX_DAEMON -O2 -fno-strict-aliasing -pipe -I/usr/local/include -L/usr/local/lib -o zabbix_agentd zabbix_agentd-active.o zaix_agentd-cpustat.o zabbix_agentd-diskdevices.o zabbix_agentd-interfaces.o zabbix_agentd-perfstat.o zabbix_agentd-vmstats.o zabbibix_agentd-zabbix_agentd.o zabbix_agentd-zbxconf.o zabbix_agentd-listener.o zabbix_agentd-eventlog.o ../../src/libs/zbxsysinfo/libzsrc/libs/zbxsysinfo/freebsd/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/l src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs s/libzbxcomms.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxcommon/l /libzbxjson.a -lkvm -lm -ldevstat -liconv
../../src/libs/zbxnix/libzbxnix.a(fatal.o)(.text+0xe2): In function `print_fatal
: undefined reference to `backtrace'
../../src/libs/zbxnix/libzbxnix.a(fatal.o)(.text+0xf6): In function `print_fatal
: undefined reference to `backtrace_symbols'

      • Error code 1

Problem originally described in http://www.zabbix.com/forum/showthread.php?t=18934.



 Comments   
Comment by Aleksandrs Saveljevs [ 2010 Sep 02 ]

Could not reproduce. The agent builds correctly from both our sources and FreeBSD ports collection.

Apparently, the original reporters' systems have execinfo.h, while our FreeBSD 7.3 does not. So we need to find out how did they get this header file on their systems.

Comment by Dmitry Yakovlev [ 2010 Sep 02 ]

Hello, I can give you access to a computer where the error comes out. (dilmas dot kras at gmail dot com, I am from Russia)

Comment by Aleksandrs Saveljevs [ 2010 Sep 02 ]

Thank you! I have sent you an email.

Comment by Aleksandrs Saveljevs [ 2010 Sep 02 ]

Header file /usr/local/include/execinfo.h comes from /usr/ports/devel/libexecinfo port and maybe we will have to specify -lexecinfo when linking.

Comment by Aleksandrs Saveljevs [ 2010 Sep 06 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/zbx-2946-freebsd73.

Comment by Aleksandrs Saveljevs [ 2010 Sep 06 ]

Merged into pre-1.8.4 in r14303.

Comment by Artem Vinokurov [ 2010 Sep 13 ]

I have same errors. Aleksandrs how i can resolve my problem, where i can download pre-1.8.4 in r14303?

Comment by Aleksandrs Saveljevs [ 2010 Sep 13 ]

Artem, you have two options:

(1) download a nightly pre-1.8.4 build from http://www.zabbix.com/developers.php;
(2) do an svn checkout with "svn checkout svn://svn.zabbix.com/branches/1.8".

In both cases you will get Zabbix sources. Then type:

./bootstrap.sh [only in case (2); this requires that you have autotools and pkg-config installed]
./configure --enable-agent --prefix=/your/install/dir
make install

If you also need to install Zabbix server, please let me know.

Comment by Artem Vinokurov [ 2010 Sep 15 ]

Thanks for the answer Aleksandrs, i have freebsd 6.2 and too many ports need to update for 1.8.3 , so i decide to install zabbix 1.8.2, this version was installed without problem

Comment by Oleksii Zagorskyi [ 2010 Oct 14 ]

Maybe it's not important, but I will share information.
My system: fresh install FreeBSD 8.1-RELEASE #0
I have a ports libexecinfo-1.1_3 (is dependency for samba34-3.4.8).

What I do: edit the Makefile of the port "net-mgmt/zabbix-server" to 1.8.4rc1. (PORTVERSION=1.8.4rc1)
Remove the checksum file "distinfo".
Downloading a file "pre-zabbix-1.8.4rc1.x-14832.tar.gz" and rename to "zabbix-1.8.4rc1.tar.gz" in folder /usr/ports/distfiles
Compile port "net-mgmt/zabbix-agent"
And get this error:

cc -DZABBIX_DAEMON -O2 -pipe -fno-strict-aliasing -I/usr/local/include -L/usr/local/lib -o zabbix_agentd zabbix_agentd-active.o zabbix_agentd-stats.o zabbix_agentd-cpustat.o zabbix_agentd-diskdevices.o zabbix_agentd-interfaces.o zabbix_agentd-perfstat.o zabbix_agentd-vmstats.o zabbix_agentd-logfiles.o zabbix_agentd-zabbix_agentd.o zabbix_agentd-zbxconf.o zabbix_agentd-listener.o zabbix_agentd-eventlog.o ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a ../../src/libs/zbxsysinfo/freebsd/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxjson/libzbxjson.a -lkvm -lm -ldevstat -liconv
../../src/libs/zbxnix/libzbxnix.a(fatal.o)(.text+0xe2): In function `print_fatal_info':
: undefined reference to `backtrace'
../../src/libs/zbxnix/libzbxnix.a(fatal.o)(.text+0xf6): In function `print_fatal_info':
: undefined reference to `backtrace_symbols'

      • Error code 1

Stop in /usr/ports/net-mgmt/zabbix-agent/work/zabbix-1.8.4rc1/src/zabbix_agent.

      • Error code 1

Stop in /usr/ports/net-mgmt/zabbix-agent/work/zabbix-1.8.4rc1/src.

      • Error code 1

Stop in /usr/ports/net-mgmt/zabbix-agent/work/zabbix-1.8.4rc1.

      • Error code 1

Stop in /usr/ports/net-mgmt/zabbix-agent.

      • Error code 1

Stop in /usr/ports/net-mgmt/zabbix-agent.

If you I compile from source according to the documentation, then i do not have any problems.
The same part without error:

gcc -DZABBIX_DAEMON -g -O2 -I/usr/local/include -L/usr/local/lib -o zabbix_agentd zabbix_agentd-active.o zabbix_agentd-stats.o zabbix_agentd-cpustat.o zabbix_agentd-diskdevices.o zabbix_agentd-interfaces.o zabbix_agentd-perfstat.o zabbix_agentd-vmstats.o zabbix_agentd-logfiles.o zabbix_agentd-zabbix_agentd.o zabbix_agentd-zbxconf.o zabbix_agentd-listener.o zabbix_agentd-eventlog.o ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a ../../src/libs/zbxsysinfo/freebsd/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxjson/libzbxjson.a -lkvm -lm -ldevstat -liconv

Comment by MIt Rowe [ 2010 Oct 20 ]

With regards to the freebsd compile issue, if one makes libexecinfo a dependancy of the port, and add -lexecinfo to the zabbix-agent makefile, the error disappears.

Perhaps the freebsd zabbix-agent port maintainer [email protected] can arrange this to be added if he concurs.

Comment by Oleksii Zagorskyi [ 2011 Jan 31 ]

Problem is still persist. Problem related not only to the agent and to the server too.
Envirolment: FreeBSB-8.1 Release, libexecinfo-1.1_3 installed (is dependency for samba34-3.4.8).

Tested 1.8.4 release of zabbix_agent. It not present in the ports collection, but it easy to copy a folders zabbix-server and zabbix-agent with another names and manually edit Makefile to point at 1.8.4 distribution.

So, what i figured out.
When a `make` executed from ports collection finds a <execinfo.h>:
configure:4545: checking for execinfo.h
configure:4553: result: yes

but finds not a 'libexecinfo' library (-lexecinfo):
configure:5525: cc -o conftest -O2 -pipe -fno-strict-aliasing -I/usr/local/include conftest.c -lexecinfo -ldevstat >&5
/usr/bin/ld: cannot find -lexecinfo

As results at the end of compilation i get the same error:
../../src/libs/zbxnix/libzbxnix.a(fatal.o)(.text+0xe2): In function `print_fatal_info':
: undefined reference to `backtrace'
../../src/libs/zbxnix/libzbxnix.a(fatal.o)(.text+0xf6): In function `print_fatal_info':
: undefined reference to `backtrace_symbols'

      • Error code 1

When i `configure && make` from the extracted source folder:
configure:4441: checking execinfo.h usability
configure:4458: gcc -c -g -O2 conftest.c >&5
conftest.c:102:22: error: execinfo.h: No such file or directory

and the same for the 'libexecinfo' library:
configure:5525: gcc -o conftest -g -O2 conftest.c -lexecinfo -ldevstat >&5
/usr/bin/ld: cannot find -lexecinfo

I'll attach 'config.log' and 'configure+make-output.txt' files for both of test after you reopen this issue (now unfortunately i can't).

It seems the previous solution, provided in a 14304 revision is not very gud.
Need to correctly detect presence of header file and correctly link the library.

P.S. Library and header file of libexecinfo-1.1_3 port is installed at the "/usr/local" path.
When i manually sym link the library and the header files to the "/usr" path - then zabbix_server compiled successfully with "backtrace" support.
Then if i'm forced to make zabbix_server crash - i see some useful backtrace information (certainly much less than in Linux):

48228:20110130:215350.872 Got signal [signal:11(SIGSEGV),reason:65537,refaddr:0x0]. Crashing ...
48228:20110130:215350.872 ====== Fatal information: ======
48228:20110130:215350.872 program counter not available for this architecture
48228:20110130:215350.872 === Registers: ===
48228:20110130:215350.872 register dump not available for this architecture
48228:20110130:215350.872 === Backtrace: ===
48228:20110130:215350.873 7: 0x8085316 <child_signal_handler+326> at /usr/local/sbin/zabbix_server
48228:20110130:215350.873 6: 0xbfbfffb4
48228:20110130:215350.873 5: 0x8060ff1 <main_housekeeper_loop+1601> at /usr/local/sbin/zabbix_server
48228:20110130:215350.873 4: 0x805516e <MAIN_ZABBIX_ENTRY+1646> at /usr/local/sbin/zabbix_server
48228:20110130:215350.873 3: 0x8085075 <daemon_start+597> at /usr/local/sbin/zabbix_server
48228:20110130:215350.873 2: 0x80555a1 <main+289> at /usr/local/sbin/zabbix_server
48228:20110130:215350.873 1: 0x8051687 <_start+167> at /usr/local/sbin/zabbix_server
48228:20110130:215350.873 0: 0x80515f5 <_start+21> at /usr/local/sbin/zabbix_server
48228:20110130:215350.873 === Memory map: ===
48228:20110130:215350.873 memory map not available for this platform
48228:20110130:215350.873 ================================
48213:20110130:215350.877 One child process died (PID:48228,exitcode/signal:65280). Exiting ...
48213:20110130:215350.877 zbx_on_exit() called

And one additional question. How do you think - it is necessary that the zabbix-[server|proxy|agent] ports had a forced dependence of the libexecinfo port? I.e. - it is useful backtrace information under FreeBSD?

Why i do that > i want to be zabbix[server|proxy|agent|frontend] ports maintainer

Comment by richlv [ 2011 Jan 31 ]

apparently there are some problems, reopening

Comment by Oleksii Zagorskyi [ 2011 Jan 31 ]

"Archive.zip" with logs attached.

Comment by Artem Vinokurov [ 2011 Jan 31 ]

for 1.8.3, /usr/ports/devel/libexecinfo/ can be deleted during server installation, and restored afterwards
------------------
Для версии 1.8.3 на время установки сервера удаляем /usr/ports/devel/libexecinfo/ затем ставим обратно

Comment by Artem Vinokurov [ 2011 Jan 31 ]

apparently, might also help for 1.8.4
-------------
судя по ошибкам для 1.8.4 тоже должно помочь

Comment by Oleksii Zagorskyi [ 2011 Feb 27 ]

Just for case. FreeBSD ports issue tracker has a issue request registered. http://www.freebsd.org/cgi/query-pr.cgi?pr=153688
There is a patch for a configure script.
So, may be you can take it into account.

Comment by Oleksii Zagorskyi [ 2011 May 22 ]

I think this issue can be closed as... mmm, i don't know maybe as "won't fix" or so.
This problem related only to the FreeBSD port of zabbix-*
See to the my latest post on the PR156519 http://www.freebsd.org/cgi/query-pr.cgi?pr=156519

The last thought that I want to share with developers: maybe handling of "libexecinfo" should be performed by using m4 script as for other external libraries, for the correct finding and linking on the different systems out of the box?

Comment by Oleksii Zagorskyi [ 2011 Aug 04 ]

My suggestion described in the PR156519 (see link in the previous post) taken into account by Jim Riggs in a new PR159515 (update to 1.8.6). Link is http://www.freebsd.org/cgi/query-pr.cgi?pr=159515

So let's wait an applying such changes in the FreeBSD ports collection and finally close this issue.
I'll inform here when this happens.

Comment by richlv [ 2011 Aug 11 ]

if everything's fixed on zabbix side i'd say we should close this one. is it so ?

Comment by Oleksii Zagorskyi [ 2011 Aug 11 ]

Once I suggested to close this issue but anyone not take that into account .
In the last comment I decided to wait a good reason to finally close the issue, but seems at this time it's already superfluous

But I would be happy to close it right now without the waiting if you agree

Comment by richlv [ 2011 Aug 11 ]

closing we like

Comment by Oleksii Zagorskyi [ 2011 Aug 11 ]

Finally will be fixed in the FreeBSD ports collection for Zabbix version 1.8.6

Comment by richlv [ 2011 Aug 27 ]

reopen to deal with "fix for" version again

Comment by Oleksii Zagorskyi [ 2011 Oct 15 ]

Finally Zabbix 1.8.8 updated in the FreeBSD port collection !!!
All mentioned problems fixed.

Versions 1.8.6 and 1.8.7 were not included in the FreeBSD port collection.

http://www.freebsd.org/cgi/query-pr.cgi?pr=161460&cat=ports

Generated at Fri Apr 26 02:58:40 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.