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.96) (envelope-from ) id 1vU7af-00HUha-2u for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 18:10:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vU7ae-008uyZ-2Y for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 18:10:05 +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.96) (envelope-from ) id 1vU7ae-008uyR-1W for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 18:10:05 +0000 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vU7aY-000OpH-2J for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 18:10:04 +0000 Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-88242fc32c9so18899696d6.1 for ; Fri, 12 Dec 2025 10:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1765562996; x=1766167796; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Sd0s4eoPPn+0Q1Ut48lFV4+WuB3eNqgZjp77sMhVLb4=; b=CAcRkBm5kBTjm2ECSKOpsZ6ATbFdUmjAb9j0OkCSC8Utno94mqjFu59gIYwWn5NHmP 4AcZWVUQyIyeZcfgea4d7/6BI/zNQlAP159LDZ3Lb+wMxcyLc2hT1rY5LUDXWrpSK89n qxdOhHU5fETQdQrqewwlmqEjnNngJGUUH0dAw6WgmpT7Jkj0Bk9L11gc+IO8OxpZ4ryp C+RespHtrcMOTHfRheoMDyCP0OU+gQK4SdqreS++vXlJR5OwM20e2T9meiQgKc54x6Td SJ5TNTFc877R9ZqU53dQi6PWL2NAjqjRnXSmKG6lCmbgm/DIAogRGtgN2sdkk4FafCHG MFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765562996; x=1766167796; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Sd0s4eoPPn+0Q1Ut48lFV4+WuB3eNqgZjp77sMhVLb4=; b=M1kZVzIzDNgrM7CzlKlK6Dnkb/V+4fBdt6Wai+IMQI8+dSX5d3bbvcYUFG/fjUiEYS AFokPDGuiYnpYN5E62S09QaC8Eg9aOEn2Az9wXIYEYquatcGtLWQAkGXFqW/6APC4tIR JdQhnt5NBysP1H1stg0BwgSgOqkveMtnHilGL9hVVZgqlSu81vKsoANEi5v3kBq99/fB nPKItpJh0eO0fcuPbnvfXSrZAgH7SwjsDLn+6wqvaMWoXNrxz2s6ie3/HzVlcOvVp+JO h3ods3rMnVWUbk6E818mKqNzCxJT8ur9C3XxmPgPxiiF5mGAGWumzi/it44JNWzYeWaS V47A== X-Forwarded-Encrypted: i=1; AJvYcCUsOvzL+Tu8ZO0WtbL5Rfc6AMLlcBGHAl5qtqvzvKdXzZl3AP9EpFxUJm7Y3pHAiL6IIg4VZDSob1O6T0wI@lists.postgresql.org X-Gm-Message-State: AOJu0YyJJiNKfKPLb+KkjcURtY4mCmJW/QEJ++fx/8HzEatt7q1lDp1y rKQAtnGJfdZGxGpO342sVqRvXP30WOqovdB13zqqPBPGx/LPZADgVNkJIdZXU0Y3BTzysJOTEx3 z9GViUPjsxU9X2hnYxL75qUxz8/BspTdufI8V1E9I X-Gm-Gg: AY/fxX7gcODd0aAuH02bxqk/2eby/scmHeGUTE9F3nXy/XTauiPdbZiQGcEVZt5GUYO /3BrCxw45hU66RJJkMeYZGuv+4EXaPfjtDJaDiW4BbsgfrmueqVY+m9IWXP0ABsld3v9vAj/Kr5 +1ggI4uC+f9m2/Qq5toeikxrQ3P0BCd0s9y/4TrQieNdzKYCQe/y3k6ULO2EofQZUPpWwsIlB5K jCydxvAFOfa22gcmLfL0gjAB88d4Sow1/Eeq7kBRs9M6ko/Jdm+jQZSj1KtWAwPU20M+eRxYg== X-Google-Smtp-Source: AGHT+IGxQPPdX1nPAp1VY3T/8G7Q0agpx3kXC93eIF9aeSsRPm/0MA9goWU82RPlJFKzY0Dv9rThczavQ6qZd1Mcjq0= X-Received: by 2002:a05:6214:2b87:b0:86b:9167:b0e9 with SMTP id 6a1803df08f44-8887feff208mr42184826d6.4.1765562996115; Fri, 12 Dec 2025 10:09:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jacob Champion Date: Fri, 12 Dec 2025 10:09:44 -0800 X-Gm-Features: AQt7F2rb6uzdUE6KzlJLNmgwM3TaHWjwY5h-ElYN8prSOSwWuEneiB-tKgQqx9g Message-ID: Subject: Re: pg_plan_advice To: Robert Haas Cc: Dian Fay , Matheus Alcantara , Jakub Wartak , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Dec 12, 2025 at 9:36=E2=80=AFAM Robert Haas = wrote: > At least for me, setting pg_plan_advice.advice to any of these strings > does not provoke a crash. What I discovered after a bit of > experimentation is that you get the crash if you (a) set the string to > something like this and then (b) run an EXPLAIN. Makes sense (this fuzzer was exercising pgpa_format_advice_target()). > > With USE_ASSERT_CHECKING, that should help, but I'm not sure if it > > does without. (I could have sworn there was a conversation about that > > at some point but I can't remember any of the keywords.) Could also > > just make a dummy assignment. Or tag pg_plan_advice_dsa_area() with > > __attribute__((returns_nonnull)), but that's more portability work. > > As in initialize ca_pointer to InvalidDsaPointer? Yeah. Next bit of fuzzer feedback: I need the following diff in pgpa_trove_add_to_hash() to avoid a crash when the hashtable starts to fill up: > element =3D pgpa_trove_entry_insert(hash, key, &found); > + if (!found) > + element->indexes =3D NULL; > element->indexes =3D bms_add_member(element->indexes, index); The advice string that triggered this is horrific, but I can send it to you offline if you're morbidly curious. (I can spend time to minimize it or I can get more fuzzer coverage, and I'd rather do the latter right now :D) --Jacob