DomainID<>WimpTaskhandle / FilterManager issues
Jon Abbott (1421) 2651 posts |
I’ve noticed the Wimp Taskhandle is slightly different from the DomainID, does that mean more than one Task can be associated with a DomainID? I’m trying to figure out the cleanest way of removing Filters from a Wimp task when the task closes without calling Wimp_CloseDown. I’m using Service_WimpCloseDown to determine in the task is one associated with a domainID ADFFS is managing, so Filters are removed when the domainID dies. …which leads me on to the root cause of why I have that issue in the first place. Filter manager isn’t removing filters associated with explicit tasks when they close, leaving it in an odd state. It appears to fall over as soon as it hits a Filter that’s associated with a task that no longer exists. *Filters also returns a truncated list of filters, stopping as soon as it reports a Filter has no task. |
nemo (145) 2547 posts |
Task handles are actually 16bit numbers. The Wimp decorates them with a cycle number in the top 16bits so that when one task ends and another starts and is given the same handle, other tasks don’t mistake it for its predecessor. I’m not sure if it’s documented (ha!) that you should mask off the top 16bits when comparing task handles in Filter handlers. As for your other issues, I’ll have a play. |
nemo (145) 2547 posts |
You’re right of course. And as FilterManager only has the undecorated task handle, it will falsely match a new task. For example, my PublicFilter module filters three Filer icon tasks. I just killed ShareFS and then ran Paint, and… As it happens I was looking at FilterManager very recently, and it’s very very simple. Inexplicably it only responds to Service_WimpRegisterFilters, and not Wimp_CloseDown (which it obviously absolutely has to). This is a bad bug, and the fact that it doesn’t seem to be widely known indicates exactly how often filters are used, evidently. Perhaps the filter owner is expected to spot the closedown… but it’s an omission, and a dangerous one. I’ll write it up. |
Jon Abbott (1421) 2651 posts |
Perhaps one of the OS developers could confirm if this is or isn’t a bug. It certainly looks like one to me as I’d expect FilterManager to both ensure task specific filters are only assigned to that task and are removed if a task quits. |
nemo (145) 2547 posts |
It’s a feature not a bug – it doesn’t attempt to handle tasks that have quit, other than by displaying the task handle in hex if it can’t look up its name. It is not a useful feature and should be retired. I have a prototype. |
Chris Evans (457) 1614 posts |
Could any software be relying on this ‘feature’ ? |
nemo (145) 2547 posts |
I’d think not. After all, the task handle of the task that has quit (resulting in a flailing filter flapping about) will be reused, but not necessarily by the next new task – it would depend on how many other (non-filtered) tasks have quit. So one couldn’t even argue that task-quit, task-run would be expected to result in the same (undecorated) task handle… it ain’t necessarily so. It’s a misdesign and a vulnerability. |
Rick Murray (539) 13841 posts |
Change it in the beta build, and see what (if anything) blows up. It’ll surely break less things than ZPP did. ;-) |
Steve Pampling (1551) 8170 posts |
I believe you mean “It is less likely to point out broken items of software than ZPP did” I’ve seen numerous examples of programs on Windows where security fixes stopped the program working because it actually relied on the security hole existing to function. 1 Or the e-reader available from the Cisco training site that thinks the best place to store your reading material is in the… users roaming profile. No, the two items don’t have a nice handy config item marked “store cached files here:”, Yes, I’ve communicated with Cisco on the subject and I expect even less of a response than we had to the serious, show stopping, fault that appeared in Cisco ISE2 that took them 12 months to fix – admittedly the first 8 they didn’t actually do anything other then help maintain the work around which was to supply us with a “Plus licence” for a limited period which was repeated and repeated and repeated… 2 A device connecting as a local authentication database(MAB) client and processed by ISE with the base licence would pass through the first stage of profiling to determine which category it was however since the base licence doesn’t allow said profiling to operate like that it abandoned the process after setting the previous manually set parameters to false(off) and unknown, false and unknown thus locking out any MAC authentication only devices. |
Rick Murray (539) 13841 posts |
The one time I tried the Chrome browser, and realised where it installed itself (hint, it was not Program Files) is the time I erased it and vowed never to touch it again.
All the way through, I’ve been looking at it from the perspective of an end user. I’m a geek, I understand ZPP, I understand null pointers. But also I understand “this program has worked for a decade and now a change in the OS broke it” – which is why I was quite vocal about the need for what we now have – the “carry on blithely unaware compatibility page”. Because while we might enjoy pulling apart stack dumps to work out what just blew up, some people just want the thing “to work” especially if said software is no longer being maintained. And, yes, I also understand the argument that said software is bugged and technically broken, but if it’s worked since the Iyonix, that’s good enough… Let’s leave the job of actually breaking software to ARM architecture changes. :-) |
Jon Abbott (1421) 2651 posts |
I don’t think anything will be relying on FilerManager blowing up when it comes across a Filter assigned to a non-existent task. As for the other issue of it assigning said Filters to newer tasks if they get the same taskID, that should not be an issue either as FilerManager has always had “all tasks” Filters, so it’s unlikely someone would code a Filter to be assigned to a specific task and then by luck test it and find it’s also assigned to a later task and their code work. |
nemo (145) 2547 posts |
I’ve prototyped the fix and it works nicely: Note that the orphaned filter is shown with a taskname of Such orphans could be suppressed entirely from the output of As previously mentioned, the filter can’t be discarded when the target task quits, because the filter owner may try to deregister it later, and we don’t want to generate an error where previously we did not. The event mask is not used for filter matching so won’t affect that. Also note that it is still possible to have filters attached to tasks that TaskManager is unaware of (and hence |