Re: pltcl crashes due to a syntax error

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: pltcl crashes due to a syntax error
Дата
Msg-id 309214c5-d4da-4e00-938d-0e35990e564c@ewie.name
обсуждение исходный текст
Ответ на Re: pltcl crashes due to a syntax error  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pltcl crashes due to a syntax error
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Borisov
Дата:
Сообщение: Re: POC: GROUP BY optimization
Следующее
От: "Tristan Partin"
Дата:
Сообщение: Re: meson and check-tests