Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qN9PH-004BuA-AV for pgsql-bugs@arkaria.postgresql.org; Sat, 22 Jul 2023 10:00:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qN9PD-00DjS9-K7 for pgsql-bugs@arkaria.postgresql.org; Sat, 22 Jul 2023 10:00:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qN9PD-00DjS1-A0 for pgsql-bugs@lists.postgresql.org; Sat, 22 Jul 2023 10:00:07 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qN9P9-0016oq-KX for pgsql-bugs@lists.postgresql.org; Sat, 22 Jul 2023 10:00:06 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fb8574a3a1so4277045e87.1 for ; Sat, 22 Jul 2023 03:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690020003; x=1690624803; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=MNdz/58pQnfaVeKIPpjnCiHj4PVUeJx87SXZl3k1K7Q=; b=k/WmEzIEzBWYPYu4V0eQEiIvHnxfBpJT+uy+CsQTiV8ONTvTUoaCa6FvBf6AXfmRto i13gtQ+C85eQiL8L4tLtm/1kGTC7BsUZ9ojQxp1yZT/4niDx5vDl0UDSvYByuBIfB4d2 lRwwD9rYRTbMk2TDF3IfqUNYKpkBtQwxiJOLFLaZylLAdQz/5xcYLgFmtuo4HL60RJUd +/VH5b6cOjFtMhlIlhVlMQ3q1j1x41Q6LPAxxsl2ijFiGinjDZAoIbZ3BOjhrtpS6Jyq B7AKFCmJHzkjcg1Q7WbMcPXivWXcnxIVcn5Z3E87XhpNtKZxGdfqQKMPjDHaXxkP2z7f 7hVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690020003; x=1690624803; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MNdz/58pQnfaVeKIPpjnCiHj4PVUeJx87SXZl3k1K7Q=; b=O3sC0vTkkKVtQk9utnQniRosg5esiAe0VUxvuMsVct5c0UU8pcxBESSHUj/cvd9HXO qYLHf7uS+hx64cq68RRCMgaL1QX7DX37nQznrLcLf4+Sf6XjeDCSXYVTY4z5evFO5NOP eataE8K7oLm7lM13nVDvpVZrIfSEIKGdiU/wVtiJ55bA7xMePCOL8J4dzC5LPOO5QqOD GyzTIZrE2o0iUE6SLEhxRxBJTMzSbOEMcJLnBcnlzw4qqTFOush7oHvGoD/ahTYi0JhX VrrOQZflpxyJY6tSB0OQp/iSWLny2lxLOQi774PWoWRWgSnDGQIQQ7wlsZAzWGb5cbZr s1Nw== X-Gm-Message-State: ABy/qLaj4wdAv/ak3OytiY9TWk3T3i6QhWVBOR6pyHFz3NqOMda+NUff HukcagZmdzC6MwLs3yTZPTQ= X-Google-Smtp-Source: APBJJlHI+AL/4cr7lND8hL/sfrSV+tz96Np2J8ZVYclZNXMb8jCFT7ClhuAI5fzKMyKOqI12bqG1Xg== X-Received: by 2002:a05:6512:3142:b0:4fb:8f81:4fe8 with SMTP id s2-20020a056512314200b004fb8f814fe8mr2437443lfi.46.1690020003274; Sat, 22 Jul 2023 03:00:03 -0700 (PDT) Received: from [1.0.0.7] ([178.155.25.194]) by smtp.gmail.com with ESMTPSA id a9-20020a056512020900b004fdb9ac8563sm1137660lfo.125.2023.07.22.03.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Jul 2023 03:00:02 -0700 (PDT) Message-ID: Date: Sat, 22 Jul 2023 13:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #18031: Segmentation fault after deadlock within VACUUM's parallel worker Content-Language: en-US To: Masahiko Sawada , pgsql-bugs@lists.postgresql.org Cc: Andres Freund References: <18031-ebe2d08cb405f6cc@postgresql.org> From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Sawada-san, 21.07.2023 11:01, Masahiko Sawada wrote: > ... > leading to calling RemoveFromWaitQueue() again. I think we should use > dclist_delete_from_thoroughly() instead. With the attached patch, the > issue doesn't happen in my environment. Thank you for the analysis and the patch! It fixes the issue for me too. > Another thing I noticed is that the Assert(waitLock) in > RemoveFromWaitQueue() is useless actually, since we access *waitLock > before that: Yeah, I also noticed that, and a simple grep-based script with a little eyeballing discovered one similar Assert usage: void llvm_split_symbol_name(const char *name, char **modname, char **funcname) { ...         *funcname = rindex(name, '.');         (*funcname)++;            /* jump over . */         *modname = pnstrdup(name + strlen("pgextern."),                             *funcname - name - strlen("pgextern.") - 1);         Assert(funcname); May be it's worth to fix it in passing. Best regards, Alexander