This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Calling RegisterServiceProcess from setsid ?


At 12:16 AM 6/4/2003 -0400, Christopher Faylor wrote:
>>>I don't know what is specific to rxvt.  Maybe it's the @#(&!
>>>pty/FreeConsole stuff.
>>
>>How do you debug that stuff?  Running under gdb or strace seems to
>>change many things.
>
>Yes, especially on Windows 9x.  I really don't know.  Can you add a
>try_to_debug () at an appropriate point and have it pop up a gdb only
>when necessary?

I have just run fairly extensive tests on WinME with 4 programs
and a cygwin from yesterday's cvs.
- inetd (standard), calls setsid but not RegisterServiceProcess
- cron (standard), ditto
- sshd (standard), calls setsid and RegisterServiceProcess
- exim (special), ditto

I am getting results all over the place. 
Perhaps they make sense to others.

Test 1: run under strace in rxvt windows
****************************************
- inetd: OK, fhandler_console::open_fhs is 0 when calling setsid
- cron:  same
- exim:  same
- sshd: 
/c: strace -o sshd.txt ./sshd
 517345 [main] sshd 938013 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
 529292 [main] sshd 938013 open_stackdumpfile: Dumping stack trace to SSHD.EXE.stackdump
 no useful info in dump.

Test 2: run under rxvt then logoff and login. See what programs are still alive:
********************************************************************************
- exim: yes (expected)
- inetd: no (expected)
- sshd: no  (unexpected)
- cron: no  (expected)

Test 3: run under cygwin.bat then logoff and login. See what programs are still alive:
*************************************************************************************
- exim: yes  (expected)
- inetd: yes (incredible, it doesn't call RegisterServiceProcess)
- sshd: yes  (expected)
- cron: Cron goes into the background. However the windows stays open when 
  exiting the shell. Closing the window causes cron to die.

Test 4: run under cygwin.bat, place try_to_debug () in setsid()
***************************************************************
- exim: fhandler_console::open_fhs is 0 
- inetd: fhandler_console::open_fhs is 2
- cron: fhandler_console::open_fhs is 3
- sshd: fhandler_console::open_fhs is 3
In all cases gdb input and output are in the gdb window.

Test 5: run under rxvt, place try_to_debug () in setsid()
*********************************************************
- exim: fhandler_console::open_fhs is 0 
        gdb input and output are in the gdb window
- inetd: fhandler_console::open_fhs is 2
         gdb input in the gdb window, output is in rxvt
- sshd: cannot gain input to gdb
- cron: ditto.

Pierre

P.S.: unrelated. Sometimes when I start bash for the first time after login
2021798 [main] bash 90753 cygthread::terminate_thread: VirtualFree of allocation base 0x2154FFA0<0x21340000> failed, Win32 error 0



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]