TRM3 Signal Handling problems in Linux and Unix - K4000023 - 15 Sep 2000
The Unix/Linux terminal manager attempts to catch signals so that it can shut down cleanly in the event of a severe problem or error, such as segmentation fault (protection violation) or a terminal hang up. Under certain circumstances this can cause problems.
- On Linux, signals are handled differently from on Unix - in particular TRM3 assumed that if it raised the same signal again from within a signal handler, then the signal handler would not be invoked. This is standard on behaviour on Unix. On Linux the signal handler is invoked, which can result in an endless recursion which never terminates (because a stack fault gives rise to a signal which is also handled!). On SuSe Linux this can result in a operating system panic, and Linux cannot be shut down cleanly. On Red Hat the problem seems marginally less severe, as the OS seems to realise there is a problem and does a kill -9 on TRM3. This difference is most likely due to our having slightly different versions of the Linux Kernel for the two flavours of Linux.
TRM3 has been modified so that on Linux the signal handler resets the signal handler to the default handler to prevent recursion.
Unfortunately a similar problem can occur with the DP4 interface code linked into every DP4 Linux program. Therefore it will be necessary for us to release a complete new set of Linux executables to fix this problem properly.
If a signal is raised before TRM3 completes its initialisation, TRM3 would not always terminate cleanly. In some circumstances FAIL 13 0 21 was generated, as the terminal manager attempted a clean up which failed. On SuSe Linux this was followed by a panic as described above. On Unix the application hung. This problem is fixed in TRM3.
The second of these problems was reported by a client running DP4 shutdown as part of an end of day script. When attempting something similar you may like to note the following points:
- SHUTDOWN is one of a number of utilities that accept the command tail -SILENT. This stops the program making any attempt to access the screen or keyboard, and it is a good idea to use this tail if there is a chance that DP4 may be in an unstable state - for example following the use of kill -9 or after programs have failed to terminate cleanly for some reason. It is also a good idea to use it if programs are run in the background and should not access the screen, or may be denied access to it.
- You can kill a DP4 program using the Unix kill command. You can kill either the application itself or its TRM3. Following a call to kill you should wait five seconds for the kill to succeed. This gives the application a chance to clean up. When you kill an application it will set an alarm so that if it is still running after five seconds it will be killed anyway. In exceptional circumstances this alarm may fail, so you may if you wish attempt a kill -9 after waiting for this amount of time. However, following a kill -9 the IPC used by DP4 will be in an indeterminate state, and DP4 may no longer run properly. You should use ipcrm to remove DP4 related IPC.
DP4 Products/Versions Affected
4.519+
Where the version affected is given as 4.5xx or 4.6xx, all versions of DP4
issued prior to the date of the fix are potentially affected. Where a specific
version number is given the problem was introduced by that release and prior
releases are unaffected. If a patch release number is also specified (in
parentheses) , the fault was introduced at that specific patch level.
Downloads
Please contact us if you require this fix, stating for which version of Unix/Linux it is required.
Due to limitations on available web space downloadable fixes are only available
for the most commonly used environments, and may not be separately available in
both 4.5xx and 4.6xx flavours. If a file you require is not available you can
ask us to e-mail it to you.