Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #431: Borg implants are failing


comp / comp.lang.tcl / Re: [info stacktrace] → ask for assistance

SubjectAuthor
* [info stacktrace] → ask for assistanceaotto1968
`* Re: [info stacktrace] → ask for assistanceHarald Oehlmann
 `* Re: [info stacktrace] → ask for assistanceaotto1968
  `* Re: [info stacktrace] → ask for assistanceRalf Fassel
   `- Re: [info stacktrace] → ask for assistanceaotto1968

1
Subject: [info stacktrace] → ask for assistance
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 25 Nov 2024 21:13 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: [info_stacktrace]_→_ask_for_assistance
Date: Mon, 25 Nov 2024 22:13:38 +0100
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <vi2pa2$30fe0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Nov 2024 22:13:39 +0100 (CET)
Injection-Info: dont-email.me; posting-host="b7e89338bbfee4f9f25a46a8094317aa";
logging-data="3161536"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tU0eJwKHebGanWsGD8rzl+YjKEmA4SWw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Ap9XBGHQgzDGSC9X2oSooSM/1zU=
Content-Language: en-US
View all headers

Hi,

my goal is to transfer the "errorInfo" into a "stacktrace" used by my SW.

-> I require: command, fileName and lineNumber
-> the [info errorstack] return "something" which is missing some essential parts.

[info errorstack]:
> INNER {invokeStk1 ::tcllcconfig::LcSettingC::MK_NULL LookupBool in} CALL {::oo::Obj40::my LcSettingLookupBool}

as I understand:

$setting LookupBool $name == ::tcllcconfig::LcSettingC::MK_NULL LookupBool in
-> problem: post versa pre parse expression
-> problem: the fileName(class etc) is *not* available

==== lcconfig-2-0-5-(0-0-0+binary+pipe+tcl.pipe.pipe) use invalid cfs FAILED
---- Result was:
C> (client-0-0-0) [ServiceCallError] <Tok|2E3A471B{LcSettingRpc::LookupBool}> <Num|1>
S> (server-0-0-0) [tcl_mqmsgque_ServiceCall] 'LcSettingC' hdl is NULL
while executing
"$setting LookupBool $name"
(class "::LibLcConfigRpcServer" method "LcSettingLookupBool" line 4)
invoked from within
"::oo::Obj40::my LcSettingLookupBool"
C> (client-0-0-0) | 871 | send_mq.c | MqSendEND_AND_WAIT_RT
C> (client-0-0-0) | 508 | high_lng.h | $ctx Send 'W' ... '2E3A471B{LcSettingRpc::LookupBool}:HC@O' ...
C> (client-0-0-0) | 522 | high_lng.h | $ctx Send...
C> (client-0-0-0) | 75 | ~KernelRpcClient.tcl | my Send $typ $fmt {*}$args
C> (client-0-0-0) | 588 | ~ConfigRpcClient.tcl | $rpc send "W" "2E3A471B{LcSettingRpc::LookupBool}:HC@O" $hdl $name
C> (client-0-0-0) | 3 | lcconfig.test | $null LookupBool in
C> (client-0-0-0) | 2405 | tcltest-2.5.3.tm | uplevel 1 $script
C> (client-0-0-0) | 1 | lcconfig.test | ::tcltest::RunTest lcconfig-2-0-5-(0-0-0+binary+pipe+tcl.pipe.pipe) { ...
C> (client-0-0-0) | 1651 | tcltest-2.5.3.tm | uplevel 1 $script
C> (client-0-0-0) | 1 | lcconfig.test | ::tcltest::Eval {::tcltest::RunTest
lcconfig-2-0-5-(0-0-0+binary+pipe+tcl.pipe.pipe) { ...
C> (client-0-0-0) | 2021 | tcltest-2.5.3.tm | uplevel 1 [list [namespace origin Eval] $command 1]
C> (client-0-0-0) | 87 | lcconfig.test | test lcconfig-2-0-5-($F+$B+$C+$S) { use invalid cfs } -constraints {$B
eq "binary"} -setup { ...
C> (client-0-0-0) | 6 | lcconfig.test | foreach F [handles] { ...
C> (client-0-0-0) | 649 | library.tcl | uplevel $code
C> (client-0-0-0) | 195 | lcconfig.test | Block 2 { ...
C> (client-0-0-0) | 104 | lcconfig.test | foreach S [filter SRV_LST $C ] { ...
C> (client-0-0-0) | 101 | lcconfig.test | foreach C [getEnv COM_LST] { ...
C> (client-0-0-0) | 98 | lcconfig.test | foreach B [getEnv BIN_LST] { ...

Subject: Re: [info stacktrace] → ask for assistance
From: Harald Oehlmann
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 26 Nov 2024 08:09 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re:_[info_stacktrace]_→_ask_for_assistance
Date: Tue, 26 Nov 2024 09:09:16 +0100
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <vi3vnc$3c7g5$1@dont-email.me>
References: <vi2pa2$30fe0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Nov 2024 09:09:17 +0100 (CET)
Injection-Info: dont-email.me; posting-host="7256556c30bd55e97c675ffc95e63c0b";
logging-data="3546629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dekrBWBoNuusN9JHUpb7y"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:8qOY2chca6U/99wMCTyG5y5kyhE=
Content-Language: en-GB
In-Reply-To: <vi2pa2$30fe0$1@dont-email.me>
View all headers

Hi,
remark that "info errorstack" and the stack trace are different things.
In the first, variable names are replaced by values.
In the second, there are the variable names "$var".

They don't match directly.

THanks,
Harald

Am 25.11.2024 um 22:13 schrieb aotto1968:
> Hi,
>
> my goal is to transfer the "errorInfo" into a "stacktrace" used by my SW.
>
> -> I require: command, fileName and lineNumber
> -> the [info errorstack] return "something" which is missing some
> essential parts.
>
> [info errorstack]:
> > INNER {invokeStk1 ::tcllcconfig::LcSettingC::MK_NULL LookupBool in}
> CALL {::oo::Obj40::my LcSettingLookupBool}
>
> as I understand:
>
> $setting LookupBool $name == ::tcllcconfig::LcSettingC::MK_NULL
> LookupBool in
> -> problem: post versa pre parse expression
> -> problem: the fileName(class etc) is *not* available
>
>
> ==== lcconfig-2-0-5-(0-0-0+binary+pipe+tcl.pipe.pipe) use invalid cfs
> FAILED
> ---- Result was:
> C> (client-0-0-0)   [ServiceCallError] <Tok|
> 2E3A471B{LcSettingRpc::LookupBool}> <Num|1>
> S> (server-0-0-0)   [tcl_mqmsgque_ServiceCall] 'LcSettingC' hdl is NULL
>     while executing
> "$setting LookupBool $name"
>     (class "::LibLcConfigRpcServer" method "LcSettingLookupBool" line 4)
>     invoked from within
> "::oo::Obj40::my LcSettingLookupBool"
> C> (client-0-0-0)     | 871   | send_mq.c            |
> MqSendEND_AND_WAIT_RT
> C> (client-0-0-0)     | 508   | high_lng.h           | $ctx Send 'W' ...
> '2E3A471B{LcSettingRpc::LookupBool}:HC@O' ...
> C> (client-0-0-0)     | 522   | high_lng.h           | $ctx Send...
> C> (client-0-0-0)     | 75    | ~KernelRpcClient.tcl | my Send $typ $fmt
> {*}$args
> C> (client-0-0-0)     | 588   | ~ConfigRpcClient.tcl | $rpc send "W"
> "2E3A471B{LcSettingRpc::LookupBool}:HC@O" $hdl $name
> C> (client-0-0-0)     | 3     | lcconfig.test        | $null LookupBool in
> C> (client-0-0-0)     | 2405  | tcltest-2.5.3.tm     | uplevel 1 $script
> C> (client-0-0-0)     | 1     | lcconfig.test
> | ::tcltest::RunTest lcconfig-2-0-5-(0-0-0+binary+pipe+tcl.pipe.pipe) { ...
> C> (client-0-0-0)     | 1651  | tcltest-2.5.3.tm     | uplevel 1 $script
> C> (client-0-0-0)     | 1     | lcconfig.test        | ::tcltest::Eval
> {::tcltest::RunTest lcconfig-2-0-5-(0-0-0+binary+pipe+tcl.pipe.pipe) { ...
> C> (client-0-0-0)     | 2021  | tcltest-2.5.3.tm     | uplevel 1 [list
> [namespace origin Eval] $command 1]
> C> (client-0-0-0)     | 87    | lcconfig.test        | test
> lcconfig-2-0-5-($F+$B+$C+$S) { use invalid cfs }  -constraints {$B eq
> "binary"}  -setup { ...
> C> (client-0-0-0)     | 6     | lcconfig.test        | foreach F
> [handles] { ...
> C> (client-0-0-0)     | 649   | library.tcl          | uplevel $code
> C> (client-0-0-0)     | 195   | lcconfig.test        | Block 2 { ...
> C> (client-0-0-0)     | 104   | lcconfig.test        | foreach S [filter
> SRV_LST $C ] { ...
> C> (client-0-0-0)     | 101   | lcconfig.test        | foreach C [getEnv
> COM_LST] { ...
> C> (client-0-0-0)     | 98    | lcconfig.test        | foreach B [getEnv
> BIN_LST] { ...

Subject: Re: [info stacktrace] → ask for assistance
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 26 Nov 2024 18:58 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: Re:_[info_stacktrace]_→_ask_for_assistance
Date: Tue, 26 Nov 2024 19:58:58 +0100
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <vi55pi$3iikp$1@dont-email.me>
References: <vi2pa2$30fe0$1@dont-email.me> <vi3vnc$3c7g5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Nov 2024 19:58:59 +0100 (CET)
Injection-Info: dont-email.me; posting-host="81b0ea2d9679015edaa66f0ae3621f00";
logging-data="3754649"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+a+OdL5ZQJRSiny6k+LHqnMuBudOlB7HE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:pb8KmqZLPtdWDCUhGew+U1sjEFg=
Content-Language: en-US
In-Reply-To: <vi3vnc$3c7g5$1@dont-email.me>
View all headers

On 26.11.24 09:09, Harald Oehlmann wrote:
> Hi,
> remark that "info errorstack" and the stack trace are different things.
> In the first, variable names are replaced by values.
> In the second, there are the variable names "$var".
>
> They don't match directly.
>
> THanks,
> Harald
>

This is funny because "errorInfo" and "errorStack" are written in the same proc "

/*
*----------------------------------------------------------------------
*
* TclLogCommandInfo --
*
* This function is invoked after an error occurs in an interpreter. It
* adds information to iPtr->errorInfo/errorStack fields to describe the
* command that was being executed when the error occurred. When pc and
* tosPtr are non-NULL, conveying a bytecode execution "inner context",
* and the offending instruction is suitable, that inner context is
* recorded in errorStack.
*
* Results:
* None.
*
* Side effects:
* Information about the command is added to errorInfo/errorStack and the
* line number stored internally in the interpreter is set.
*
*----------------------------------------------------------------------
*/

and the "errorInfo" has a BETTER info than the "errorStack" ?

I use to raise MY error in a my-error-raise-proc and I use [info frame..] to collect all
the required data to build my-errorStack proper.

The problem is the "errorStack" from OTHER software or from TCL self witch do NOT
collect all the available Info.

My question is simple:

why someone program a [info errorstack ...] to provide an API for a missing feature and
do NOT call all the data available from [info frame] ?

TCL could have a wonderful "exception" interface

1. The (Tcl_GetReturnOptions) dict is the "exception-object"
> example:
> Tcl_GetReturnOptions(interp,TCL_ERROR): -code 1 -level 0 -errorstack {INNER {invokeStk1
::tcllcconfig::LcSettingC::MK_NULL LookupBool in} CALL {::oo::Obj40::my LcSettingLookupBool}} -errorcode NONE -errorinfo
{'LcSettingC' hdl is NULL
> while executing
> "$setting LookupBool $name"
> (class "::LibLcConfigRpcServer" method "LcSettingLookupBool" line 4)
> invoked from within
> "::oo::Obj40::my LcSettingLookupBool"} -errorline 1
2. The "-errorstack" key has the LIST of [info frame] dicts until catch

-> everyone is happy

Subject: Re: [info stacktrace] → ask for assistance
From: Ralf Fassel
Newsgroups: comp.lang.tcl
Date: Wed, 27 Nov 2024 09:29 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: [info stacktrace] → ask for assistance
Date: Wed, 27 Nov 2024 10:29:54 +0100
Lines: 27
Message-ID: <ygav7w9vxbh.fsf@akutech.de>
References: <vi2pa2$30fe0$1@dont-email.me> <vi3vnc$3c7g5$1@dont-email.me>
<vi55pi$3iikp$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net jTtkHRt57UiCB/4x2fpfgwixeQL+47sYem76O/P1JXUhVPu0o=
Cancel-Lock: sha1:M5u2fjz0ABXlEfVDLOTNUL92ilI= sha1:qOujLV8wNoWMuQApxe6pSNpYo+0= sha256:02lqxuBSKZhjwcmEWC0abbrdhO/QW+HlKDgQaPsH1TY=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
View all headers

* aotto1968 <aotto1968@t-online.de>
| TCL could have a wonderful "exception" interface
>
| 1. The (Tcl_GetReturnOptions) dict is the "exception-object"
| > example:
| > Tcl_GetReturnOptions(interp,TCL_ERROR): -code 1 -level 0
| > -errorstack {INNER {invokeStk1
| > ::tcllcconfig::LcSettingC::MK_NULL LookupBool in} CALL
| > {::oo::Obj40::my LcSettingLookupBool}} -errorcode NONE
| > -errorinfo
| {'LcSettingC' hdl is NULL
| > while executing
| > "$setting LookupBool $name"
| > (class "::LibLcConfigRpcServer" method "LcSettingLookupBool" line 4)
| > invoked from within
| > "::oo::Obj40::my LcSettingLookupBool"} -errorline 1
| 2. The "-errorstack" key has the LIST of [info frame] dicts until catch
>
| -> everyone is happy

I guess your contribution to the TCL code base would probably be
welcome, provided there is agreement on the necessity of this
feature...

=> https://core.tcl-lang.org/tips/doc/trunk/doc/help.md

R'

Subject: Re: [info stacktrace] → ask for assistance
From: aotto1968
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 27 Nov 2024 14:03 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: aotto1968@t-online.de (aotto1968)
Newsgroups: comp.lang.tcl
Subject: Re:_[info_stacktrace]_→_ask_for_assistance
Date: Wed, 27 Nov 2024 15:03:58 +0100
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <vi78se$1cks$1@dont-email.me>
References: <vi2pa2$30fe0$1@dont-email.me> <vi3vnc$3c7g5$1@dont-email.me>
<vi55pi$3iikp$1@dont-email.me> <ygav7w9vxbh.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 27 Nov 2024 15:03:58 +0100 (CET)
Injection-Info: dont-email.me; posting-host="894cb08777de17f8573d47bece0399a9";
logging-data="45724"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xOsOsTQIfYCzrH3gJ+0OOiIE1ZmdRNpU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZkbyqeOCgrJMz1XhCtxOR4+mqNg=
Content-Language: en-US
In-Reply-To: <ygav7w9vxbh.fsf@akutech.de>
View all headers

On 27.11.24 10:29, Ralf Fassel wrote:
> * aotto1968 <aotto1968@t-online.de>
> | TCL could have a wonderful "exception" interface
>>
> | 1. The (Tcl_GetReturnOptions) dict is the "exception-object"
> | > example:
> | > Tcl_GetReturnOptions(interp,TCL_ERROR): -code 1 -level 0
> | > -errorstack {INNER {invokeStk1
> | > ::tcllcconfig::LcSettingC::MK_NULL LookupBool in} CALL
> | > {::oo::Obj40::my LcSettingLookupBool}} -errorcode NONE
> | > -errorinfo
> | {'LcSettingC' hdl is NULL
> | > while executing
> | > "$setting LookupBool $name"
> | > (class "::LibLcConfigRpcServer" method "LcSettingLookupBool" line 4)
> | > invoked from within
> | > "::oo::Obj40::my LcSettingLookupBool"} -errorline 1
> | 2. The "-errorstack" key has the LIST of [info frame] dicts until catch
>>
> | -> everyone is happy
>
> I guess your contribution to the TCL code base would probably be
> welcome, provided there is agreement on the necessity of this
> feature...
>
> => https://core.tcl-lang.org/tips/doc/trunk/doc/help.md
>
> R'

The problem is always "time" … I work with a dozens of languages and TCL is just one of them…
for example today I figured out how to implement this in python…

def MkErrorC_FormatException(err,exp,caller):
err.NoRaise().SetC(str(exp),caller)
tb = exp.__traceback__
while tb is not None:
err.StackFormat(
tb.tb_frame.f_code.co_qualname,
tb.tb_frame.f_code.co_filename,
tb.tb_lineno
)
tb = tb.tb_next

and by-the-way I add a feature to direct "inject" python-code into a python-c-extension without
shipping an extra python source file.

→ My problem is always NOT to drift-away into old-style-language-development…

1

rocksolid light 0.9.8
clearnet tor