Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK7p8-0004iV-JZ for pgsql-general@arkaria.postgresql.org; Tue, 06 Nov 2018 20:19:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gK7p6-00082H-EQ for pgsql-general@arkaria.postgresql.org; Tue, 06 Nov 2018 20:19:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK7p6-00080v-31 for pgsql-general@lists.postgresql.org; Tue, 06 Nov 2018 20:19:40 +0000 Received: from mxc1.seznam.cz ([2a02:598:a::79:23]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK7p3-0008FK-NI for pgsql-general@lists.postgresql.org; Tue, 06 Nov 2018 20:19:39 +0000 Received: from email.seznam.cz by email-smtpc5a.ko.seznam.cz (email-smtpc5a.ko.seznam.cz [10.53.10.135]) id 41631d6cb2b2908841f1953d; Tue, 06 Nov 2018 21:19:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=email.cz; s=beta; t=1541535575; bh=dqs3kb4FBvzpyAw4/DRj4gPMkS6Mg2iY6IWEAJKD8Xs=; h=Received:Subject:To:Cc:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding; b=fQzKm9Ox80bO9DUxzts9fXp119+j5nh7O5VcM1exYD8iabKj+w3T2l6Mw6R+R7LfG Gc1VF0kWxq9hjd7aeas4tHez7s/NJOjMmYKAt558oZZEaGW5y5mSzSca9Yk0QBswAm U7zmHP3IrcHWSdw3LUv7sO+9VUorsvdcLNTZvjOY= Received: from [192.168.0.110] (ip-94-112-39-7.net.upcbroadband.cz [94.112.39.7]) by email-relay22.ko.seznam.cz (Seznam SMTPD 1.3.102) with ESMTP; Tue, 06 Nov 2018 21:19:32 +0100 (CET) Subject: Re: backend crash on DELETE, reproducible locally To: Tom Lane Cc: Alvaro Herrera , pgsql-general@lists.postgresql.org, Karsten Hilbert References: <20181106185255.776mstcyehnc63ty@alvherre.pgsql> <8e260d7c-13e8-b398-14dd-2e079ff7e833@email.cz> <31911.1541533784@sss.pgh.pa.us> From: =?UTF-8?Q?Ond=c5=99ej_Bouda?= Message-ID: Date: Tue, 6 Nov 2018 21:19:31 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <31911.1541533784@sss.pgh.pa.us> Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Language: cs Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > Foreign-key triggers too? There are four trivial foreign keys from public.schedulecard like this: ALTER TABLE public.schedulecard ADD CONSTRAINT fk_schedulecard_schedulecard FOREIGN KEY (schedulecard_id) REFERENCES public.schedulecard (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE RESTRICT; (two of them having ON UPDATE CASCADE, but all other characteristics are the same) Also, several tables have foreign keys to public.schedulecard.id, some of which are ON UPDATE CASCADE, others NO ACTION. > A stack trace would be really helpful. Already sent earlier, maybe it got lost. Resending it: [New LWP 8307] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `postgres: 11/main: usr mydb 127.0.0.1(56829) UPDATE '. Program terminated with signal SIGSEGV, Segmentation fault. #0 __memcmp_sse4_1 () at ../sysdeps/x86_64/multiarch/memcmp-sse4.S:793 #0 __memcmp_sse4_1 () at ../sysdeps/x86_64/multiarch/memcmp-sse4.S:793 No locals. #1 0x00007f6a6b993296 in datumIsEqual (value1=12, value2=12, typByVal=, typLen=16) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/utils/adt/datum.c:249 size1 = 16 size2 = s1 = 0xc s2 = 0xc res = #2 0x00007f6a6b6b89de in ProjIndexIsUnchanged (newtup=0x7f6a6d5ccdd0, oldtup=0x7ffc9c1c1270, relation=0x7f6a6b4c3680) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/access/heap/heapam.c:4539 att = indexOid = indexDesc = 0x7f6a6b4c7cf0 indexInfo = 0x7f6a6d5cdbf8 i = 0 indexoidlist = econtext = 0x7f6a6d4c2c10 new_isnull = {false, false, false, 156, 252, 127, false, false, 44, 29, 128, 107, 106, 127, false, false, 203, 89, 76, 107, 106, 127, false, false, 123, false, false, false, false, false, false, false} slot = 0x7f6a6d5cf8b8 equals = true old_isnull = {false, false, false, 109, 106, 127, false, false, 69, 46, 80, 109, 106, 127, false, false, 64, 46, 80, 109, 106, 127, false, false, 72, 46, 80, 109, 106, 127, false, false} new_values = {12, 2, 140095078059546, 16, 140722927572064, 140095077232192, 140095077233456, 140722927572079, 0, 0, 140722927572048, 140095054460096, 140095077050704, 140095078061816, 5, 4, 140722927572096, 140095046814123, 140722927572096, 140095046825162, 140095043418528, 140095077051552, 140722927572224, 140095046865098, 60129542543, 23274993280, 140095043418528, 140095077050704, 140095043417728, 140095077050976, 140095078056288, 140095043422512} indexno = 2 l = 0x7f6a6d503840 estate = 0x7f6a6d4c2a00 old_values = {12, 1, 140078631611970, 1, 140095077050704, 1024, 140095077232192, 0, 140722927571760, 140095049517261, 140722927571808, 140722927571776, 140722927571792, 140095046814329, 18, 140095077232200, 140095076976896, 140095078056288, 22, 100, 140722927571856, 140722927571920, 140095046831813, 140722927571856, 140095046842624, 0, 140095077226392, 3, 140095077232192, 140095077232528, 140095077232192, 140095078061816} #3 heap_update (relation=relation@entry=0x7f6a6b4c3680, otid=otid@entry=0x7ffc9c1c1690, newtup=newtup@entry=0x7f6a6d5ccdd0, cid=0, crosscheck=, wait=wait@entry=true, hufd=hufd@entry=0x7ffc9c1c15b0, lockmode=lockmode@entry=0x7ffc9c1c15a4) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/access/heap/heapam.c:4230 result = xid = 245762845 hot_attrs = 0x7f6a6d503740 proj_idx_attrs = 0x7f6a6d503758 key_attrs = 0x7f6a6d503770 id_attrs = 0x7f6a6d503788 interesting_attrs = 0x7f6a6d5037a0 lp = oldtup = {t_len = 85, t_self = {ip_blkid = {bi_hi = 0, bi_lo = 45}, ip_posid = 10}, t_tableOid = 557732818, t_data = 0x7f669913ee10} heaptup = 0x7f6a6d5ccdd0 old_key_tuple = 0x0 old_key_copied = false page = 0x7f669913d180 "]=" block = mxact_status = buffer = newbuf = 14683 vmbuffer = 0 vmbuffer_new = 0 need_toast = newtupsize = pagefree = have_tuple_lock = false iscombo = false use_hot_update = false hot_attrs_checked = key_intact = all_visible_cleared = false all_visible_cleared_new = false checked_lockers = locker_remains = xmax_new_tuple = xmax_old_tuple = 245762845 infomask_old_tuple = 0 infomask2_old_tuple = 8192 infomask_new_tuple = 144 infomask2_new_tuple = 0 __func__ = "heap_update" #4 0x00007f6a6b82f2c9 in ExecUpdate (mtstate=mtstate@entry=0x7f6a6d4d81c0, tupleid=0x7ffc9c1c1690, oldtuple=0x0, slot=0x7f6a6d5cc160, planSlot=planSlot@entry=0x7f6a6d567578, epqstate=epqstate@entry=0x7f6a6d4d8280, estate=estate@entry=0x7f6a6d4d6a60, canSetTag=true) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/executor/nodeModifyTable.c:1209 lockmode = LockTupleNoKeyExclusive partition_constraint_failed = false tuple = 0x7f6a6d5ccdd0 resultRelInfo = 0x7f6a6d4d6ca0 resultRelationDesc = 0x7f6a6b4c3680 result = hufd = {ctid = {ip_blkid = {bi_hi = 5616, bi_lo = 39964}, ip_posid = 32764}, xmax = 1803594893, cmax = 32618} recheckIndexes = 0x0 saved_tcs_map = 0x0 __func__ = "ExecUpdate" #5 0x00007f6a6b82f978 in ExecModifyTable (pstate=0x7f6a6d4d81c0) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/executor/nodeModifyTable.c:2166 node = 0x7f6a6d4d81c0 proute = 0x0 estate = 0x7f6a6d4d6a60 operation = CMD_UPDATE saved_resultRelInfo = 0x0 resultRelInfo = 0x7f6a6d4d6ca0 subplanstate = 0x7f6a6d566988 junkfilter = 0x7f6a6d5cc038 slot = tupleid = tuple_ctid = {ip_blkid = {bi_hi = 0, bi_lo = 45}, ip_posid = 10} oldtupdata = {t_len = 2619086544, t_self = {ip_blkid = {bi_hi = 32764, bi_lo = 0}, ip_posid = 9204}, t_tableOid = 32618, t_data = 0x7ffc9c1c16d0} oldtuple = __func__ = "ExecModifyTable" #6 0x00007f6a6b80b25b in ExecProcNode (node=0x7f6a6d4d81c0) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/include/executor/executor.h:237 No locals. #7 ExecutePlan (execute_once=, dest=0x7f6a6d5e9448, direction=, numberTuples=0, sendTuples=false, operation=CMD_UPDATE, use_parallel_mode=, planstate=0x7f6a6d4d81c0, estate=0x7f6a6d4d6a60) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/executor/execMain.c:1723 slot = current_tuple_count = 0 #8 standard_ExecutorRun (queryDesc=0x7f6a6d566040, direction=, count=0, execute_once=) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/executor/execMain.c:364 estate = 0x7f6a6d4d6a60 operation = CMD_UPDATE dest = 0x7f6a6d5e9448 sendTuples = __func__ = "standard_ExecutorRun" #9 0x00007f6a6b95b41d in ProcessQuery (plan=, sourceText=0x7f6a6d3b45a0 "UPDATE public.schedulecard SET ext_ident=NULL, finalreport_absence_cnt=NULL, period_day=2, period_num=1, rotates=false, rotationgroup_id=NULL, schedulecard_id=NULL, schedulecardblock_id=NULL, schedule"..., params=0x0, queryEnv=0x0, dest=0x7f6a6d5e9448, completionTag=0x7ffc9c1c19d0 "") at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/tcop/pquery.c:161 queryDesc = 0x7f6a6d566040 #10 0x00007f6a6b95b668 in PortalRunMulti (portal=portal@entry=0x7f6a6d479d00, isTopLevel=isTopLevel@entry=true, setHoldSnapshot=setHoldSnapshot@entry=false, dest=dest@entry=0x7f6a6d5e9448, altdest=altdest@entry=0x7f6a6d5e9448, completionTag=completionTag@entry=0x7ffc9c1c19d0 "") at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/tcop/pquery.c:1286 pstmt = 0x7f6a6d5e92e8 active_snapshot_set = true stmtlist_item = 0x7f6a6d5e93f8 #11 0x00007f6a6b95c2d5 in PortalRun (portal=portal@entry=0x7f6a6d479d00, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x7f6a6d5e9448, altdest=altdest@entry=0x7f6a6d5e9448, completionTag=completionTag@entry=0x7ffc9c1c19d0 "") at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/tcop/pquery.c:799 save_exception_stack = 0x7ffc9c1c1c00 save_context_stack = 0x0 local_sigjmp_buf = {{__jmpbuf = {140722927574016, 7153736072036697610, 140095075869728, 140722927573456, 140095076670720, 140095075869776, 7153736071992657418, 7091693995611473418}, __mask_was_saved = 0, __saved_mask = {__val = {0, 140723125634669, 0, 140095051070678, 64, 112, 140095075869728, 140095075861648, 140095078175768, 140722927573328, 140095049517496, 140722927573360, 2, 140095075869728, 2, 140722927573360}}}} result = nprocessed = saveTopTransactionResourceOwner = 0x7f6a6d41b148 saveTopTransactionContext = 0x7f6a6d48d8d0 saveActivePortal = 0x0 saveResourceOwner = 0x7f6a6d41b148 savePortalContext = 0x0 saveMemoryContext = 0x7f6a6d48d8d0 __func__ = "PortalRun" #12 0x00007f6a6b957f7f in exec_simple_query (query_string=0x7f6a6d3b45a0 "UPDATE public.schedulecard SET ext_ident=NULL, finalreport_absence_cnt=NULL, period_day=2, period_num=1, rotates=false, rotationgroup_id=NULL, schedulecard_id=NULL, schedulecardblock_id=NULL, schedule"...) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/tcop/postgres.c:1122 parsetree = 0x7f6a6d3b6420 portal = 0x7f6a6d479d00 snapshot_set = commandTag = completionTag = "\000\032\034\234\374\177\000\000\341\356\247kj\177\000\000\000\000\000\000\000\000\000\000\060\316\367kj\177\000\000\340&\360kj\177\000\000\234U\357kj\177\000\000\240E;mj\177\000\000Q\000\000\000\000\000\000" querytree_list = plantree_list = receiver = 0x7f6a6d5e9448 format = 0 dest = DestRemote parsetree_list = 0x7f6a6d3b6470 parsetree_item = 0x7f6a6d3b6450 save_log_statement_stats = false was_logged = false use_implicit_block = false msec_str = "\000\032\034\234\374\177\000\000\341\356\247kj\177\000\000\000\000\000\000\000\000\000\000\060\316\367kj\177\000" __func__ = "exec_simple_query" #13 0x00007f6a6b95930a in PostgresMain (argc=, argv=argv@entry=0x7f6a6d400400, dbname=0x7f6a6d4003e0 "mydb", username=) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/tcop/postgres.c:4159 query_string = 0x7f6a6d3b45a0 "UPDATE public.schedulecard SET ext_ident=NULL, finalreport_absence_cnt=NULL, period_day=2, period_num=1, rotates=false, rotationgroup_id=NULL, schedulecard_id=NULL, schedulecardblock_id=NULL, schedule"... firstchar = 81 input_message = {data = 0x7f6a6d3b45a0 "UPDATE public.schedulecard SET ext_ident=NULL, finalreport_absence_cnt=NULL, period_day=2, period_num=1, rotates=false, rotationgroup_id=NULL, schedulecard_id=NULL, schedulecardblock_id=NULL, schedule"..., len = 328, maxlen = 1024, cursor = 328} local_sigjmp_buf = {{__jmpbuf = {140095054460088, 7153736071902479882, 140095054460096, 1, 0, 140095076143920, 7153736071933937162, 7091693993451144714}, __mask_was_saved = 1, __saved_mask = {__val = {0, 140095076143920, 140095004765576, 844424930131970, 206158430256, 140722927574360, 140722927574144, 293, 140095076143920, 0, 0, 140095075861648, 1024, 140722927574468, 0, 140722927574240}}}} send_ready_for_query = false disable_idle_in_transaction_timeout = false __func__ = "PostgresMain" #14 0x00007f6a6b67867d in BackendRun (port=0x7f6a6d3f9330) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/postmaster/postmaster.c:4361 ac = 1 secs = 594683937 usecs = 521905 i = 1 av = 0x7f6a6d400400 maxac = #15 BackendStartup (port=0x7f6a6d3f9330) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/postmaster/postmaster.c:4033 bn = pid = #16 ServerLoop () at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/postmaster/postmaster.c:1706 rmask = {fds_bits = {8, 0 }} selres = now = readmask = {fds_bits = {200, 0 }} last_lockfile_recheck_time = 1541368681 last_touch_time = 1541366480 __func__ = "ServerLoop" #17 0x00007f6a6b8e7644 in PostmasterMain (argc=5, argv=) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/postmaster/postmaster.c:1379 opt = status = userDoption = listen_addr_saved = true i = output_config_variable = __func__ = "PostmasterMain" #18 0x00007f6a6b679616 in main (argc=5, argv=0x7f6a6d3af1f0) at /build/postgresql-11-oDwOcQ/postgresql-11-11.0/build/../src/backend/main/main.c:228 No locals. -- Regards, Ondøej Bouda