From: | Erik Wienhold <ewie(at)ewie(dot)name> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com>, "a(dot)kozhemyakin" <a(dot)kozhemyakin(at)postgrespro(dot)ru>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: pltcl crashes due to a syntax error |
Date: | 2024-06-03 16:16:48 |
Message-ID: | 309214c5-d4da-4e00-938d-0e35990e564c@ewie.name |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2024-06-03 00:15 +0200, Tom Lane wrote:
> The new bit of information that this bug report provides is that it's
> possible to get a TCL_ERROR result without Tcl having set errorInfo.
> That seems a tad odd, and it must happen only in weird corner cases,
> else we'd have heard of this decades ago. Not sure if it's worth
> trying to characterize those cases further, however.
ISTM that errorInfo is set automatically only during script evaluation.
The Tcl_AddErrorInfo manpage says:
"The -errorinfo option value is gradually built up as an error unwinds
through the nested operations. Each time an error code is returned to
Tcl_Eval, or any of the routines that performs script evaluation, the
procedure Tcl_AddErrorInfo is called to add additional text to the
-errorinfo value describing the command that was being executed when
the error occurred. By the time the error has been passed all the way
back to the application, it will contain a complete trace of the
activity in progress when the error occurred."
Tcl 8.4 basically uses the same wording.
Except for the reported case, we only call throw_tcl_error in three
places, all after checking the return code from Tcl_EvalObjEx. And this
one Tcl_ListObjGetElements instance is not called during script
evaluation.
> > Or just do away with throw_tcl_error and call ereport directly.
>
> I'd say this adds to the importance of having throw_tcl_error,
> because now it's even more complex than before, and there are
> multiple call sites.
I agree to have some uniform error handling. But from the current usage
it looks as if throw_tcl_error is tied to Tcl_EvalObjEx.
--
Erik
From | Date | Subject | |
---|---|---|---|
Next Message | Tristan Partin | 2024-06-03 16:34:23 | Re: meson and check-tests |
Previous Message | Pavel Borisov | 2024-06-03 15:54:53 | Re: POC: GROUP BY optimization |