std::bad_alloc when installing CompatLib package from vertica-extension-packages

karthikreddykarthikreddy Community Edition User

I am trying to install the compatlib_functions package from https://github.com/vertica/Vertica-Extension-Packages/edit/master/ . I am getting the following error : " SQL Error [3399] [VP001]: [Vertica]VJDBC ROLLBACK: Failure in UDx RPC call InvokeGetLibraryManifest(): Exception calling getLibraryManifest() in User Defined Object [], message: std::bad_alloc " . I ran the command "make install" in the compatlib_functions directory . From the vertica documents I found that bad_alloc may be due to the low memory allocation for the UDX but my "FencedUDxMemoryLimitMB" parameter is set to -1(no limit on memory)

Answers

  • SruthiASruthiA Administrator
    edited June 2021

    @karthikreddy could you please share me your gcc and g++ version?

  • karthikreddykarthikreddy Community Edition User

    gcc version - 5.4.0
    g++ version - 5.4.0
    also from the vertica.log file the issue is related to memory , the log says "UDxSideProcessMonitor:0x7fbbd97fb700 [Util] UDx side process 243539 for session v_vestige_node0001-476084:0xc6707 exceeded requested memory (limit: 0 actual: 26922)" , but "FencedUDxMemoryLimitMB" parameter is set to -1

  • SruthiASruthiA Administrator

    @karthikreddy : please update your make file with the below flags and try to run make install.

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

  • SruthiASruthiA Administrator

    @karthikreddy I just tried to install compatlib and did not face any issues. Please find complete example below. I hope this helps.

    In my case, FencedUDxMemoryLimitMB is set to -1

    dbadmin=> select get_config_parameter('FencedUDxMemoryLimitMB');

    get_config_parameter

    -1
    (1 row)

    g++ --version
    g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
    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.

    I downloaded the vertica extensions packages from github and then navigated to the below directory
    /home/dbadmin/Vertica-Extension-Packages-master/compatlib_functions
    I had to edit the make file and add -std=c++11 for CXXFLAGS and ran make command as follows

    compatlib_functions]$ make
    g++ -g -D HAVE_LONG_LONG_INT_64 -c -I ../include -Wall -Wno-unused-value -fPIC -std=c++11 -I /opt/vertica/sdk/include -I /home/dbadmin/Vertica-Extension-Packages-master/compatlib_functions/src/third-party/include -O3 -DNDEBUG /opt/vertica/sdk/include/Vertica.cpp -o build/Vertica.o
    g++ -g -D HAVE_LONG_LONG_INT_64 -c -I ../include -Wall -Wno-unused-value -fPIC -std=c++11 -I /opt/vertica/sdk/include -I /home/dbadmin/Vertica-Extension-Packages-master/compatlib_functions/src/third-party/include -O3 -DNDEBUG src/ConnectBy.cpp -o build/ConnectBy.o
    g++ -g -D HAVE_LONG_LONG_INT_64 -c -I ../include -Wall -Wno-unused-value -fPIC -std=c++11 -I /opt/vertica/sdk/include -I /home/dbadmin/Vertica-Extension-Packages-master/compatlib_functions/src/third-party/include -O3 -DNDEBUG src/Transpose.cpp -o build/Transpose.o
    g++ -g -D HAVE_LONG_LONG_INT_64 -c -I ../include -Wall -Wno-unused-value -fPIC -std=c++11 -I /opt/vertica/sdk/include -I /home/dbadmin/Vertica-Extension-Packages-master/compatlib_functions/src/third-party/include -O3 -DNDEBUG src/GroupGenerator.cpp -o build/GroupGenerator.o
    mkdir -p lib
    g++ -shared -o lib/CompatLib.so build/Vertica.o build/ConnectBy.o build/Transpose.o build/GroupGenerator.o

    Next I just ran install.sql to create libraries.

    compatlib_functions]$ vsql -f ddl/install.sql
    Password:

    version

    Vertica Analytic Database v10.1.1-0
    (1 row)

    CREATE LIBRARY
    CREATE TRANSFORM FUNCTION
    CREATE TRANSFORM FUNCTION
    CREATE TRANSFORM FUNCTION
    CREATE TRANSFORM FUNCTION
    CREATE TRANSFORM FUNCTION
    CREATE TRANSFORM FUNCTION

Leave a Comment

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