Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crashes when executing SELECT agtype_hash_cmp(agtype_in('[null, null, null, null, null]')); #2093

Closed
saygoodbyye opened this issue Sep 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@saygoodbyye
Copy link
Contributor

Describe the bug
Server crashes when executing the following SQL-script

How are you accessing AGE (Command line, driver, etc.)?
Accessing AGE through command line.

What data setup do we need to do?
Apache AGE (master) with PostgreSQL (REL_16_STABLE).

What is the necessary configuration info needed?
My PostgreSQL configuration:

./configure CFLAGS=" -Og" --enable-tap-tests --enable-debug --enable-cassert

What is the command that caused the error?

create extension age;
SET search_path TO ag_catalog;
SELECT agtype_access_operator(agtype_in('[null, null]'));
SELECT agtype_hash_cmp(agtype_in('[null, null, null, null, null]'));

backtrace:

#0  GetMemoryChunkMethodID (pointer=pointer@entry=0x0) at mcxt.c:196
196		header = *((const uint64 *) ((const char *) pointer - sizeof(uint64)));
(gdb) bt
#0  GetMemoryChunkMethodID (pointer=pointer@entry=0x0) at mcxt.c:196
#1  0x00006331d5ae9b8c in pfree (pointer=0x0) at mcxt.c:1463
#2  0x00007954f6abec67 in agtype_access_operator (fcinfo=0x6331d7180f48) at src/backend/utils/adt/agtype.c:4075
#3  0x00006331d57aa0db in ExecInterpExpr (state=0x6331d7180e68, econtext=0x6331d7181078, isnull=0x7ffef139e144) at execExprInterp.c:758
#4  0x00006331d57a6bb0 in ExecInterpExprStillValid (state=0x6331d7180e68, econtext=0x6331d7181078, isNull=0x7ffef139e144) at execExprInterp.c:1870
#5  0x00006331d58b6952 in ExecEvalExprSwitchContext (isNull=0x7ffef139e144, econtext=<optimized out>, state=0x6331d7180e68) at ../../../../src/include/executor/executor.h:355
#6  evaluate_expr (expr=<optimized out>, result_type=result_type@entry=16453, result_typmod=result_typmod@entry=-1, result_collation=result_collation@entry=0) at clauses.c:4979
#7  0x00006331d58b6b2e in evaluate_function (funcid=funcid@entry=16787, result_type=result_type@entry=16453, result_typmod=result_typmod@entry=-1,
    result_collid=result_collid@entry=0, input_collid=input_collid@entry=0, args=args@entry=0x6331d717e850, funcvariadic=true, func_tuple=0x7954f65e5e30, context=0x7ffef139e530)
    at clauses.c:4485
#8  0x00006331d58b8bf4 in simplify_function (funcid=16787, result_type=16453, result_typmod=-1, result_collid=result_collid@entry=0, input_collid=input_collid@entry=0,
    args_p=args_p@entry=0x7ffef139e330, funcvariadic=true, process_args=true, allow_non_const=true, context=0x7ffef139e530) at clauses.c:4074
#9  0x00006331d58b6e4a in eval_const_expressions_mutator (node=0x6331d70aabf0, context=0x7ffef139e530) at clauses.c:2573
#10 0x00006331d5828cf5 in expression_tree_mutator_impl (node=node@entry=0x6331d70aac40, mutator=mutator@entry=0x6331d58b6b70 <eval_const_expressions_mutator>,
    context=context@entry=0x7ffef139e530) at nodeFuncs.c:3302
#11 0x00006331d58b6bf0 in eval_const_expressions_mutator (node=0x6331d70aac40, context=0x7ffef139e530) at clauses.c:3693
#12 0x00006331d5828f07 in expression_tree_mutator_impl (node=node@entry=0x6331d70aac90, mutator=mutator@entry=0x6331d58b6b70 <eval_const_expressions_mutator>,
    context=context@entry=0x7ffef139e530) at nodeFuncs.c:3389
#13 0x00006331d58b6bf0 in eval_const_expressions_mutator (node=0x6331d70aac90, context=context@entry=0x7ffef139e530) at clauses.c:3693
#14 0x00006331d58b8213 in eval_const_expressions (root=root@entry=0x6331d717e088, node=<optimized out>) at clauses.c:2249
#15 0x00006331d58990be in preprocess_expression (root=root@entry=0x6331d717e088, expr=<optimized out>, kind=kind@entry=1) at planner.c:1144
#16 0x00006331d58a0e3e in subquery_planner (glob=glob@entry=0x6331d70a9e90, parse=parse@entry=0x6331d70a9fa0, parent_root=parent_root@entry=0x0,
    hasRecursion=hasRecursion@entry=false, tuple_fraction=tuple_fraction@entry=0) at planner.c:811
#17 0x00006331d58a1a07 in standard_planner (parse=0x6331d70a9fa0, query_string=<optimized out>, cursorOptions=2048, boundParams=<optimized out>) at planner.c:413
#18 0x00006331d58a1fc9 in planner (parse=parse@entry=0x6331d70a9fa0, query_string=query_string@entry=0x6331d70a8f98 "SELECT agtype_access_operator(agtype_in('[null, null]'));",
    cursorOptions=cursorOptions@entry=2048, boundParams=boundParams@entry=0x0) at planner.c:281
#19 0x00006331d598181c in pg_plan_query (querytree=querytree@entry=0x6331d70a9fa0,
    query_string=query_string@entry=0x6331d70a8f98 "SELECT agtype_access_operator(agtype_in('[null, null]'));", cursorOptions=cursorOptions@entry=2048,
    boundParams=boundParams@entry=0x0) at postgres.c:908
#20 0x00006331d59818d2 in pg_plan_queries (querytrees=0x6331d70aad60, query_string=query_string@entry=0x6331d70a8f98 "SELECT agtype_access_operator(agtype_in('[null, null]'));",
    cursorOptions=cursorOptions@entry=2048, boundParams=boundParams@entry=0x0) at postgres.c:1000
#21 0x00006331d5981d3b in exec_simple_query (query_string=query_string@entry=0x6331d70a8f98 "SELECT agtype_access_operator(agtype_in('[null, null]'));") at postgres.c:1197
#22 0x00006331d5983c76 in PostgresMain (dbname=<optimized out>, username=<optimized out>) at postgres.c:4701
#23 0x00006331d58e59f2 in BackendRun (port=port@entry=0x6331d70d3740) at postmaster.c:4464
#24 0x00006331d58e7a0a in BackendStartup (port=port@entry=0x6331d70d3740) at postmaster.c:4192
#25 0x00006331d58e7ba8 in ServerLoop () at postmaster.c:1782
#26 0x00006331d58e90e4 in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x6331d7062fe0) at postmaster.c:1466
#27 0x00006331d580dbef in main (argc=3, argv=0x6331d7062fe0) at main.c:198

Expected behavior
Expected ERROR to be shown or sql query to be successfully executed

Best regards,
Egor Chindyaskin
Postgres Professional: https://postgrespro.com/

@saygoodbyye saygoodbyye added the bug Something isn't working label Sep 9, 2024
@jrgemignani
Copy link
Contributor

@saygoodbyye Working on a fix, it should be out tomorrow.

@jrgemignani
Copy link
Contributor

@saygoodbyye PR #2095, which is under review, will fix this issue.

@saygoodbyye
Copy link
Contributor Author

saygoodbyye commented Sep 11, 2024

@jrgemignani, Thank you! Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants