Call for testing Cygwin snapshot

David Rothenberger daveroth@acm.org
Mon Dec 12 19:59:00 GMT 2005


On 12/12/2005 2:32 AM, Corinna Vinschen wrote:
> On Dec  8 16:08, David Rothenberger wrote:
>> ----------------------------------------------------------------------
>> Problem 2:
>> ----------------------------------------------------------------------
>> This is also with XEmacs. I normally start XEmacs with the following
>> command from a CMD.EXE shell:
>>
>> c:\cygwin\bin\bash -lc 'setsid xemacs &'
>>
>> If you try that with 'setsid xemacs -q &' and then type
>>
>>   Alt-X "grep" "grep -ni system /etc/passwd"
>>
>> there is no result. Furthermore, typing in XEmacs yields red
>> squares. XEmacs is essentially useless and must be restarted.
>>
>> I see this behavior with the 20051130 snapshot. It works with the
>> 20051118 snapshot but pops a console window when running grep. It
>> works correctly with the 20051110 snapshot.
> 
> You're obviously expecting that we know xemacs.  

No, I wasn't. I was hoping that my instructions would be as easy to
duplicate as the "env" problem above.

> But I can't reproduce this grep problem since I'm unable to start the
> above grep.  The grep submenu is entirely greyed out when I look into
> it.  

I didn't mention the grep submenu. Here's a set of more detailed
instructions.

Here they are again:
1. From a CMD.EXE shell, type
   c:\cygwin\bin\bash -lc 'setsid xemacs -q'
2. In XEmacs, press ALT-x (hold ALT key, press x key, release x key,
   release ALT key)
3. XEmacs will prompt for a command. The prompt will already have 
   "grep -n ". Just add (without quotes) "-i system /etc/passwd" and 
   then press Enter.

The output of the grep command should appear in XEmacs. It
doesn't. If you type anything, you will see red squares. If you
minimize the window and then restore it, you will see that it's
completely messed up. There's no title bar, not Windows icons for
closing, minimizing, etc., no content in the window.

Press CTRL-x CTRL-c to kill XEmacs.

> And furthermore I have no idea what a red square means in xemacs.

They don't mean anything special. When you type, you should see the
characters you're typing. The red squares just indicate something is
very messed up.

> Isn't it possible to have easier testcases than (x)emacs of all things?

I'm sorry, I don't know of an easier test case. If this email isn't
any more helpful, I'll try to extract code from the XEmacs sources
to duplicate the problem, but I think that will take me a very long
time.

I do find that everything is okay without the setsid. I captured an
strace of this sequence with and without using setsid. I've attached
a text file with what I guess are the relevant areas. At least, this
was the only area that had any difference.

The case where setsid was used includes

[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::open: console_count 1, amount 1, no ctty, avoid_freeing_console 0
[main] xemacs fhandler_tty_slave::open: CreateWindowStation 0x64C, Win32 error 0
[main] xemacs fhandler_tty_slave::open: SetProcessWindowStation 1, Win32 error 0
[main] xemacs fhandler_tty_slave::open: 1 = AllocConsole (), Win32 error 0
[main] xemacs fhandler_tty_slave::open: /dev/tty1 opened, usecount 1

and later

[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::close: console_count 0, amount -1, no ctty, avoid_freeing_console 0
[main] xemacs init_cygheap::manage_console_count: freed console

When setsid is not used, a new Window Station is not created and the
subsequent fhandler_tty_slave::close does not free the console.

This isn't really a major issue for me anymore since I've discovered
I can start XEmacs using the run command get the same effect as
setsid. The grep command works fine when I start it this way:

c:\cygwin\bin\run c:\cygwin\bin\bash -lc 'xemacs'

-- 
David Rothenberger                spammer? -> spam@daveroth.dyndns.org
GPG/PGP: 0x92D68FD8, DB7C 5146 1AB0 483A 9D27 DFBA FBB9 E328 92D6 8FD8
-------------- next part --------------
SETSID
----------------------------------------------------------------------
[main] xemacs build_fh_pc: fh 0x6115E25C
[main] xemacs tty_list::allocate_tty: tty1 allocated
[main] xemacs tty::make_pipes: tty1 from_slave 0x660, to_slave 0x688
[main] xemacs transport_layer_pipes::connect: Error opening the pipe (2)
[main] xemacs tty::get_event: created event Global\cygwin1S4.cygtty.input.avail.1
[main] xemacs tty::common_init: tty1 opened
[main] xemacs tty::create_inuse: Global\cygwin1S4.cygtty.master_alive.1 0x690
[main] xemacs fhandler_base::set_flags: flags 0x18002, supplied_bin 0x0
[main] xemacs fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
[main] xemacs fhandler_base::set_flags: filemode set to binary
[main] xemacs fhandler_pty_master::open: opened pty master tty1
[main] xemacs open: 6 = open (/dev/ptmx, 0x8002)
[main] xemacs __set_errno: int revoke(char*):45 val 88
[main] xemacs open: open (/dev/tty1, 0x8002)
[main] xemacs normalize_posix_path: src /dev/tty1
[main] xemacs normalize_posix_path: /dev/tty1 = normalize_posix_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: conv_to_win32_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: src_path /dev/tty1, dst \dev\tty1, flags 0x2, rc 0
[main] xemacs build_fh_pc: fh 0x6115E464
[main] xemacs fhandler_base::set_flags: flags 0x18002, supplied_bin 0x0
[main] xemacs fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
[main] xemacs fhandler_base::set_flags: filemode set to binary
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: waiting 500 ms
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: acquired
[main] xemacs tty::create_inuse: Global\cygwin1S4.cygtty.slave_alive.1 0x65C
[main] xemacs fhandler_tty_slave::open: (511): tty output_mutex released
[main] xemacs fhandler_tty_slave::open: cannot dup handles via server. using old method.
[main] xemacs fhandler_tty_slave::open: tty own handle 0x64C
[main] xemacs fhandler_tty_slave::open: duplicated from_master 0x698->0x648 from tty_owner
[main] xemacs fhandler_tty_slave::open: duplicated to_master 0x670->0x644 from tty_owner
[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::open: console_count 1, amount 1, no ctty, avoid_freeing_console 0
[main] xemacs fhandler_tty_slave::open: CreateWindowStation 0x64C, Win32 error 0
[main] xemacs fhandler_tty_slave::open: SetProcessWindowStation 1, Win32 error 0
[main] xemacs fhandler_tty_slave::open: 1 = AllocConsole (), Win32 error 0
[main] xemacs fhandler_tty_slave::open: /dev/tty1 opened, usecount 1
[main] xemacs _pinfo::set_ctty: old no ctty
[main] xemacs open: 7 = open (/dev/tty1, 0x8002)
[main] xemacs set_signal_mask: oldmask 0x80000, newmask 0x0, mask_bits 0x80000
[main] xemacs ttyname_r: returning 0 tty: /dev/tty1
[main] xemacs close: close (7)
[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::close: console_count 0, amount -1, no ctty, avoid_freeing_console 0
[main] xemacs init_cygheap::manage_console_count: freed console
[main] xemacs fhandler_tty_slave::close: /dev/tty1 closed, usecount 0
[main] xemacs fhandler_tty_slave::close: closing last open /dev/tty1 handle
[main] xemacs fhandler_tty_common::close: tty1 <0x648,0x644> closing
[main] xemacs dtable::delete_archetype: deleting element 0 for /dev/tty1
[main] xemacs close: 0 = close (7)
[main] xemacs ioctl: fd 6, cmd 6
[main] xemacs ioctl: returning 0
[main] xemacs set_signal_mask: oldmask 0x0, newmask 0x80000, mask_bits 0x0
[main] xemacs set_signal_mask: not calling sig_dispatch_pending
[main] xemacs set_signal_mask: oldmask 0x80000, newmask 0x0, mask_bits 0x80000
[main] xemacs open: open (/dev/tty1, 0x18002)
[main] xemacs normalize_posix_path: src /dev/tty1
[main] xemacs normalize_posix_path: /dev/tty1 = normalize_posix_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: conv_to_win32_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: src_path /dev/tty1, dst \dev\tty1, flags 0x2, rc 0
[main] xemacs build_fh_pc: fh 0x6115E66C
[main] xemacs fhandler_base::set_flags: flags 0x18002, supplied_bin 0x0
[main] xemacs fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
[main] xemacs fhandler_base::set_flags: filemode set to binary
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: waiting 500 ms
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: acquired
[main] xemacs tty::create_inuse: Global\cygwin1S4.cygtty.slave_alive.1 0x684
[main] xemacs fhandler_tty_slave::open: (511): tty output_mutex released
[main] xemacs fhandler_tty_slave::open: cannot dup handles via server. using old method.
[main] xemacs fhandler_tty_slave::open: tty own handle 0x678
[main] xemacs fhandler_tty_slave::open: duplicated from_master 0x698->0x65C from tty_owner
[main] xemacs fhandler_tty_slave::open: duplicated to_master 0x670->0x63C from tty_owner
[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::open: console_count 1, amount 1, no ctty, avoid_freeing_console 0
[main] xemacs fhandler_tty_slave::open: CreateWindowStation 0x678, Win32 error 0
[main] xemacs fhandler_tty_slave::open: SetProcessWindowStation 1, Win32 error 0
[main] xemacs fhandler_tty_slave::open: 1 = AllocConsole (), Win32 error 0
[main] xemacs fhandler_tty_slave::open: /dev/tty1 opened, usecount 1
[main] xemacs _pinfo::set_ctty: old no ctty

NO SETSID
----------------------------------------------------------------------
[main] xemacs build_fh_pc: fh 0x6115D5FC
[main] xemacs tty_list::allocate_tty: tty1 allocated
[main] xemacs tty::make_pipes: tty1 from_slave 0x668, to_slave 0x690
[main] xemacs transport_layer_pipes::connect: Error opening the pipe (2)
[main] xemacs tty::get_event: created event Global\cygwin1S4.cygtty.input.avail.1
[main] xemacs tty::common_init: tty1 opened
[main] xemacs tty::create_inuse: Global\cygwin1S4.cygtty.master_alive.1 0x698
[main] xemacs fhandler_base::set_flags: flags 0x18002, supplied_bin 0x0
[main] xemacs fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
[main] xemacs fhandler_base::set_flags: filemode set to binary
[main] xemacs fhandler_pty_master::open: opened pty master tty1
[main] xemacs open: 6 = open (/dev/ptmx, 0x8002)
[main] xemacs __set_errno: int revoke(char*):45 val 88
[main] xemacs open: open (/dev/tty1, 0x8002)
[main] xemacs normalize_posix_path: src /dev/tty1
[main] xemacs normalize_posix_path: /dev/tty1 = normalize_posix_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: conv_to_win32_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: src_path /dev/tty1, dst \dev\tty1, flags 0x2, rc 0
[main] xemacs build_fh_pc: fh 0x6115D804
[main] xemacs fhandler_base::set_flags: flags 0x18002, supplied_bin 0x0
[main] xemacs fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
[main] xemacs fhandler_base::set_flags: filemode set to binary
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: waiting 500 ms
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: acquired
[main] xemacs tty::create_inuse: Global\cygwin1S4.cygtty.slave_alive.1 0x664
[main] xemacs fhandler_tty_slave::open: (511): tty output_mutex released
[main] xemacs fhandler_tty_slave::open: cannot dup handles via server. using old method.
[main] xemacs fhandler_tty_slave::open: tty own handle 0x654
[main] xemacs fhandler_tty_slave::open: duplicated from_master 0x6A0->0x650 from tty_owner
[main] xemacs fhandler_tty_slave::open: duplicated to_master 0x678->0x64C from tty_owner
[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::open: console_count 4, amount 1, ctty /dev/console, avoid_freeing_console 0
[main] xemacs fhandler_tty_slave::open: /dev/tty1 opened, usecount 1
[main] xemacs _pinfo::set_ctty: old ctty /dev/console
[main] xemacs open: 7 = open (/dev/tty1, 0x8002)
[main] xemacs set_signal_mask: oldmask 0x80000, newmask 0x0, mask_bits 0x80000
[main] xemacs ttyname_r: returning 0 tty: /dev/tty1
[main] xemacs close: close (7)
[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::close: console_count 3, amount -1, ctty /dev/console, avoid_freeing_console 0
[main] xemacs fhandler_tty_slave::close: /dev/tty1 closed, usecount 0
[main] xemacs fhandler_tty_slave::close: closing last open /dev/tty1 handle
[main] xemacs fhandler_tty_common::close: tty1 <0x650,0x64C> closing
[main] xemacs dtable::delete_archetype: deleting element 0 for /dev/tty1
[main] xemacs close: 0 = close (7)
[main] xemacs ioctl: fd 6, cmd 6
[main] xemacs ioctl: returning 0
[main] xemacs set_signal_mask: oldmask 0x0, newmask 0x80000, mask_bits 0x0
[main] xemacs set_signal_mask: not calling sig_dispatch_pending
[main] xemacs set_signal_mask: oldmask 0x80000, newmask 0x0, mask_bits 0x80000
[main] xemacs open: open (/dev/tty1, 0x18002)
[main] xemacs normalize_posix_path: src /dev/tty1
[main] xemacs normalize_posix_path: /dev/tty1 = normalize_posix_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: conv_to_win32_path (/dev/tty1)
[main] xemacs mount_info::conv_to_win32_path: src_path /dev/tty1, dst \dev\tty1, flags 0x2, rc 0
[main] xemacs build_fh_pc: fh 0x6115DA0C
[main] xemacs fhandler_base::set_flags: flags 0x18002, supplied_bin 0x0
[main] xemacs fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
[main] xemacs fhandler_base::set_flags: filemode set to binary
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: waiting 500 ms
[main] xemacs fhandler_tty_slave::open: (508): tty output_mutex: acquired
[main] xemacs tty::create_inuse: Global\cygwin1S4.cygtty.slave_alive.1 0x68C
[main] xemacs fhandler_tty_slave::open: (511): tty output_mutex released
[main] xemacs fhandler_tty_slave::open: cannot dup handles via server. using old method.
[main] xemacs fhandler_tty_slave::open: tty own handle 0x680
[main] xemacs fhandler_tty_slave::open: duplicated from_master 0x6A0->0x664 from tty_owner
[main] xemacs fhandler_tty_slave::open: duplicated to_master 0x678->0x654 from tty_owner
[main] xemacs init_cygheap::manage_console_count: fhandler_tty_slave::open: console_count 4, amount 1, ctty /dev/console, avoid_freeing_console 0
[main] xemacs fhandler_tty_slave::open: /dev/tty1 opened, usecount 1
[main] xemacs _pinfo::set_ctty: old ctty /dev/console

-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list