Bug 1222605
| Summary: | Often crash due to load_interfaces() symbol clash | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Milan Crha <mcrha> | ||||
| Component: | openchange | Assignee: | Milan Crha <mcrha> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Desktop QE <desktop-qa-list> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 7.1 | CC: | jeischma, lmiksik, mcrha, tpelka | ||||
| Target Milestone: | rc | Keywords: | Patch | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| 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
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2015-11-19 07:58:26 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Milan Crha
2015-05-18 15:31:15 UTC
Devel-acking, there are fedora patches for the symbol clash available, thus easy to be used. 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.
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 |