std::bad_alloc Loading SDK Sample Libraries

jpottsjpotts Registered User

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

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.


  • SC_at_MicrofocusSC_at_Microfocus Registered User

    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 Employee, Registered User, VerticaExpert

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


    make JavaFunctions

  • jpottsjpotts Registered User

    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/
    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

    $ 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

  • jpottsjpotts Registered User

    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

  • jpottsjpotts Registered User

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

  • sKwasKwa Registered User


    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++ =>  (0x00007ffc856a5000) => /opt/vertica/bin/../lib/ (0x00007f0220724000) => /lib/x86_64-linux-gnu/ (0x00007f02202e3000) => /opt/vertica/bin/../lib/ (0x00007f02206b6000)


  • jpottsjpotts Registered User

    $ 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++ =>  (0x00007ffc2bd4e000) => /opt/vertica/bin/../lib/ (0x00007fc0c7a5e000) => /lib/x86_64-linux-gnu/ (0x00007fc0c7823000) => /opt/vertica/bin/../lib/ (0x00007fc0c77c9000) => /opt/vertica/bin/../lib/ (0x00007fc0c76d8000) => /opt/vertica/bin/../lib/ (0x00007fc0c76ca000) => /opt/vertica/bin/../lib/ (0x00007fc0c7684000) => /opt/vertica/bin/../lib/ (0x00007fc0c7680000) => /opt/vertica/bin/../lib/ (0x00007fc0c729d000) => /opt/vertica/bin/../lib/ (0x00007fc0c7030000) => /usr/lib/x86_64-linux-gnu/ (0x00007fc0c6cae000) => /lib/x86_64-linux-gnu/ (0x00007fc0c69a5000) => /lib/x86_64-linux-gnu/ (0x00007fc0c6787000) => /lib/x86_64-linux-gnu/ (0x00007fc0c657f000) => /lib/x86_64-linux-gnu/ (0x00007fc0c637b000) => /lib/x86_64-linux-gnu/ (0x00007fc0c5fb0000) => /lib/x86_64-linux-gnu/ (0x00007fc0c5d9a000) => /lib/x86_64-linux-gnu/ (0x00007fc0c5b71000) => /lib/x86_64-linux-gnu/ (0x00007fc0c596c000) => /lib/x86_64-linux-gnu/ (0x00007fc0c5751000) => /lib/x86_64-linux-gnu/ (0x00007fc0c5536000) => /lib/x86_64-linux-gnu/ (0x00007fc0c5332000)
    /lib64/ (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

    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/
    • /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

  • sKwasKwa Registered User
    edited January 5


    Ubuntu 16.04.3 LTS is unsupported platform, try 14.04 LTS.

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

  • jpottsjpotts Registered User

    That's disappointing.

  • Sergey_Cherepan_1Sergey_Cherepan_1 Registered User

    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.

  • jpottsjpotts Registered User

    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.

Leave a Comment

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