Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4593

kudu-python is built with the system C++ compiler, which may not be ABI-compatible with the toolchain C++ compiler

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.8.0
    • Fix Version/s: Impala 2.9.0
    • Component/s: Infrastructure
    • Labels:
      None

      Description

      I ran into this issue just now: importing kudu fails because of an unresolved symbol.

      The issue seems to be that my system C++ is much newer than gcc-4.9.2 and they have different C++ ABIs (or something along those lines). One workaround is to manually override the C compilers.

      CC=$IMPALA_TOOLCHAIN/gcc-4.9.2/bin/gcc CXX=$IMPALA_TOOLCHAIN/gcc-4.9.2/bin/g++ python infra/python/bootstrap_virtualenv.py
      

        Issue Links

          Activity

          Hide
          tarmstrong Tim Armstrong added a comment -

          IMPALA-4593,IMPALA-4635: fix some python build issues

          Build C/C++ packages with toolchain GCC to avoid ABI compatibility
          issues. This requires a multi-step bootstrapping process:
          1. install basic non-C/C++ packages into the virtualenv
          2. use Python 2.7 from the virtualenv to bootstrap the toolchain
          3. use toolchain gcc to build C/C++ packages
          4. build the kudu-python package with toolchain gcc and Cython

          To avoid potentially pulling in cached versions of packages
          built with a different compiler, this patch also disables pip's
          caching. This should not have a significant effect on performance
          since we've enabled ccache and cache downloaded packages in
          infra/python/deps.

          Improve bootstrapping time significantly by using ccache and by
          parallelising the numpy build - the most expensive part of the
          install process. On a system with a warmed-up ccache,
          bootstrapping after deleting infra/python/env takes 1m16s. Previously
          it could take over 5m.

          Testing:
          Tested manually on Ubuntu 16.04 to confirm that it fixes the ABI
          problem mentioned in IMPALA-4593. Initially "import kudu" failed
          in my dev environment. After deleting infra/python/env and
          re-bootstrapping, "import kudu" succeeded.

          Also ran the standard test suite on CentOS 6 and built Impala on
          a range of platforms (CentOS 5,6,7; SLES 11,12; Debian 6,7;
          Ubuntu12.04,14.04,16.04) to make sure nothing broke.

          Change-Id: I9e807510eddeb354069e0478363f649a1c1b75cf
          Reviewed-on: http://gerrit.cloudera.org:8080/6218
          Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
          Tested-by: Impala Public Jenkins

          Show
          tarmstrong Tim Armstrong added a comment - IMPALA-4593 , IMPALA-4635 : fix some python build issues Build C/C++ packages with toolchain GCC to avoid ABI compatibility issues. This requires a multi-step bootstrapping process: 1. install basic non-C/C++ packages into the virtualenv 2. use Python 2.7 from the virtualenv to bootstrap the toolchain 3. use toolchain gcc to build C/C++ packages 4. build the kudu-python package with toolchain gcc and Cython To avoid potentially pulling in cached versions of packages built with a different compiler, this patch also disables pip's caching. This should not have a significant effect on performance since we've enabled ccache and cache downloaded packages in infra/python/deps. Improve bootstrapping time significantly by using ccache and by parallelising the numpy build - the most expensive part of the install process. On a system with a warmed-up ccache, bootstrapping after deleting infra/python/env takes 1m16s. Previously it could take over 5m. Testing: Tested manually on Ubuntu 16.04 to confirm that it fixes the ABI problem mentioned in IMPALA-4593 . Initially "import kudu" failed in my dev environment. After deleting infra/python/env and re-bootstrapping, "import kudu" succeeded. Also ran the standard test suite on CentOS 6 and built Impala on a range of platforms (CentOS 5,6,7; SLES 11,12; Debian 6,7; Ubuntu12.04,14.04,16.04) to make sure nothing broke. Change-Id: I9e807510eddeb354069e0478363f649a1c1b75cf Reviewed-on: http://gerrit.cloudera.org:8080/6218 Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com> Tested-by: Impala Public Jenkins
          Hide
          tarmstrong Tim Armstrong added a comment -

          This is an example of the error:

          Traceback (most recent call last):
            File
          "/home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/_pytest/config.py",
          line 543, in importconftest
              mod = conftestpath.pyimport()
            File
          "/home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/py/_path/local.py",
          line 650, in pyimport
              __import__(modname)
            File "/home/abehm/impala/tests/conftest.py", line 21, in <module>
              from kudu import connect as kudu_connect
            File
          "/home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/kudu/__init__.py",
          line 18, in <module>
              from kudu.client import (Client, Table, Scanner, Session,  # noqa
          ImportError:
          /home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/kudu/client.so:
          undefined symbol: _ZNK4kudu6client10KuduTablet2idB5cxx11Ev
          ERROR: could not load /home/abehm/impala/tests/conftest.py
          
          Show
          tarmstrong Tim Armstrong added a comment - This is an example of the error: Traceback (most recent call last): File "/home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/_pytest/config.py" , line 543, in importconftest mod = conftestpath.pyimport() File "/home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/py/_path/local.py" , line 650, in pyimport __import__(modname) File "/home/abehm/impala/tests/conftest.py" , line 21, in <module> from kudu import connect as kudu_connect File "/home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/kudu/__init__.py" , line 18, in <module> from kudu.client import (Client, Table, Scanner, Session, # noqa ImportError: /home/abehm/impala/infra/python/env/local/lib/python2.7/site-packages/kudu/client.so: undefined symbol: _ZNK4kudu6client10KuduTablet2idB5cxx11Ev ERROR: could not load /home/abehm/impala/tests/conftest.py
          Hide
          tarmstrong Tim Armstrong added a comment -

          I forgot I even filed this. Yeah it looks like this is the issue you ran into.

          Show
          tarmstrong Tim Armstrong added a comment - I forgot I even filed this. Yeah it looks like this is the issue you ran into.
          Hide
          alex.behm Alexander Behm added a comment -

          Just to clarify: You failed to import the Kudu Python client right? And this is on Ubuntu 16.04?
          I have this problem too.

          Show
          alex.behm Alexander Behm added a comment - Just to clarify: You failed to import the Kudu Python client right? And this is on Ubuntu 16.04? I have this problem too.

            People

            • Assignee:
              tarmstrong Tim Armstrong
              Reporter:
              tarmstrong Tim Armstrong
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development