Hi,

Just found another crash.

Seems that commit a929e17e5a8c9b751b66002c8a89fdebdacfe194 broke something.
Attached is a minimal case and the stack trace.

--
Jaime Casanova
Director de Servicios Profesionales
SystemGuards - Consultores de PostgreSQL
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
        set = {__val = {0, 140736891297696, 2, 6, 6453766, 94092477853648, 
4611686018427388799, 140041917086374, 0, 281470681751456, 0, 0, 0, 0, 0, 0}}
        pid = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
#1  0x00007f5e0c806535 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, 
sa_mask = {__val = {0, 0, 0, 0, 0, 140041914843125, 2, 3691039874016042664, 
7018409654210421561, 94092477853648, 
              7003722382933471536, 0, 6953716221396971264, 140736891297936, 0, 
140736891298800}}, sa_flags = -1665667120, sa_restorer = 0x0}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x000055939d1f5f6e in ExceptionalCondition (conditionName=0x55939d392fe2 
"!bms_is_empty(present_parts)", errorType=0x55939d392e73 "FailedAssertion", 
fileName=0x55939d392f44 "partprune.c", lineNumber=588)
    at assert.c:69
No locals.
#3  0x000055939cf87d2e in make_partitionedrel_pruneinfo (root=0x55939e84ac40, 
parentrel=0x55939e86c1a0, relid_subplan_map=0x55939e875d78, 
partrelids=0x55939e874990, prunequal=0x55939e875d20, 
    matchedsubplans=0x7fffdc69a578) at partprune.c:588
        subpart = 0x55939e86c1a0
        nparts = 1
        relid_map = 0x55939e876228
        pinfo = 0x55939e875320
        present_parts = 0x0
        subplan_map = 0x55939e8761e8
        subpart_map = 0x55939e876208
        lc__state = {l = 0x55939e876190, i = 0}
        targetpart = 0x55939e86c1a0
        pinfolist = 0x55939e876190
        doruntimeprune = true
        relid_subpart_map = 0x55939e875da0
        subplansfound = 0x0
        lc = 0x55939e8761a8
        rti = -2
        i = 1
#4  0x000055939cf8757c in make_partition_pruneinfo (root=0x55939e84ac40, 
parentrel=0x55939e86c1a0, subpaths=0x55939e874bf0, 
partitioned_rels=0x55939e874d38, prunequal=0x55939e875d20) at partprune.c:274
        partrelids = 0x55939e874990
        pinfolist = 0x55939e875d20
        matchedsubplans = 0x0
        lc__state = {l = 0x55939e874d38, i = 0}
        pruneinfo = 0x55939cec2640 <lappend+141>
        allmatchedsubplans = 0x0
        relid_subplan_map = 0x55939e875d78
        lc = 0x55939e874d50
        prunerelinfos = 0x0
        i = 2
#5  0x000055939cf213d6 in create_append_plan (root=0x55939e84ac40, 
best_path=0x55939e874ca0, flags=6) at createplan.c:1250
        prunequal = 0x55939e875d20
        plan = 0x55939e84a130
        tlist = 0x55939e875928
        orig_tlist_length = 1
        tlist_was_changed = false
        pathkeys = 0x55939e871288
        subplans = 0x55939e875cc8
        subpaths = 0x0
        rel = 0x55939e86c1a0
        partpruneinfo = 0x0
        nodenumsortkeys = 1
        nodeSortColIdx = 0x55939e8731f8
        nodeSortOperators = 0x55939e875980
        nodeCollations = 0x55939e8759a0
        nodeNullsFirst = 0x55939e8759c0
        __func__ = "create_append_plan"
#6  0x000055939cf1ff5b in create_plan_recurse (root=0x55939e84ac40, 
best_path=0x55939e874ca0, flags=6) at createplan.c:405
        plan = 0x0
        __func__ = "create_plan_recurse"
#7  0x000055939cf2385f in create_windowagg_plan (root=0x55939e84ac40, 
best_path=0x55939e8754c0) at createplan.c:2454
        plan = 0x0
        wc = 0x55939e82a4c0
        numPart = 1
        numOrder = 0
        subplan = 0x559300000001
        tlist = 0x55939e82a748
        partNumCols = 21907
        partColIdx = 0x0
        partOperators = 0x0
        partCollations = 0x559300000001
        ordNumCols = 0
        ordColIdx = 0x0
        ordOperators = 0x55939e82a558
        ordCollations = 0x55939e75f468
        lc = 0x0
#8  0x000055939cf201f8 in create_plan_recurse (root=0x55939e84ac40, 
best_path=0x55939e8754c0, flags=1) at createplan.c:492
        plan = 0x55939e875558
        __func__ = "create_plan_recurse"
#9  0x000055939cf1fe1a in create_plan (root=0x55939e84ac40, 
best_path=0x55939e8754c0) at createplan.c:333
        plan = 0x55939e8754c0
        __func__ = "create_plan"
#10 0x000055939cf32737 in standard_planner (parse=0x55939e75f468, 
    query_string=0x55939e75d6d0 "select pg_catalog.min(100) over (partition by 
ref_1.a)\n  from ref_1 \n where (ref_1.a <= (select foo from generate_series(1, 
10) foo order by 1 limit 1)) ", cursorOptions=256, 
    boundParams=0x0) at planner.c:409
        result = 0x55939d231027 <palloc+273>
        glob = 0x55939e82a558
        tuple_fraction = 0
        root = 0x55939e84ac40
        final_rel = 0x55939e875558
        best_path = 0x55939e8754c0
        top_plan = 0x7fffdc69aa50
        lp = 0x7f5e035e6f90
        lr = 0x55939cec2157 <new_list+103>
#11 0x000055939cf324a8 in planner (parse=0x55939e75f468, 
    query_string=0x55939e75d6d0 "select pg_catalog.min(100) over (partition by 
ref_1.a)\n  from ref_1 \n where (ref_1.a <= (select foo from generate_series(1, 
10) foo order by 1 limit 1)) ", cursorOptions=256, 
    boundParams=0x0) at planner.c:273
        result = 0x55939e75f468
#12 0x000055939d063ca6 in pg_plan_query (querytree=0x55939e75f468, 
    query_string=0x55939e75d6d0 "select pg_catalog.min(100) over (partition by 
ref_1.a)\n  from ref_1 \n where (ref_1.a <= (select foo from generate_series(1, 
10) foo order by 1 limit 1)) ", cursorOptions=256, 
    boundParams=0x0) at postgres.c:876
        plan = 0xe59d063bd7
#13 0x000055939d063ddc in pg_plan_queries (querytrees=0x55939e84abe8, 
    query_string=0x55939e75d6d0 "select pg_catalog.min(100) over (partition by 
ref_1.a)\n  from ref_1 \n where (ref_1.a <= (select foo from generate_series(1, 
10) foo order by 1 limit 1)) ", cursorOptions=256, 
    boundParams=0x0) at postgres.c:967
        query = 0x55939e75f468
        stmt = 0x55939e75f2c0
        query_list__state = {l = 0x55939e84abe8, i = 0}
        stmt_list = 0x0
        query_list = 0x55939e84ac00
#14 0x000055939d06413f in exec_simple_query (
    query_string=0x55939e75d6d0 "select pg_catalog.min(100) over (partition by 
ref_1.a)\n  from ref_1 \n where (ref_1.a <= (select foo from generate_series(1, 
10) foo order by 1 limit 1)) ") at postgres.c:1159
        snapshot_set = true
        per_parsetree_context = 0x0
        plantree_list = 0x55939cb7efd0 <_start>
        parsetree = 0x55939e75f2c0
        commandTag = CMDTAG_SELECT
        qc = {commandTag = 3697912640, nprocessed = 94092484737757}
        querytree_list = 0x55939e84abe8
        portal = 0x0
        receiver = 0x55939d20e9d3 <pg_any_to_server+88>
        format = 0
        parsetree_item__state = {l = 0x55939e75f2f8, i = 0}
        dest = DestRemote
        oldcontext = 0x55939e823090
        parsetree_list = 0x55939e75f2f8
        parsetree_item = 0x55939e75f310
        save_log_statement_stats = false
        was_logged = false
        use_implicit_block = false
        msec_str = 
"\320\326u\236\223U\000\000\231\000\000\000\006\000\000\000P\253i\334\377\177\000\000\321\365霙\000\000"
        __func__ = "exec_simple_query"
#15 0x000055939d0687d9 in PostgresMain (argc=1, argv=0x7fffdc69ad90, 
dbname=0x55939e78b950 "postgres", username=0x55939e78b928 "jcasanov") at 
postgres.c:4394
        query_string = 0x55939e75d6d0 "select pg_catalog.min(100) over 
(partition by ref_1.a)\n  from ref_1 \n where (ref_1.a <= (select foo from 
generate_series(1, 10) foo order by 1 limit 1)) "
        firstchar = 81
        input_message = {data = 0x55939e75d6d0 "select pg_catalog.min(100) over 
(partition by ref_1.a)\n  from ref_1 \n where (ref_1.a <= (select foo from 
generate_series(1, 10) foo order by 1 limit 1)) ", 
          len = 154, maxlen = 1024, cursor = 154}
        local_sigjmp_buf = {{__jmpbuf = {0, -2322631538876131494, 
94092477853648, 140736891302192, 0, 0, -2322631538821605542, 
-8422619478660262054}, __mask_was_saved = 1, __saved_mask = {__val = {0, 0, 0, 
0, 
                0, 0, 0, 33022, 14935519656805164164, 0, 1099511627520, 0, 0, 
4294901760, 18446462598732840960, 0}}}}
        send_ready_for_query = false
        idle_in_transaction_timeout_enabled = false
        idle_session_timeout_enabled = false
        __func__ = "PostgresMain"
#16 0x000055939cfa7fb9 in BackendRun (port=0x55939e781230) at postmaster.c:4484
        av = {0x55939d398c2f "postgres", 0x0}
        ac = 1
#17 0x000055939cfa78e8 in BackendStartup (port=0x55939e781230) at 
postmaster.c:4206
        bn = 0x55939e77ff00
        pid = 0
        __func__ = "BackendStartup"
#18 0x000055939cfa3d09 in ServerLoop () at postmaster.c:1730
        port = 0x55939e781230
        i = 2
        rmask = {fds_bits = {128, 0 <repeats 15 times>}}
        selres = 1
        now = 1611885389
        readmask = {fds_bits = {224, 0 <repeats 15 times>}}
        nSockets = 8
        last_lockfile_recheck_time = 1611885381
        last_touch_time = 1611884001
        __func__ = "ServerLoop"
#19 0x000055939cfa3558 in PostmasterMain (argc=3, argv=0x55939e757d30) at 
postmaster.c:1402
        opt = -1
        status = 0
        userDoption = 0x55939e77a550 "data"
        listen_addr_saved = true
        i = 64
        output_config_variable = 0x0
        __func__ = "PostmasterMain"
#20 0x000055939cea287c in main (argc=3, argv=0x55939e757d30) at main.c:209
        do_check_root = true

Attachment: query.sql
Description: application/sql

Reply via email to