Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zabbix agent 4.0.7 and 4.2.1 breaks support for libzbxpgsql.so #139

Closed
Trikke76 opened this issue Apr 19, 2019 · 7 comments · Fixed by #141
Closed

Zabbix agent 4.0.7 and 4.2.1 breaks support for libzbxpgsql.so #139

Trikke76 opened this issue Apr 19, 2019 · 7 comments · Fixed by #141

Comments

@Trikke76
Copy link

https://support.zabbix.com/browse/ZBX-16028

14538:20190419:094458.679 Starting Zabbix Agent [staging]. Zabbix 4.0.7 (revision 92831).
14538:20190419:094458.679 **** Enabled features ****
14538:20190419:094458.679 IPv6 support: YES
14538:20190419:094458.679 TLS support: YES
14538:20190419:094458.679 **************************
14538:20190419:094458.679 using configuration file: /etc/zabbix/zabbix_agentd.conf
14538:20190419:094458.681 cannot load module "libzbxpgsql.so": /usr/lib64/zabbix/modules/libzbxpgsql.so: undefined symbol: __zbx_zbx_snprintf

it seems the module is broken since zabbix 4.0.7 not sure they will revert changes they made. if not it would be nice if you could create a new package

@i-ky
Copy link
Contributor

i-ky commented Apr 19, 2019

You can try objcopy --redefine-sym __zbx_zbx_snprintf=zbx_snprintf libzbxpgsql.so.

@Trikke76
Copy link
Author

Thx @i-ky
tried it but it doesn't seem to work.
Zabbix is also unwilling to fix it on there side so it would be great if a new module was made to support latest changes

https://support.zabbix.com/browse/ZBX-16028

@i-ky
Copy link
Contributor

i-ky commented Apr 22, 2019

Seems I have found a dirty workaround:

  1. Open libzbxpgsql.so in hex editor;
  2. Find __zbx_zbx_snprintf;
  3. Remove 6 bytes corresponding to __zbx_ prefix;
  4. Add 6 (for every character of __zbx_) zero bytes (00) after zbx_snprintf;
  5. Save your work.

After that module can be loaded without "undefined symbol" error.

#136 seems to be stuck, so we may not see a new release for a while.

@ghost
Copy link

ghost commented Apr 23, 2019

Hi.

It's possible to have a packaged version with the workaround.

We have many postgres server, and modifyng the library on every f them would be a very long work

@OrangeDog
Copy link
Collaborator

@i-ky unfortunately objcopy doesn't work on dynamic symbols.

@i-ky
Copy link
Contributor

i-ky commented Apr 23, 2019

@OrangeDog, it is a dynamic symbol, but not one provided by libzbxpgsql.so. Seems that objcopy does not work for undefined symbols.

@OrangeDog
Copy link
Collaborator

@cobra1978 you can easily make your own package with the patched binary.
Use rpmrebuild or dpkg-deb as appropriate. I recommend adding e.g. +ZBX-16028 to the version.

stsnel added a commit to UtrechtUniversity/ilab-catalog that referenced this issue May 10, 2023
We need to have a version of libzbxpgsql.so with a binary patch to
work around a compatibility issue with Zabbix 4. See
zabbix-tools/libzbxpgsql#139 (comment)
for details.
stsnel added a commit to UtrechtUniversity/yoda that referenced this issue May 10, 2023
We need to have a version of libzbxpgsql.so with a binary patch to
work around a compatibility issue with Zabbix 4. See
zabbix-tools/libzbxpgsql#139 (comment)
for details.
stsnel added a commit to UtrechtUniversity/yoda that referenced this issue May 11, 2023
We need to have a version of libzbxpgsql.so with a binary patch to
work around a compatibility issue with Zabbix 4. See
zabbix-tools/libzbxpgsql#139 (comment)
for details.
stsnel added a commit to UtrechtUniversity/yoda that referenced this issue May 24, 2023
We need to have a version of libzbxpgsql.so with a binary patch to
work around a compatibility issue with Zabbix 4. See
zabbix-tools/libzbxpgsql#139 (comment)
for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants