- - Change the ``make load'' test for devfs and udev to be more
exact in its match. usbdevfs was matching, causing the ``make
load'' to not create /dev/srripc. (AT)
- - Added the total trigger count for proxies, and total number of
top and bottom half calls for IRQ handlers. These are visible
in the /proc/srripc filesystem. (AT)
- - *** NOTE *** This is a major functionality change that will
affect virtually nobody. You need to read this only if you
are calling
exec() and expecting blocked tasks and allocated
names to survive the exec() call. ***
-
Make the SRR file descriptor close in a child spawned using a
call to exec(). This partially addresses a serious problem
when using a threaded process to spawn child processes with
fork/exec. It's like this:
-
Linux has the odd behaviour that a multi-threaded program
in Linux closes its file descriptors in a sub-thread, even
if the file descriptor was originally opened in the main
thread. This has the effect of mis-leading the SRR module
into believing that the main thread is still running.
-
Even with this mis-leading information, everything works
fine, until you spawn a child process from the sub-thread
without ever making an SRR call in that sub-thread. The
child process inherits the subthread's SRR file descriptor
(which was itself inherited from the main thread), so it
can hold this file descriptor open indefinitely. If the
child process survives beyond the termination of the main
thread, several things can happen:
1) names are held open after a process dies
2) there can be a kernel panic in flush_signals
3) there can be a kernel "Oops" when a timer expires on
a process that has already terminated.
There may be other effects.
-
In general, this problem appears not to be solvable.
There is no information offered by the kernel to reliably
determine that a process has died in truth. We have only
the file descriptor to go by.
-
In most cases, the problem IS solvable. The SRR module
now sets the FD_CLOEXEC flag on the SRR file descriptor by
default. This is technically a break from the behaviour
of QNX, which will allow a process to call exec() without
releasing names or unblocking blocked senders. This case
is very rare, however. For people who need this
behaviour, there is a new function call, SrrSurviveExec()
with no arguments, that will give the QNX-like behaviour.
It must be called once per thread within a program.
-
If you need both the QNX-like exec behaviour and the safer
child process behaviour, you will have to change one or
the other. If you are calling fork+exec in succession to
spawn a process, you definitely do not need the QNX-like
behaviour.
-
The slightly more technical explanation is this:
Parent mainline (P) starts thread (T), which fork/exec's
child (C) which makes no SRR calls. If C survives the
death of P, then it will hold open P's file descriptor
(FD). In Linux, FD is closed in the parent by T, not by
P, so SRR cannot tell that P has died. It uses the final
close of FD as evidence that P has died, but C is holding
FD open, so P appears to still be active. P does not
appear to die until C dies. If P is holding a name, the
name will appear to still be active. When C dies, the
cleanup code for P could attempt to access a now defunct
kernel task structure, which will cause a panic.
-
If you really want the SRR file descriptor to survive an exec
call, make a call to SrrSurviveExec() prior to calling exec(),
(but after fork() if you are using it). You would only do
this if you wanted to allocate a name to a process that you
subsequently spawned, or expected to have processes blocked on
the program when the exec call is made, and you want them to
continue to block. You must call SrrSurviveExec once in each
thread that will call exec(). (AT)
- - Add SrrNameAttach and SrrNameLocate tests to exe/pthread2.c
(AT)
- - Simplify un-queuing of proxies with multiple trigger counts so
that there is no window of time where the trigger count is
temporarily zero. This should have no visible effect. (AT)
- - Add many options to exe/pthread2.c for testing purposes. (AT)
- - Modify make file in ./exe to avoid linking to an absolute path
for libsrr.so. (AT)
- - Replace kill_proc_info calls with kill_proc. kill_proc_info
is no longer exported by the kernel as of version 2.6.10. (AT)