orioledb / orioledb

OrioleDB – building a modern cloud-native storage engine (... and solving some PostgreSQL wicked problems)  🇺🇦

Home Page:https://orioledb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segfault: o_tuple_init_reader(&oslot->state, oslot->tuple)

Tanyaevm opened this issue · comments

New stack issue 110

Tested on pre_merge
Commit be17f3a

sql/test.sql:

CREATE EXTENSION IF NOT EXISTS orioledb;
CREATE TABLE o_test_1(
    val_1 int4, 
    val_2 text
) USING orioledb;
CREATE UNIQUE INDEX ind_1 
    ON o_test_1(val_1);
INSERT INTO o_test_1 
    VALUES (1, 'a') ON CONFLICT (val_1) 
        DO UPDATE SET val_2 = excluded.val_2;
INSERT INTO o_test_1 
    VALUES (2, 'b') ON CONFLICT (val_1, val_1, val_1) 
        DO UPDATE SET val_2 = excluded.val_2;
INSERT INTO o_test_1
    VALUES (1, 'a'), (2, 'b') ON CONFLICT (val_1) 
        DO UPDATE SET (val_2, val_1) = (excluded.val_2, excluded.val_1);
INSERT INTO o_test_1 AS ict 
    VALUES (6, 'c') ON CONFLICT (val_1) 
        DO UPDATE SET val_2 = excluded.val_2;
INSERT INTO o_test_1 AS ict 
    VALUES (6, 'c') ON CONFLICT (val_1) 
        DO UPDATE SET val_2 = ict.val_2;
DROP INDEX ind_1;
CREATE UNIQUE INDEX ind_2 
    ON o_test_1(lower(val_2));
INSERT INTO o_test_1 
    VALUES (20, 'd') ON CONFLICT (lower(val_2)) 
        DO UPDATE SET val_2 = excluded.val_2;
INSERT INTO o_test_1 
    VALUES (21, 'f') ON CONFLICT (lower(val_2), lower(val_2)) 
        DO UPDATE SET val_2 = excluded.val_2;
DROP INDEX ind_2;
CREATE UNIQUE INDEX ind_3 
    on o_test_1(val_1, lower(val_2));
INSERT INTO o_test_1 
    VALUES (25, 's') ON CONFLICT (lower(val_2), val_1) 
        DO UPDATE SET val_2 = excluded.val_2;
CREATE UNIQUE INDEX ind_1 
    on o_test_1(val_1);
CREATE unique index ind_4 
    on o_test_1(val_2);
INSERT INTO o_test_1 
    VALUES (26, 's') ON CONFLICT (val_1) 
        DO UPDATE SET val_2 = excluded.val_2;

Coredump

#0  0x00007fc9c0a4d432 in tts_orioledb_init_reader (slot=slot@entry=0x5652552d9540) at src/tuple/slot.c:671
671             o_tuple_init_reader(&oslot->state, oslot->tuple,
#0  0x00007fc9c0a4d432 in tts_orioledb_init_reader (slot=slot@entry=0x5652552d9540) at src/tuple/slot.c:671
#1  0x00007fc9c0a4edfb in tts_orioledb_store_tuple (slot=slot@entry=0x5652552d9540, tuple=..., descr=descr@entry=0x56525517abb0, csn=csn@entry=70, ixnum=ixnum@entry=65535, shouldfree=true, hint=0x7ffea7209f30) at src/tuple/slot.c:726
#2  0x00007fc9c0a3914b in copy_tuple_to_slot (tup=..., slot=0x5652552d9540, descr=0x56525517abb0, csn=70, ix_num=<optimized out>, hint=0x7ffea7209f30) at src/tableam/operations.c:1264
#3  0x00007fc9c0a398db in o_insert_with_arbiter_modify_callback (descr=<optimized out>, tup=..., newtup=<optimized out>, oxid=<optimized out>, xactInfo=<optimized out>, location=2305843009213693952, lock_mode=0x7ffea72102b0, hint=0x7ffea7209f30, arg=0x7ffea7210720) at src/tableam/operations.c:1362
#4  0x00007fc9c09e49ff in o_btree_insert_unique (desc=desc@entry=0x56525517e788, tuple=..., tupleType=tupleType@entry=BTreeKeyLeafTuple, key=key@entry=0x7ffea72102f0 "\002", keyType=keyType@entry=BTreeKeyBound, opOxid=62, opCsn=70, lockMode=<optimized out>, hint=0x0, callbackInfo=0x7ffea72106f0) at src/btree/modify.c:1168
#5  0x00007fc9c0a39e44 in o_tbl_index_insert (descr=descr@entry=0x56525517abb0, id=0x56525517e768, slot=slot@entry=0x5652552d9ca0, oxid=62, csn=70, callbackInfo=callbackInfo@entry=0x7ffea72106f0) at src/tableam/operations.c:1083
#6  0x00007fc9c0a3a65a in o_tbl_insert_with_arbiter (rel=0x7fc9aff66838, descr=0x56525517abb0, slot=0x5652552d9ca0, arbiterIndexes=0x5652552dd2f0, lockmode=LockTupleExclusive, lockedSlot=0x5652552d9540) at src/tableam/operations.c:353
#7  0x00005652537603bb in table_tuple_insert_with_arbiter (tempSlot=0x5652552c9730, lockedSlot=0x5652552d9540, lockmode=LockTupleExclusive, estate=0x5652552d83a0, arbiterIndexes=0x5652552dd2f0, bistate=0x0, options=0, cid=<optimized out>, slot=0x5652552d9ca0, resultRelInfo=0x5652552d8840) at ../../../src/include/access/tableam.h:1443
#8  ExecInsert (context=context@entry=0x7ffea7210fa0, resultRelInfo=resultRelInfo@entry=0x5652552d8840, slot=slot@entry=0x5652552d9ca0, canSetTag=<optimized out>, inserted_tuple=inserted_tuple@entry=0x0, insert_destrel=insert_destrel@entry=0x0) at nodeModifyTable.c:968
#9  0x0000565253760ff7 in ExecModifyTable (pstate=<optimized out>) at nodeModifyTable.c:3514
#10 0x000056525372eac3 in ExecProcNode (node=0x5652552d8628) at ../../../src/include/executor/executor.h:262
#11 ExecutePlan (execute_once=<optimized out>, dest=0x5652552dd078, direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>, operation=CMD_INSERT, use_parallel_mode=<optimized out>, planstate=0x5652552d8628, estate=0x5652552d83a0) at execMain.c:1644
#12 standard_ExecutorRun (queryDesc=0x565255203f20, direction=<optimized out>, count=0, execute_once=<optimized out>) at execMain.c:363
#13 0x00007fc9c09f66d5 in orioledb_ExecutorRun_hook (queryDesc=0x565255203f20, direction=ForwardScanDirection, count=0, execute_once=<optimized out>) at src/catalog/ddl.c:1336
#14 0x00005652538c49a0 in ProcessQuery (plan=<optimized out>, sourceText=0x56525511f870 "INSERT INTO o_test_1 \n    VALUES (26, 's') ON CONFLICT (val_1) \n        DO UPDATE SET val_2 = excluded.val_2;", params=0x0, queryEnv=0x0, dest=0x5652552dd078, qc=0x7ffea7211350) at pquery.c:160
#15 0x00005652538c54e2 in PortalRunMulti (portal=portal@entry=0x5652551dd940, isTopLevel=isTopLevel@entry=true, setHoldSnapshot=setHoldSnapshot@entry=false, dest=dest@entry=0x5652552dd078, altdest=altdest@entry=0x5652552dd078, qc=qc@entry=0x7ffea7211350) at pquery.c:1277
#16 0x00005652538c5a61 in PortalRun (portal=portal@entry=0x5652551dd940, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x5652552dd078, altdest=altdest@entry=0x5652552dd078, qc=0x7ffea7211350) at pquery.c:791
#17 0x00005652538c1652 in exec_simple_query (query_string=0x56525511f870 "INSERT INTO o_test_1 \n    VALUES (26, 's') ON CONFLICT (val_1) \n        DO UPDATE SET val_2 = excluded.val_2;") at postgres.c:1250
#18 0x00005652538c3432 in PostgresMain (dbname=<optimized out>, username=<optimized out>) at postgres.c:4598
#19 0x000056525382f61a in BackendRun (port=<optimized out>, port=<optimized out>) at postmaster.c:4531
#20 BackendStartup (port=<optimized out>) at postmaster.c:4259
#21 ServerLoop () at postmaster.c:1816
#22 0x000056525383078b in PostmasterMain (argc=<optimized out>, argv=0x56525511abe0) at postmaster.c:1488
#23 0x000056525354fb60 in main (argc=8, argv=0x56525511abe0) at main.c:202

Run as:

make regresscheck USE_PGXS=1 REGRESSCHECKS="test"