From: Alexander Lakhin <exclusion@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: Test harness for regex code (to allow importing Tcl's test suite)
Date: Sun, 17 Jan 2021 10:00:00 +0300
Message-ID: <3206aace-50db-e02a-bbea-76d5cdaa2cb6@gmail.com> (raw)
In-Reply-To: <2878372.1609739236@sss.pgh.pa.us>
References: <2873268.1609732164@sss.pgh.pa.us>
<00A426B2-983A-4996-AF66-C9511B88FFC3@enterprisedb.com>
<2878372.1609739236@sss.pgh.pa.us>
Hello Tom,
04.01.2021 08:47, Tom Lane wrote:
> Hm. There isn't anything about test_regex()'s API that I would want
> to expose to end users ;-) ... it's just designed to replicate the
> test API that Henry Spencer designed a couple decades ago, which IMO
> was not too clean even by the standards of the time.
As test_regex() is not meant to be public, maybe this is of little
importance, but I've found another bug when exploiting the new test module:
select * from test_regex(repeat('(x)', 32), 'a', 'c');
leads to
==00:00:00:05.736 2605072== Invalid write of size 4
==00:00:00:05.736 2605072== at 0x4866D09: setup_test_matches
(test_regex.c:564)
==00:00:00:05.736 2605072== by 0x4867276: test_regex (test_regex.c:105)
==00:00:00:05.736 2605072== by 0x37B10C: ExecMakeTableFunctionResult
(execSRF.c:234)
==00:00:00:05.736 2605072== by 0x38AAA4: FunctionNext
(nodeFunctionscan.c:95)
==00:00:00:05.736 2605072== by 0x37BA68: ExecScanFetch (execScan.c:133)
==00:00:00:05.736 2605072== by 0x37BB05: ExecScan (execScan.c:182)
==00:00:00:05.736 2605072== by 0x38A9CE: ExecFunctionScan
(nodeFunctionscan.c:270)
==00:00:00:05.736 2605072== by 0x378E5D: ExecProcNodeFirst
(execProcnode.c:450)
==00:00:00:05.736 2605072== by 0x372CBC: ExecProcNode (executor.h:247)
==00:00:00:05.736 2605072== by 0x372CBC: ExecutePlan (execMain.c:1542)
==00:00:00:05.736 2605072== by 0x372E22: standard_ExecutorRun
(execMain.c:364)
==00:00:00:05.736 2605072== by 0x372EF2: ExecutorRun (execMain.c:308)
==00:00:00:05.736 2605072== by 0x4E2B77: PortalRunSelect (pquery.c:912)
==00:00:00:05.736 2605072== Address 0xee4d5ec is 908 bytes inside a
block of size 1,024 alloc'd
==00:00:00:05.736 2605072== at 0x483B7F3: malloc (in
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:00:05.736 2605072== by 0x62239C: AllocSetAlloc (aset.c:919)
==00:00:00:05.736 2605072== by 0x629656: palloc0 (mcxt.c:995)
==00:00:00:05.736 2605072== by 0x4866A06: setup_test_matches
(test_regex.c:450)
==00:00:00:05.736 2605072== by 0x4867276: test_regex (test_regex.c:105)
==00:00:00:05.736 2605072== by 0x37B10C: ExecMakeTableFunctionResult
(execSRF.c:234)
==00:00:00:05.736 2605072== by 0x38AAA4: FunctionNext
(nodeFunctionscan.c:95)
==00:00:00:05.736 2605072== by 0x37BA68: ExecScanFetch (execScan.c:133)
==00:00:00:05.736 2605072== by 0x37BB05: ExecScan (execScan.c:182)
==00:00:00:05.736 2605072== by 0x38A9CE: ExecFunctionScan
(nodeFunctionscan.c:270)
==00:00:00:05.736 2605072== by 0x378E5D: ExecProcNodeFirst
(execProcnode.c:450)
==00:00:00:05.736 2605072== by 0x372CBC: ExecProcNode (executor.h:247)
==00:00:00:05.736 2605072== by 0x372CBC: ExecutePlan (execMain.c:1542)
==00:00:00:05.736 2605072==
Best regards,
Alexander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: exclusion@gmail.com, tgl@sss.pgh.pa.us, mark.dilger@enterprisedb.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Test harness for regex code (to allow importing Tcl's test suite)
In-Reply-To: <3206aace-50db-e02a-bbea-76d5cdaa2cb6@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox