Bug 976946 - BD xlator causes build to fail on debian due to implicit int to pointer conversion
Summary: BD xlator causes build to fail on debian due to implicit int to pointer conve...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: build
Version: 3.4.0-beta
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-22 01:33 UTC by Louis Zuckerman
Modified: 2014-04-17 13:13 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.4.3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-17 13:13:10 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)
Check for declared functions instead of functions in the binary lib (519 bytes, patch)
2013-06-22 19:29 UTC, Niels de Vos
no flags Details | Diff

Description Louis Zuckerman 2013-06-22 01:33:54 UTC
Description of problem:

Here is the end of the build log from the Ubuntu build server. (Full log: https://launchpadlibrarian.net/143078766/buildlog_ubuntu-precise-amd64.glusterfs_3.4.0beta3-beta3~precise3_FAILEDTOBUILD.txt.gz)

=================================
Built successfully
******************************************************************************
Finished at 20130622-0036
Build needed 00:05:16, 153272k disk space
Function `lvm_lv_from_name' implicitly converted to pointer at bd_map.c:175



Our automated build log filter detected the problem(s) above that will
likely cause your package to segfault on architectures where the size of
a pointer is greater than the size of an integer, such as ia64 and amd64.

This is often due to a missing function prototype definition.

Since use of implicitly converted pointers is always fatal to the application
on ia64, they are errors.  Please correct them for your next upload.

More information can be found at:
http://wiki.debian.org/ImplicitPointerConversions

=================================

Version-Release number of selected component (if applicable):

3.4.0beta3

How reproducible:

Every time on amd64 arch.

Comment 1 Niels de Vos 2013-06-22 19:29:39 UTC
Created attachment 764172 [details]
Check for declared functions instead of functions in the binary lib

That indicates that lvm_lv_from_name has not been declared in lvm2app.h.

The build log shows:

> liblvm2-dev amd64 2.02.66-4ubuntu7.3

The source for 2.02.66:
- https://git.fedorahosted.org/cgit/lvm2.git/tree/liblvm/lvm2app.h?id=v2_02_66

You will see that there is no lvm_lv_from_name function listed. The function exists in the library, but is not added to the header until 2.02.79 (commit 2ac0e8f9):
- https://git.fedorahosted.org/cgit/lvm2.git/diff/liblvm/lvm2app.h?id=2ac0e8f9

$ git tag --contains 2ac0e8f9
v2_02_79
...

So, either the dependency should be on lvm2-2.02.79 or newer, or the patch that is attached can be posted for review so that the detection in configure.ac is handled more securely.

Could you check the patch and let me know if that is your preference? An alternative would be to define the lvm_lv_from_name function if it is available while linking, but unavailable in the header. This would allow you to enable the bd-xlator with lvm2-2.02.66.

Comment 2 Anand Avati 2013-06-24 12:50:36 UTC
REVIEW: http://review.gluster.org/5250 (build: declare lvm_lv_from_name() if it is missing from lvm2app.h) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 3 Niels de Vos 2013-06-24 12:52:12 UTC
Louis, could you test that change in your build environment?

Comment 4 Louis Zuckerman 2013-06-24 22:35:52 UTC
The build succeeded!

https://launchpad.net/~semiosis/+archive/ubuntu-glusterfs-3.4/+build/4743064

Thanks again Niels & all.

Comment 5 Anand Avati 2013-06-27 11:38:28 UTC
COMMIT: http://review.gluster.org/5250 committed in master by Vijay Bellur (vbellur) 
------
commit 75ee14ffbe362c41be096eca9a2fef1ec7e8db94
Author: Niels de Vos <ndevos>
Date:   Mon Jun 24 14:34:50 2013 +0200

    build: declare lvm_lv_from_name() if it is missing from lvm2app.h
    
    The bd-xlator can not be built successfully on certain Debian
    distributions due to a missing declaration of lvm_lv_from_name(). This
    function is available for linking, but it does not exist in the header
    file.
    
    This change adds a detection for lvm_lv_from_name() in both the library
    for linking, and the declaration in the header file. If the 1st is
    missing, the bd-xlator can not be built, and if only the 2nd one is
    missing, we'll declare lvm_lv_from_name() ourselves. This makes it
    possible to build the bd-xlator on the affected Debian distributions
    too.
    
    Change-Id: I0c823a7861b02bb5d9c1abb76ebfff92f272f9eb
    BUG: 976946
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/5250
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 6 Anand Avati 2013-06-27 11:51:43 UTC
REVIEW: http://review.gluster.org/5260 (build: declare lvm_lv_from_name() if it is missing from lvm2app.h) posted (#1) for review on release-3.4 by Niels de Vos (ndevos)

Comment 7 Anand Avati 2013-06-27 12:40:19 UTC
COMMIT: http://review.gluster.org/5260 committed in release-3.4 by Vijay Bellur (vbellur) 
------
commit 505f57e07c8096f74ddf5c43679b57bc978d501c
Author: Niels de Vos <ndevos>
Date:   Thu Jun 27 13:44:18 2013 +0200

    build: declare lvm_lv_from_name() if it is missing from lvm2app.h
    
    The bd-xlator can not be built successfully on certain Debian
    distributions due to a missing declaration of lvm_lv_from_name(). This
    function is available for linking, but it does not exist in the header
    file.
    
    This change adds a detection for lvm_lv_from_name() in both the library
    for linking, and the declaration in the header file. If the 1st is
    missing, the bd-xlator can not be built, and if only the 2nd one is
    missing, we'll declare lvm_lv_from_name() ourselves. This makes it
    possible to build the bd-xlator on the affected Debian distributions
    too.
    
    Change-Id: If1845f6b6d676793677ebbcc6daf9ff12f7c3fd6
    BUG: 976946
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/5260
    Reviewed-by: Vijay Bellur <vbellur>
    Tested-by: Gluster Build System <jenkins.com>

Comment 8 Niels de Vos 2014-04-17 13:13:10 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.4.3, please reopen this bug report.

glusterfs-3.4.3 has been announced on the Gluster Developers mailinglist [1], packages for several distributions should already be or become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

The fix for this bug likely to be included in all future GlusterFS releases i.e. release > 3.4.3. In the same line the recent release i.e. glusterfs-3.5.0 [3] likely to have the fix. You can verify this by reading the comments in this bug report and checking for comments mentioning "committed in release-3.5".

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/5978
[2] http://news.gmane.org/gmane.comp.file-systems.gluster.user
[3] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/6137


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