PDA

View Full Version : Can't build 1.1a5 client on AMD64 / fBSD 5.3p5


Myke
17-02-2005, 09:19
[1:13:313]root@p0:/home/zabbix/zabbix-1.1alpha5> make
Making all in src/zabbix_agent
gcc -o ../../bin/zabbix_agent -g -O2 -I../../include zabbix_agent.c sysinfo.c ../../include/log.c ../../include/cfg.c ../../include/security.c ../../include/snprintf.c ../../include/md5.c -Wall
sysinfo.c: In function `SHAREDMEM':
sysinfo.c:1733: warning: passing arg 4 of `sysctl' from incompatible pointer type
sysinfo.c: In function `TOTALMEM':
sysinfo.c:1792: warning: passing arg 4 of `sysctl' from incompatible pointer type
sysinfo.c: In function `FREEMEM':
sysinfo.c:1874: warning: passing arg 4 of `sysctl' from incompatible pointer type
sysinfo.c: In function `KERNEL_MAXFILES':
sysinfo.c:1897: warning: dereferencing type-punned pointer will break strict-aliasing rules
sysinfo.c: In function `KERNEL_MAXPROC':
sysinfo.c:1920: warning: dereferencing type-punned pointer will break strict-aliasing rules
sysinfo.c: In function `UPTIME':
sysinfo.c:1958: warning: dereferencing type-punned pointer will break strict-aliasing rules
sysinfo.c: In function `process':
sysinfo.c:320: warning: 'function_str' might be used uninitialized in this function
../../include/snprintf.c: In function `dopr':
../../include/snprintf.c:174: error: incompatible types in assignment
../../include/snprintf.c: At top level:
../../include/snprintf.c:161: warning: 'dopr' defined but not used
*** Error code 1

Stop in /usr/home/zabbix/zabbix-1.1alpha5/src/zabbix_agent.
*** Error code 1

Stop in /usr/home/zabbix/zabbix-1.1alpha5.
[1:14:314]root@p0:/home/zabbix/zabbix-1.1alpha5>

Alexei
17-02-2005, 10:07
In snprintf.c, try to insert:

#define VA_COPY(dest, src) __va_copy(dest, src)
or
#define VA_COPY(dest, src) (dest) = (src)

just before

static size_t dopr(char *buffer, size_t maxlen, const char *format,
va_list args_in);

Alternatively you may exclude snprintf.c from Makefiles, this should work if your OS already supports snprintf().

Myke
17-02-2005, 10:16
I posted this as a new thread because the problem looked completely different (to me) from the problems others were having with AMD64

It compiles now... I'll be testing shortly.

Myke

Myke
17-02-2005, 11:03
068796:20050217:034854 zabbix_agentd started
068799:20050217:034854 zabbix_agentd 68799 started
068800:20050217:034854 zabbix_agentd 68800 started
068797:20050217:034854 zabbix_agentd 68797 started
068801:20050217:034854 zabbix_agentd 68801 started
068798:20050217:034854 zabbix_agentd 68798 started
068796:20050217:035133 One child process died. Exiting ...
068798:20050217:035133 Got signal. Exiting ...
068797:20050217:035133 Got signal. Exiting ...
068799:20050217:035133 Got signal. Exiting ...
068801:20050217:035133 Got signal. Exiting ...

This happens when I'm adding the hosts using the default/stock Unix template from 1.0.

Strangely, I copied the agent binary to a uni-processor AMD64 and seems to work alright.. (Source machine is a Dual Opto 242)

I'll update again in the ... 'morning' (0400 here now!). 'night.

Alexei
17-02-2005, 11:18
I'm about to release 1.1alpha6. Before doing this, I'd like to fix all important outstanding issues. The crash (you're not the only who reported this) is definitely a priority.

May I ask you to set DebugLevel to 4, restart zabbix_agentd and try to reproduce the crash. Send me the LogFile afterwards.

Thanks.

Myke
17-02-2005, 19:29
073815:20050217:122102 In check_security()
073815:20050217:122102 Connection from [$IP]. Allowed servers [$IP]
073815:20050217:122102 Before read()
073815:20050217:122102 After read() 2 [23]
073815:20050217:122102 Got line:cksum[/etc/inetd.conf]
073810:20050217:122102 One child process died. Exiting ...
073811:20050217:122102 Got signal. Exiting ...
073812:20050217:122102 Got signal. Exiting ...
073813:20050217:122102 Got signal. Exiting ...
073814:20050217:122102 Got signal. Exiting ...

I managed to reproduce this a number of times. I turned off all the cksums and the agent ran fine for a while. Then I recompiled without ../../include/snprintf.c * 2 in the Makefile so see if that was related - appears not to be. Still crashes on cksum.

Otherwise, at least now zabbix runs on this machines and is therefore usable albeit in a less functional way.

Do you still want me to send you the whole log? This is really the only interesting part, and it's consistent.

Edit: I'm adding that cksum dies on any of the checksummed files, it's not specific to any of the files checked by the stock Unix template.

Alexei
17-02-2005, 20:37
Ok, it seems that problems is in function which calculates file checksum. Thanks for the debug file!

I'll try to fix it ASAP. Meanwhile I'd suggest using of md5sum
, which is supported in 1.1 alphas.

Alexei
17-02-2005, 20:47
This maybe useful:

https://sourceforge.net/tracker/?func=detail&atid=378683&aid=820268&group_id=23494

I'm testing it right now...

Alexei
17-02-2005, 21:05
Do the following change in file sysinfo.c, function CKSUM():

/* AV Crashed under 64 platforms. Must be 32 bit! */
/* register u_long crc, len;*/
register uint32_t crc, len;

Please, let me know if it fixed reported issue. Thanks!

Myke
17-02-2005, 21:28
074978:20050217:141858 In check_security()
074978:20050217:141858 Connection from [$IP]. Allowed servers [$IP]
074978:20050217:141858 Before read()
074978:20050217:141858 After read() 2 [20]
074978:20050217:141858 Got line:cksum[/usr/bin/ssh]
074978:20050217:141858 Sending back:4179435613.000000

Altho - I saw your link to sf.net, so I changed ALL instances and then left it to run while I hit the shower... when I returned, I saw your posting, but mine also is obviously working.

I'll try on fBSD/sparc64 in a couple weeks too.

Thanks!