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 1rehK5-00Ctgf-Gy for pgsql-odbc@arkaria.postgresql.org; Mon, 26 Feb 2024 20:11:37 +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 1rehK3-00GWNV-UT for pgsql-odbc@arkaria.postgresql.org; Mon, 26 Feb 2024 20:11:36 +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 1rehK3-00GWNN-Nd for pgsql-odbc@lists.postgresql.org; Mon, 26 Feb 2024 20:11:36 +0000 Received: from pgintl.fastcrypt.com ([149.56.129.164]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rehK1-001Fc6-Ck for pgsql-odbc@lists.postgresql.org; Mon, 26 Feb 2024 20:11:35 +0000 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by pgintl.fastcrypt.com (Postfix) with ESMTPSA id 49048202BB for ; Mon, 26 Feb 2024 15:11:31 -0500 (EST) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5655c7dd3b1so5558907a12.0 for ; Mon, 26 Feb 2024 12:11:31 -0800 (PST) X-Gm-Message-State: AOJu0Ywj2S/iW51pTs07KdsdRWCGM+WeaOA9gZRQiF9Ege8NR8jWZ113 GZYIrrsx566Uc+dHPQtfy2DnkKjvIyN6F7sumyw/JloSF49D5/IdcvzokN9D/72ZkGitygGP0P0 o2/srU2y3v1b0SXrSebAKMvEzZNI= X-Google-Smtp-Source: AGHT+IHPOnDQNCaJA7kbwZKA6RFzx6yMcgLztgCJUQDHQcOKWMu1VXXrLR1pXr2rdUzYDkQR0aSPN3kP0Pp2qgS5btY= X-Received: by 2002:a17:907:b9c4:b0:a43:2f96:3bc6 with SMTP id xa4-20020a170907b9c400b00a432f963bc6mr4046230ejc.4.1708978290112; Mon, 26 Feb 2024 12:11:30 -0800 (PST) MIME-Version: 1.0 References: <112f6883-34e4-4372-8bda-d04f45ee31bf@gmail.com> In-Reply-To: <112f6883-34e4-4372-8bda-d04f45ee31bf@gmail.com> From: Dave Cramer Date: Mon, 26 Feb 2024 15:11:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: psqlodbc crashes while collecting diagnostic records with SQLGetDiagRecW To: Andrey Sukhanov Cc: pgsql-odbc@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000e93d7006124e835a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e93d7006124e835a Content-Type: text/plain; charset="UTF-8" Hi Andrey, I've tried on PostgreSQL 11 and 15 with no luck to replicate this problem. Is it possible for you to debug it and send more information? Dave Cramer www.postgres.rocks On Thu, 22 Feb 2024 at 01:29, Andrey Sukhanov wrote: > Dear pgsql-odbc developers, > > Windows 10, psqlodbc 16 (psqlodbc35w.dll), postgresql 11. > Getting certain amount of diagnostic records with SQLGetDiagRecW crashes > the application with memory access violation. > > Steps to reproduce: > 1. Create procedure: > CREATE OR REPLACE PROCEDURE crashme() > LANGUAGE plpgsql > AS $$ > BEGIN > FOR i IN 1..841 LOOP > RAISE NOTICE 'msgmsgmsgmsg (%)', i; > END LOOP; > END; $$; > > 2. Use example code in attachments. > 3. Application crashes with memory access violation after calling > SQLGetDiagRecW function, with iRecord = 332. > Application doesn't crash if number of iterations in procedure's for > loop is changed. > Expected outcome: SQLGetDiagRecW would return SQL_NO_DATA when there's > no more diagnostic records. > > Regards, > Andrey > --000000000000e93d7006124e835a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Andrey,

I've tried on Postg= reSQL 11 and 15 with no luck to replicate this problem.

Is it possible for you to debug it and send more information?

Dave Cramer
www.postgres.= rocks


On Thu, 22 Feb 2024 at 01:29, Andrey= Sukhanov <siwenter@gmail.com&= gt; wrote:
Dear = pgsql-odbc developers,

Windows 10,=C2=A0 psqlodbc 16 (psqlodbc35w.dll), postgresql 11.
Getting certain amount of diagnostic records with SQLGetDiagRecW crashes the application with memory access violation.

Steps to reproduce:
1. Create procedure:
CREATE OR REPLACE PROCEDURE crashme()
LANGUAGE plpgsql
AS $$
BEGIN
FOR i IN 1..841 LOOP
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RAISE NOTICE 'msgmsgms= gmsg (%)', i;
END LOOP;
END; $$;

2. Use example code in attachments.
3. Application crashes with memory access violation after calling
SQLGetDiagRecW function, with iRecord =3D 332.
Application doesn't crash if number of iterations in=C2=A0 procedure= 9;s for
loop is changed.
Expected outcome: SQLGetDiagRecW would return SQL_NO_DATA when there's =
no more diagnostic records.

Regards,
Andrey
--000000000000e93d7006124e835a--