RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1222605 - Often crash due to load_interfaces() symbol clash
Summary: Often crash due to load_interfaces() symbol clash
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openchange
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Milan Crha
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-18 15:31 UTC by Milan Crha
Modified: 2015-11-19 07:58 UTC (History)
4 users (show)

Fixed In Version: openchange-2.0-5.el7
Doc Type: Bug Fix
Doc Text:
Cause: crash due to the same public symbol being exported from multiple libraries with different API and functionality Consequence: two libraries export the same symbol (function) name, but has different API of the function and the code is also different Fix: rename the function in the openchange to not clash with the other library Result: the two libraries can be used together in one application without causing it to crash
Clone Of:
Environment:
Last Closed: 2015-11-19 07:58:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
test.zip (558 bytes, application/zip)
2015-05-27 19:48 UTC, Milan Crha
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2226 0 normal SHIPPED_LIVE evolution bug fix and enhancement update 2015-11-19 08:37:43 UTC

Description Milan Crha 2015-05-18 15:31:15 UTC
As is reported from CentOS quite often:
https://retrace.fedoraproject.org/faf/problems/528496/

There is a symbol clash, which, in runtime, can lead to incorrect symbol use (from a different library than the code was compiled with), which could lead to this crash. There is an upstream fix for this, with a local fedora fix for other symbols as well.

Backtrace from the faf server:

> 1 	load_interfaces 	/lib64/libmapi-openchange.so.0 	libmapi/socket/interface.c 	197
> 2 	_nss_wins_gethostbyname_r 	/lib64/libnss_wins.so.2 	../nsswitch/wins.c 	69
> 3 	gaih_inet 	/lib64/libc.so.6 	../sysdeps/posix/getaddrinfo.c 	975
> 4 	getaddrinfo 	/lib64/libc.so.6 	../sysdeps/posix/getaddrinfo.c 	2421
> 5 	do_lookup_by_name 	/lib64/libgio-2.0.so.0 	/usr/src/debug/glib-2.36.3/gio/gthreadedresolver.c 	83
> 6 	g_task_thread_pool_thread 	/lib64/libgio-2.0.so.0 	/usr/src/debug/glib-2.36.3/gio/gtask.c 	1244
> 7 	g_thread_pool_thread_proxy 	/lib64/libglib-2.0.so.0 	0x6e0fc
Build id: bed8226d8fa07f402817572807114314247d749d 	-
> 8 	g_thread_proxy 	/lib64/libglib-2.0.so.0 	0x6d745
Build id: bed8226d8fa07f402817572807114314247d749d 	-
> 9 	start_thread 	/lib64/libpthread.so.0 	/usr/src/debug/glibc-2.17-c758a686/nptl/pthread_create.c 	308
> 10 	__clone 	/lib64/libc.so.6 	../sysdeps/unix/sysv/linux/x86_64/clone.S

Comment 2 Milan Crha 2015-05-27 14:25:45 UTC
Devel-acking, there are fedora patches for the symbol clash available, thus easy to be used.

Comment 3 Milan Crha 2015-05-27 19:48:30 UTC
Created attachment 1030779 [details]
test.zip

This is the simplest test case. To reproduce the crash:
a) have installed openchange-devel and samba-libs (openchange should add it)
b) unpack the attachment into any folder, it'll create there a Makefile and
   a test.c file
c) run in that folder:
   $ make

This runs both 'survive' and 'crash' parts of the Makefile and if everything works, then it prints 'All okay'. The current result of the 'make' is:
   $ make
   gcc test.c -g -O0 -o test -lsmbconf -lmapi-openchange && ./test
   no talloc stackframe at ../source3/lib/interface.c:503, leaking memory
   Bye
   gcc test.c -g -O0 -o test -lmapi-openchange -lsmbconf && ./test
   /bin/sh: line 1: 14570 Segmentation fault      (core dumped) ./test
   make: *** [crash] Error 139

I ignore the "no talloc stackframe" warning, that's not important for us.

The important thing is that both libsmbconf and libmapi-openchange provide the public function load_interfaces() with different prototypes. The samba version is without any arguments while the mapi-openchange expects some arguments, which is the reason why the second call crashes. As can be seen from the above output, the only difference is the order of the libraries in the link time.

The changes I want to use simply rename clashing symbols in the OpenChange, by adding a unique prefix to them, thus both above tests will survive.

Comment 6 errata-xmlrpc 2015-11-19 07:58:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2226.html


Note You need to log in before you can comment on or make changes to this bug.