Error when being away from my computer for some time (8.5)

Bug #196306 reported by sander
2
Affects Status Importance Assigned to Milestone
Coccinella
Fix Released
High
Mats

Bug Description

can't read "shot(::namespace inscope ::AutoAway XAwayCmd)": no such element in array
can't read "shot(::namespace inscope ::AutoAway XAwayCmd)": no such element in array
    while executing
"if {$shot($name)} {
  set shot($name) 0
  uplevel #0 $name active
     }"
    (procedure "poll" line 20)
    invoked from within
"poll"
    (in namespace inscope "::idletime" script line 1)
    invoked from within
"::namespace inscope ::idletime poll"
    ("after" script)

sander (s-devrieze)
Changed in coccinella:
assignee: nobody → matsben
importance: Undecided → High
Revision history for this message
Mats (matsben) wrote : Re: [Bug 196306] [NEW] Error when being away from my computer for some time (8.5)

This one beats me. I can't reproduce it and I can't see how it can happen.
The 'state' and 'shot' vars are always updated in parallell:

proc ::idletime::add {procName secs} {
    variable state
    variable shot

    set state($procName) $secs
    set shot($procName) 0
}

proc ::idletime::remove {procName} {
    variable state
    variable shot

    unset -nocomplain state($procName)
    unset -nocomplain shot($procName)
}

I need some more info on exactly this happens. And perhaps some debugging:
parray idletime::state
parray idletime::shot

Revision history for this message
sander (s-devrieze) wrote :

I entered these commands when the error was on the screen (I was logged out for some unknown reason):

% parray idletime::state
idletime::state(::namespace inscope ::AutoAway LogoutCmd) = 60
% parray idletime::shot
idletime::shot(::namespace inscope ::AutoAway LogoutCmd) = 1

The error is exactly the same.

Revision history for this message
Mats (matsben) wrote : Re: [Bug 196306] Re: Error when being away from my computer for some time (8.5)

I still don't see it. These two arrays are perfectly in sync having
the same names.
I assume that the error this time was

can't read "shot(::namespace inscope ::AutoAway AwayCmd)": no such
element in array

and not

can't read "shot(::namespace inscope ::AutoAway XAwayCmd)": no such
element in array

I have checked in a new idletime.tcl with debug info. See what you get
with this one.

Revision history for this message
sander (s-devrieze) wrote :
Download full text (376.8 KiB)

With debug code, the error is this:

can't read "shot(::namespace inscope ::AutoAway XAwayCmd)": no such element in array
can't read "shot(::namespace inscope ::AutoAway XAwayCmd)": no such element in array
    while executing
"if {$shot($name)} {
  set shot($name) 0
  uplevel #0 $name active
     }"
    (procedure "poll" line 28)
    invoked from within
"poll"
    (in namespace inscope "::idletime" script line 1)
    invoked from within
"::namespace inscope ::idletime poll"
    ("after" script)

And the console has this debug output (long!):

% ::idletime::poll idlesecs=1
::idletime::poll idlesecs=3
state(::namespace inscope ::AutoAway AwayCmd) = 120
state(::namespace inscope ::AutoAway LogoutCmd) = 60
state(::namespace inscope ::AutoAway XAwayCmd) = 1805
shot(::namespace inscope ::AutoAway AwayCmd) = 0
shot(::namespace inscope ::AutoAway LogoutCmd) = 0
shot(::namespace inscope ::AutoAway XAwayCmd) = 0
         name=::namespace inscope ::AutoAway LogoutCmd, secs=60
         name=::namespace inscope ::AutoAway XAwayCmd, secs=1805
         name=::namespace inscope ::AutoAway AwayCmd, secs=120
::idletime::poll idlesecs=0
state(::namespace inscope ::AutoAway AwayCmd) = 120
state(::namespace inscope ::AutoAway LogoutCmd) = 60
state(::namespace inscope ::AutoAway XAwayCmd) = 1805
shot(::namespace inscope ::AutoAway AwayCmd) = 0
shot(::namespace inscope ::AutoAway LogoutCmd) = 0
shot(::namespace inscope ::AutoAway XAwayCmd) = 0
         name=::namespace inscope ::AutoAway LogoutCmd, secs=60
         name=::namespace inscope ::AutoAway XAwayCmd, secs=1805
         name=::namespace inscope ::AutoAway AwayCmd, secs=120
::idletime::poll idlesecs=0
state(::namespace inscope ::AutoAway AwayCmd) = 120
state(::namespace inscope ::AutoAway LogoutCmd) = 60
state(::namespace inscope ::AutoAway XAwayCmd) = 1805
shot(::namespace inscope ::AutoAway AwayCmd) = 0
shot(::namespace inscope ::AutoAway LogoutCmd) = 0
shot(::namespace inscope ::AutoAway XAwayCmd) = 0
         name=::namespace inscope ::AutoAway LogoutCmd, secs=60
         name=::namespace inscope ::AutoAway XAwayCmd, secs=1805
         name=::namespace inscope ::AutoAway AwayCmd, secs=120
::idletime::poll idlesecs=0
state(::namespace inscope ::AutoAway AwayCmd) = 120
state(::namespace inscope ::AutoAway LogoutCmd) = 60
state(::namespace inscope ::AutoAway XAwayCmd) = 1805
shot(::namespace inscope ::AutoAway AwayCmd) = 0
shot(::namespace inscope ::AutoAway LogoutCmd) = 0
shot(::namespace inscope ::AutoAway XAwayCmd) = 0
         name=::namespace inscope ::AutoAway LogoutCmd, secs=60
         name=::namespace inscope ::AutoAway XAwayCmd, secs=1805
         name=::namespace inscope ::AutoAway AwayCmd, secs=120
::idletime::poll idlesecs=1
state(::namespace inscope ::AutoAway AwayCmd) = 120
state(::namespace inscope ::AutoAway LogoutCmd) = 60
state(::namespace inscope ::AutoAway XAwayCmd) = 1805
shot(::namespace inscope ::AutoAway AwayCmd) = 0
shot(::namespace inscope ::AutoAway LogoutCmd) = 0
shot(::namespace inscope ::AutoAway XAwayCmd) = 0
         name=::namespace inscope ::AutoAway LogoutCmd, secs=60
         name=::namespace inscope ::AutoAway XAwayCmd, secs=1805
       ...

Revision history for this message
Mats (matsben) wrote :

This was a tricky one. The handlers for auto-away were removed when doing the callback for the logout handler. This is a classic situation which van be hard to detect. Untested.

Changed in coccinella:
milestone: none → 0.96.6
status: New → Fix Committed
Revision history for this message
sander (s-devrieze) wrote :

Looks to be fixed; never had this error again.

sander (s-devrieze)
Changed in coccinella:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.