We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


std::bad_alloc Loading SDK Sample Libraries — Vertica Forum

std::bad_alloc Loading SDK Sample Libraries

My problem is very similar to these two unanswered questions, but with a different Vertica version:

https://forum.vertica.com/discussion/235890/rollback-3399-vsql-create-library-failure-in-udx-error

https://forum.vertica.com/discussion/238717/unable-to-create-library-rollback-3399-failure-in-udx-rpc-call-invokegetlibrarymanifest

I installed Vertica 9.0.1 on Ubuntu using vertica_9.0.1-0_amd64.deb and installed the following:

sudo apt-get install libboost-dev libboost-doc
sudo apt-get install libbz2-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install zlib1g-dev

Next I:
1. copied /opt/vertica/sdk/examples to a subfolder of my home folder
2. ran make
3. Ran vsql -f on a few of the sql scripts

All of them produced:

[Code: 3399, SQL State: VP001] [Vertica]VJDBC ROLLBACK: Failure in UDx RPC call InvokeGetLibraryManifest(): Exception calling getLibraryManifest() in User Defined Object [], message: std::bad_alloc

Vertica is running fine; I have some schema and data loaded.

Comments

  • For what it's worth, there may be some additional hints on what's happening (e.g. out of memory in PermGen space) in the UDxFencedProcessesJava.log which resides under your database catalog/UDxLogs dir.

  • Jim_KnicelyJim_Knicely - Select Field - Administrator

    Can you post the results of trying to compile just one of the Java example?

    Example:

    make JavaFunctions

  • See below for rerun results.

    I initially built using make. It gave warnings about skipping different components due to missing headers; the build appeared successful otherwise. I did not try loading it at this point; instead I installed headers using the apt-get commands above, rebuilt incrementially after each one, and then got a clean build from make. I have tried using make clean and then make again, and loading again, and still get bad_alloc.

    Log file is attached; interestingly there is only one failure directly related to the library file (I made multiple attempts on Jan 2).

    Rerun results from today:

    $ make clean

    rm -rf /home/jpotts/code/vertica-9-examples/build/tmp
    rm -f /home/jpotts/code/vertica-9-examples/build/.so
    rm -f /home/jpotts/code/vertica-9-examples/build/
    .jar
    rm -rf /home/jpotts/code/vertica-9-examples/build/Java*
    rmdir /home/jpotts/code/vertica-9-examples/build >/dev/null 2>&1 || true

    $ make

    (see attached; some folders obfuscated. appears successful)

    $ g++ --version

    g++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    $ java -version

    java version "1.8.0_151"
    Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

    $ javac -version

    javac 1.8.0_151

    $ free -m

              total        used        free      shared  buff/cache   available
    

    Mem: 15914 1629 10592 629 3693 13281
    Swap: 16251 0 16251

  • Error I get using vsql (error in first post is using DBVisualizer):

    vsql:AggregateFunctions.sql:12: ROLLBACK 3399: Failure in UDx RPC call InvokeGetLibraryManifest(): Exception calling getLibraryManifest() in User Defined Object [], message: std::bad_alloc

  • And a portion of the vertica.log file from the immediately above vsql run, attached.

  • Hi!

    What is version of Ubuntu?

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 14.04.5 LTS
    Release:    14.04
    Codename:   trusty
    

    Can you post full output of:

    $ ldd /opt/vertica/bin/vertica-udx-C++
        linux-vdso.so.1 =>  (0x00007ffc856a5000)
        libvmalloc.so => /opt/vertica/bin/../lib/libvmalloc.so (0x00007f0220724000)
        libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f02202e3000)
        libgssapi_krb5.so.2 => /opt/vertica/bin/../lib/libgssapi_krb5.so.2 (0x00007f02206b6000)
       ...
    

    ???

  • $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.3 LTS
    Release: 16.04
    Codename: xenial

    $ ldd /opt/vertica/bin/vertica-udx-C++

    linux-vdso.so.1 =>  (0x00007ffc2bd4e000)
    libvmalloc.so => /opt/vertica/bin/../lib/libvmalloc.so (0x00007fc0c7a5e000)
    libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007fc0c7823000)
    libgssapi_krb5.so.2 => /opt/vertica/bin/../lib/libgssapi_krb5.so.2 (0x00007fc0c77c9000)
    libkrb5.so.3 => /opt/vertica/bin/../lib/libkrb5.so.3 (0x00007fc0c76d8000)
    libkrb5support.so.0 => /opt/vertica/bin/../lib/libkrb5support.so.0 (0x00007fc0c76ca000)
    libk5crypto.so.3 => /opt/vertica/bin/../lib/libk5crypto.so.3 (0x00007fc0c7684000)
    libcom_err.so.3 => /opt/vertica/bin/../lib/libcom_err.so.3 (0x00007fc0c7680000)
    libcrypto.so.10 => /opt/vertica/bin/../lib/libcrypto.so.10 (0x00007fc0c729d000)
    libssl.so.10 => /opt/vertica/bin/../lib/libssl.so.10 (0x00007fc0c7030000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc0c6cae000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc0c69a5000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc0c6787000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc0c657f000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc0c637b000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc0c5fb0000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc0c5d9a000)
    libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fc0c5b71000)
    libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fc0c596c000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fc0c5751000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc0c5536000)
    libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fc0c5332000)
    /lib64/ld-linux-x86-64.so.2 (0x000055ca7058d000)
    

    tldr: java fixed now; c++ sample still not working

    $ vsql -U dbadmin -f JavaFunctions.sql

    vsql:JavaFunctions.sql:14: ROLLBACK 5702: Couldn't create new UDx side process: Java Binary not found: /usr/bin/java/bin/java

    $ sudo -u dbadmin printenv | grep JAVA_HOME
    JAVA_HOME=/usr/bin/java

    The JAVA_HOME variable above is incorrect; it points at an executable rather than a folder. It wasn't obvious because it was only affecting the dbadmin user rather than my user account.

    How I found where JAVA_HOME was set
    grep -r JAVA_HOME /etc/* 2>&1 | grep -v "Permission denied"
    grep -r JAVA_HOME ~/.*

    JAVA_HOME was being set correctly here:

    • /etc/profile.d/jdk.sh
    • /etc/profile.d/jdk.csh

    But I had set it incorrectly here:

    • /etc/environment

    The profile.d flavor was loading into my personal login, but the /etc/environment flavor was being used for the dbadmin user.

    Fixed it by setting JAVA_HOME in /home/dbadmin/.bashrc

    Still getting std::bad_alloc for C++ example

  • edited January 2018

    Hi!

    Ubuntu 16.04.3 LTS is unsupported platform, try 14.04 LTS.

    ps: I got same error on 16.04(just checked).

  • That's disappointing.

  • Hi Josh,
    Hope you are doing well.
    I got same error... on CentOS 7.3.... on gcc 7.3.1... and I can load properly with gcc 7.2.1... and it completely unexplainable.
    Statement that Ubuntu version is desupported is not relevant here, just a way to send you out.
    Try to compile on different box, may be luck will be with you.

  • Great to hear from you, hope all is well. We should grab a beer soon.

    I may try compiling on Ubuntu 14 with the default packages and see if I can get the binary to run on Ubuntu 16.

    Reach out to me through LinkedIn.

  • you need to compile with

    CXXFLAGS="-fabi-version=2 -D_GLIBCXX_USE_CXX11_ABI=0"

    to disable new ABI of std::string
    unless vertica is compiled with modern gcc

    tested on ubuntu 16 and debian 9 with vertica binaries compiled on gcc4X

    and now with vertica 9 you need to patch sdk (see attachment)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file