Corruption in hooks; hooks not triggering
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Musca |
New
|
Undecided
|
Unassigned |
Bug Description
I wonder if there is some sort of corruption going on in hooks' internal tables. I first noticed the symptoms a couple of months ago (sorry, can't be definite on which dev release number), and maybe it is two bugs manifesting as one.
Symtoms:
The main symptoms are that 1) hooks appear to stop triggering, and 2) that the "show hooks" command outputs garbage or unknown hooks.
1) This one appeared a couple of commits ago: hook appears to never get called. For example, I've always had in my musca config file the hook "hook on ^(add|use) pad 0 0 15 0" to make a small border at the top for a status bar from dzen2. For several weeks now, it seems this hook never gets called as I have to manually run the pad command if I create a new group or if I switch to one that is created on startup but that I haven't used yet (i.e. the bug exists both for startup groups in a new session and for user-created groups in an existing session).
2) This one has been present on and off since I first started using dev, about mid-june. It didn't show itself for a few weeks around early July, but has reappeared in the last few weeks.
After some time in a session, the hook event table appears to become corrupt, as 'musca -c "show hooks"' outputs odd characters for the trigger, e.g "hook on x+ [new line plus undisplayable char] exec kill -usr1 3906". (The odd chars may not necessarily accurately show the state of the internal table since the tty might not be able to display properly the chars that musca -c "show hooks" is sending.) In this example, I don't know what "x+{garbage}" is, but it isn't anything I have set up.
I use hooks to change the state of a status bar script and dynamically create and remove them according to the script. I use them to send a signal to a process whenever I switch groups . The code in a bourne shell script is: $MUSCA -c 'silent hook on ^use exec kill -usr1 '"$$", where $$ is the script's PID. If the script dies, an EXIT trap removes the hook. Somehow, somewhere, the hooks are being corrupted. Also, once I start to see the undisplayable chars in the output of the "show hooks" command, I start to save my work because previous experience suggests that musca is going to crash sooner rather than later (not to imply that it crashes often).
Suggestion: provide a method to remove all hooks. If a hook trigger is corrupted, you can't type in the chars that are needed for musca -c "hook off {chars here} command-to-execute" to remove the hook so it can't be removed.
Sorry for the vague nature of this report; it's one of those things easy to see that there is oddness, but hard to describe.
Nick
May I have a copy of your scripts and .musca_start? I'd like to try and reproduce this, then analyze musca with gdb. Thanks.