[OpenAFS-devel] AFS on Solaris makes deprecative usage of newproc()

Frank Batschulat Frank Batschulat <Frank.Batschulat@Sun.COM>
Wed, 24 Apr 2002 14:14:34 +0200 (MEST)


Hi All,

[Anyone not concerned with AFS on SOLARIS may delete here]

currently AFS makes deprecative usage of the
kernel internal function newproc() to create a process.

<snip>
grep -n newproc *
rx_kcommon.c:914:    if (newproc(rxk_ListenerProc, syscid, 59))

   908   * Run the listener as a kernel process.
   909   */
   910  void rxk_Listener(void)
   911  {
   912      extern id_t syscid;
   913      void rxk_ListenerProc(void);
   914      if (newproc(rxk_ListenerProc, syscid, 59))
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   915          osi_Panic("rxk_Listener: failed to fork listener process!\n");
   916  }
<snip end>

That needs to be changed ! Why ?

newproc() is only designated to be called by Solaris main()
to create pageout and fsflush. It is not a common interface
to create threads, even not generic kernel threads.

newproc() creates system processes (SSYS flag set), system 
processes can not be waited-for by normal processes like init.

You can not call exit() or something similar in a thread
created by newproc(). That would leave it still laying around
as it would not cleaned up, a process with freed threads.

Now bad things are likely to happen then, the deadly
process is now hanging around waiting for some "ps" command
to tripp over and panics the system. This has happened at least
3 times with AFS (the SUN bugid that tracked this was 4663807).

Thus this needs to be changed to either fork() or thread_create().

Thanks
frankB


----------------------------------------------------------
Frank Batschulat, Solaris Kernel Sustaining & Engineering. 

fbatschul@sun.com	     (+49 30) 747 096 845 (x65845)