This is the mail archive of the cygwin 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: emacs-x11: new clipboard size limitation?


On 03/12/2013 11:28, Corinna Vinschen wrote:
> On Dec  3 11:31, Corinna Vinschen wrote:
>> On Dec  2 14:56, Jon TURNEY wrote:
>>> On 02/12/2013 14:17, Corinna Vinschen wrote:
>>>> On Dec  2 13:11, Jon TURNEY wrote:
>>>>> What you write does seem to support the theory that this is a regression in
>>>>> select() in the cygwin DLL.  It might be useful if you could say what version
>>>>> of the cygwin DLL you had when it was working correctly before you upgraded.
>>>>>
>>>>> [1] http://cygwin.com/ml/cygwin-xfree/2013-10/msg00031.html
>>>>> [2] http://cygwin.com/ml/cygwin-xfree/2013-11/msg00012.html
>>>>
>>>> Are you sure this is a select problem?  If so, can you create an STC,
>>>> perhaps?
>>>
>>> "Only a madman is absolutely sure".  I'm afraid the best test case I have a
>>> the moment is:
>>>
>>> Install xorg-server-debuginfo
>>> Start XWin -noclipboard -multiwindow
>>> Start xwinclip under gdb, and place a breakpoint at wndproc.c:133, and run it
>>> Start emacs-x11, open the Shakespeare text from [1] in a buffer
>>> Open notepad
>>> Copy and paste the text from the emacs buffer into notepad
>>> The breakpoint is hit.  Notice that select() has returned 0, the read ready
>>> fd_set is empty and the timeout hasn't expired. I claim that the read ready
>>> fd_set should indicate that the X connection socket is ready.
>>
>> Well, that's not exactly an STC...
>>
>> So, IIUC, you're saying that, in fact, select doesn't return too early,
>> rather it returns without setting the return value correctly.  You
>> expect it to return a value > 0, right?

Yes, I'm expecting it to return 1 with a bit set in the fd_set.

I'm not sure what it means to return before the timeout expires with value 0.

> I don't see any bigger changes in select since Cygwin 1.7.19.  Only one
> change since then, and that's only in 1.7.26, not in 1.7.25 as the OP
> claimed using.  The change in 1.7.19 is only 64 bit related, changing an
> unsigned to a size_t cast and a few debug printfs.  Only in 1.7.18 is a
> little bit bigger change but it should only affect signal handling.

Okay, so I did what I should have done in the first place and tried bisecting
through cygwin DLL versions for the past 6 months and they all behave the same
way.

Tried bisecting through the X server versions for the past 6 months, and it
seems that this problem first appears in X server 1.14.3-2

(As an aside, it's probably relevant to the recent discussion, that I can't
find the thread for, about how many previous versions we should keep around
that it's not possible to do this bisection without 'Secret Knowledge' at the
moment)

This does contain a few clipboard changes, and in particular it changes the
way the messages get processed so we will return to the select() more often
(after each stage of the conversion operation), which it looks like it could
be incorrect sometimes, but I'd expect this to cause unneeded blocking
(waiting in select() for a message which has already been placed on the event
queue by XPending() rather than the observed behaviour.

Anyhow, I guess I need to look at this some more...

> Talking about wndproc.c, it only checks iReturn for being < 0.  After
> that, we don't really know which value it has, we only know that
> FD_ISSET(iConnNumber, &fdsRead) returns 0.  The value of iReturn should
> be printed in the debug output at line 133.

It's 0 when I inspect it with the debugger, but yes, I'll change that.

> What kind of object is the iConnNumber descriptor?  Pipe?  Fifo?
> Socket?  /dev/windows?  We really need a simple testcase without the 
> X and emacs overhead...

It's a socket connected to the X server.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

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


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