BUG #17241: llvm::install_bad_alloc_error_handler error

Started by PG Bug reporting formover 4 years ago3 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 17241
Logged by: arjun shetty
Email address: arjunshetty955@gmail.com
PostgreSQL version: 13.3
Operating system: RHEL8.3
Description:

postgreSQLv13.3 source code compiled(llvmv12.0.1) and configured with
options "with-llvm and LLVM_CONFIG".
On run SQL query with PostgreSQL bin's with HammerDB(TPC-H) and pgbench
environment observed an error "1install_bad_alloc_error_handler"
Query Run:
=======

psql -U postgres -d postgres -d tpch -c "select s_name, s_address from
supplier,
nation where s_suppkey in ( select ps_suppkey from partsupp where ps_partkey
in
( select p_partkey from part where p_name like ':1%') and ps_availqty >
( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey
and l_suppkey = ps_suppkey and l_shipdate >= date ':2' and l_shipdate < date
':2' + interval '1 year'))
and s_nationkey = n_nationkey and n_name = ':3' order by s_name" >
/tmp/query20;date

Error:
=====
postgreSQLv13.3/installed_patjh/lib/postgresql/llvmjit.so":

<path/to/postgresql/installation>/lib/postgresql/llvmjit.so: undefined
symbol:

_ZN4llvm31install_bad_alloc_error_handlerEPFvPvRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbES0_

--> The above API is present in library, even though it is giving error.
postgresql-13.3/src/backend/jit/llvm/llvmjit_error.cpp:62:
llvm::install_bad_alloc_error_handler(fatal_llvm_new_handler);
llvm/Support/ErrorHandling.h:96:void

install_bad_alloc_error_handle matches in the binary's
/postgresql-13.3/<installed_path_bin_lib_path>/src/backend/jit/llvm/llvmjit_error.o
matches
/postgresql-13.3/<installed_path_bin_lib_path>/src/backend/jit/llvm/llvmjit.so
matches
llvmv12.0.1/lib/libLLVMSupport.so matches
the issue was not resolved export LIB_PATH or using the clang(llvm) binary
at compile time.
Are you planning to fix this issue in upcoming releases? Otherwise, please
provide us a workaround/patch for this issue.

#2Andres Freund
andres@anarazel.de
In reply to: PG Bug reporting form (#1)
Re: BUG #17241: llvm::install_bad_alloc_error_handler error

Hi,

On 2021-10-21 13:25:16 +0000, PG Bug reporting form wrote:

postgreSQLv13.3 source code compiled(llvmv12.0.1) and configured with
options "with-llvm and LLVM_CONFIG".
On run SQL query with PostgreSQL bin's with HammerDB(TPC-H) and pgbench
environment observed an error "1install_bad_alloc_error_handler"

Where is LLVM installed to? If you do ldd path-to/llvmjit.so, does it show the
.so from your own build of LLVM, or perhaps a different one?

Are you planning to fix this issue in upcoming releases?

I don't think this is likely to be a postgres bug.

Otherwise, please provide us a workaround/patch for this issue.

You could disable jit compilation for now.

Greetings,

Andres Freund

#3arjun shetty
arjunshetty955@gmail.com
In reply to: Andres Freund (#2)
Re: BUG #17241: llvm::install_bad_alloc_error_handler error

Hi,
Even include lld library path of libjit.so still it shows the Same error
and currently disabled jit for now.

Best Regards
Anil

On Friday, October 29, 2021, Andres Freund <andres@anarazel.de> wrote:

Show quoted text

Hi,

On 2021-10-21 13:25:16 +0000, PG Bug reporting form wrote:

postgreSQLv13.3 source code compiled(llvmv12.0.1) and configured with
options "with-llvm and LLVM_CONFIG".
On run SQL query with PostgreSQL bin's with HammerDB(TPC-H) and pgbench
environment observed an error "1install_bad_alloc_error_handler"

Where is LLVM installed to? If you do ldd path-to/llvmjit.so, does it show
the
.so from your own build of LLVM, or perhaps a different one?

Are you planning to fix this issue in upcoming releases?

I don't think this is likely to be a postgres bug.

Otherwise, please provide us a workaround/patch for this issue.

You could disable jit compilation for now.

Greetings,

Andres Freund