-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key "FMT_%Y-%m-%d %H:%M:%S" not known in dictionary #19
Comments
Hmm... Normally it is used in catch in order to initialize localized format (and happens only if either mc gets new format, or it is used first time, or catalog gets shimmered for some reasons, e. g. recompile due to epoch change, etc). At the moment I can imagine one thing only, that could explain that: something trying to produce error message (format it) together with clock, so by first usage of this format in some locale it simply overwrites originated error message. try {
error test
} on error {} {
puts [clock format -now -locale de]--$::errorInfo
} Can you confirm it is scenario like above? I mean no error directly, but remaining as errorInfo (overwriting). Of course I can (and I will) fix that, but in tcl-core are many things that could overwrite -} on error {} {
+} on error {res opts} {
- puts [clock format -now -locale de]--$::errorInfo
+ puts [clock format -now -locale de]--[dict get $opts -errorinfo]
} |
…msgcat, etc) could overwrite interp state (errorInfo/errorCode)
OK, 6c276ea should fix that (and does it), but as you can see the test clock-0.2 (I've provided in 8924ca8) that should cover that, is still failing: https://travis-ci.org/sebres/tclclockmod/jobs/646579330#L431
Now it has been overwritten on another place (and same thing you'd discover sporadically even without tclclockmod with stock tcl-clock module). I'll try to find and solve major things bothering here. |
Failed on the next issue - basically c50b98e should fix that, but it does not. It looks like I found a bug of core Tcl now - So it looks like either |
I think you're right in guessing that the ::errorInfo was getting overwritten during the process of us attempting to log the actual error. In our case, we have a logerr proc that accesses ::errorInfo after invoking logmsg (which is where
|
Thx. Unless it's not fixed (on my side and in core), you can try something like: proc logerr {message} {
+ set errInfo $::errorInfo
logmsg "ERROR: $message" 1
- if {[info exists ::errorInfo]} {
- debug "ERRINFO: $::errorInfo"
+ if {$errInfo ne ""} {
+ debug "ERRINFO: $errInfo"
}
} By the way: Also note such usage of |
I think saving errorInfo at the first possible point is the best solution, it's the same kind of thing you need to do to safely handle errno in C. |
I don't think this can be correct:
|
This is bad idea - |
oh... it looks like it has a timing issue additionally (and a trace binding to % unset errorInfo
% catch {error test}
1
% info exists errorInfo
1
% puts $errorInfo
test
while executing
"error test" I thought about something like: % unset -nocomplain x
% info exists x
0
% proc create-x args {puts **$args**; upvar x x; set x xxx}; trace add variable x read create-x
% info exists x
**x {} read**
1 but don't know exactly what and when would restore the "system" trace back. |
Same results if I don't actually "set" it in any way. [info exists errorInfo] doesn't create it. And is absolutely necessary if you don't know whether it exists, because otherwise referencing it is an error.
I see nothing wrong or unexpected. Your examples also have the results I would expect. |
|
You are right.
A bit unexpected to me was that although it looks like errorInfo is fully traced (and restores read trace by unset), it does not set the value to empty (but it is alright, I was just not aware about that, because preferring options-dict of catch to errorInfo, which is not precise for mentioned reasons).
Sure you are unable to get the trace info, because it is a system trace (not tclish command) - https://github.com/tcltk/tcl/blob/1c9dda6cf6e02b8d8126028ad3477ccd3af42a5f/generic/tclNamesp.c#L582-L585 |
Here is the related bug [554117eddec7220f] in tcl-core. |
It does not look that my fix proposal for bug [554117eddec7220f] will find an acceptance by TCT at the moment (I'd try to introduce new internal command or make a TIP for that later). Anyway it is fixed now directly in tclclockmod - 1c63b9d. So I'll merge that in master (and close the issue) if no objections will follow. |
Sounds good. thanks for your work! |
…e of interp state by select and setup timezone (as well as in other "catched" blocks on lazy loading or initialization); windows: load registry package on demand only (if possible, using same safe "catch" command).
We are occasionally seeing the following traceback error on a production system utilizing tclclockmod 8.6.704:
That appears to be coming from this line:
https://github.com/flightaware/tclclockmod/blob/025c25a/lib/clock.tcl#L826
Any ideas why that might be happening?
The text was updated successfully, but these errors were encountered: