BUG #17673: Regression tests failed with llvm 11+ when using address sanitizers

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: vardan(dot)pogosyn(at)yandex(dot)ru
Subject: BUG #17673: Regression tests failed with llvm 11+ when using address sanitizers
Date: 2022-10-31 08:42:34
Message-ID: 17673-1f87e69ae8bf655e@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17673
Logged by: Vardan Pogosyan
Email address: vardan(dot)pogosyn(at)yandex(dot)ru
PostgreSQL version: 15.0
Operating system: Ubuntu 22.04
Description:

When trying to run tests with sanitizer with gcc 9.4.0

CC=gcc CLANG=clang-11 CPPFLAGS="-fsanitize=address"
LDFLAGS='-fsanitize=address -static-libasan'
LLVM_CONFIG=/usr/lib/llvm-11/bin/llvm-config ./configure --enable-debug
--enable-cassert --with-llvm && make -s -j8 && ASAN_OPTIONS=detect_leaks=0
make check

I get the tests failed:

=======================================================
113 of 212 tests failed, 1 of these failures ignored.
=======================================================

I see that an assertion failed with the following stacktrace:

#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f33fc792859 in __GI_abort () at abort.c:79
#2 0x00005582367fccd2 in ExceptionalCondition
(conditionName=conditionName(at)entry=0x7f33f0650aa0 "LLVMGetTypeKind(typ) ==
LLVMPointerTypeKind", fileName=fileName(at)entry=0x7f33f0650000 "llvmjit.c",
lineNumber=lineNumber(at)entry=404) at assert.c:66
#3 0x00007f33f061fca8 in llvm_pg_var_func_type
(varname=varname(at)entry=0x7f33f06582c0 "TypeExprStateEvalFunc") at
llvmjit.c:404
#4 0x00007f33f06466e5 in llvm_compile_expr (state=<optimized out>) at
llvmjit_expr.c:152
#5 0x0000558235fde159 in ExecReadyExpr (state=state(at)entry=0x62500023e818)
at execExpr.c:885
#6 0x0000558235fdf73d in ExecInitExpr (node=0x6310001a00b0,
parent=parent(at)entry=0x62500023e028) at execExpr.c:148
#7 0x000055823609479f in ExecInitLimit (node=node(at)entry=0x7f33f0667038,
estate=estate(at)entry=0x625000048a18, eflags=eflags(at)entry=16) at
nodeLimit.c:485
#8 0x0000558236027355 in ExecInitNode (node=node(at)entry=0x7f33f0667038,
estate=estate(at)entry=0x625000048a18, eflags=eflags(at)entry=16) at
execProcnode.c:381
#9 0x000055823601254d in InitPlan (eflags=16, queryDesc=<optimized out>) at
execMain.c:938
#10 standard_ExecutorStart (queryDesc=<optimized out>, eflags=16) at
execMain.c:265
#11 0x00005582364fb230 in PortalStart (portal=portal(at)entry=0x625000025a18,
params=params(at)entry=0x0, eflags=eflags(at)entry=0, snapshot=snapshot(at)entry=0x0)
at pquery.c:517
#12 0x00005582364f36a0 in exec_simple_query (query_string=<optimized out>)
at postgres.c:1199
#13 0x00005582364f6f40 in PostgresMain (dbname=dbname(at)entry=0x62900001b370
"regression", username=username(at)entry=0x62900001b358 "test") at
postgres.c:4551
#14 0x000055823636cbcf in BackendRun (port=<optimized out>, port=<optimized
out>) at postmaster.c:4482
#15 BackendStartup (port=<optimized out>) at postmaster.c:4210
#16 ServerLoop () at postmaster.c:1804
#17 0x000055823636e8dc in PostmasterMain (argc=8, argv=<optimized out>) at
postmaster.c:1476
#18 0x00005582359ee2d8 in main (argc=8, argv=0x607000000100) at main.c:197

With llvm-10 and clang-10 these errors don't happen

Browse pgsql-bugs by date

  From Date Subject
Next Message Dilip Kumar 2022-10-31 08:53:46 Re: BUG #17670: Logical Replication data may be lost on the subscription under certain scenarios
Previous Message PG Bug reporting form 2022-10-31 07:36:19 BUG #17672: Wrong logic of Postgresql Resporitory Naming and mirroring incompatibility