Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-12 Thread Tatsuro MATSUOKA





- Original Message -
> From: Mark Geisert
> To: cygwin
> Date: 2019/3/12, Tue 13:20
> Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
> 
>T atsuro MATSUOKA wrote:
>>  - Original Message -
>> 
>>>  From: Mark Geisert
>>>  To: cygwin
>>>  Cc:
>>>  Date: 2019/3/11, Mon 16:21
>>>  Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
>>> 
>>>  T atsuro MATSUOKA wrote:
>>>>   - Original Message -
>>>> 
>>>>>   From: Yaakov Selkowitz >>>>   To: cygwin
>>>>>   Cc:
>>>>>   Date: 2019/3/11, Mon 09:53
>>>>>   Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 
> 5.9.4)
>>>>> 
>>>>>   On Mon, 2019-03-11 at 09:28 +0900, Tatsuro MATSUOKA wrote:
>>>>>>    > On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA 
> wrote:
>>>>>>    > >  I ask alpply a patch the below which enables 
> to use qt
>>>  terminal
>>>>>   on gnuplot
>>>>>>    > for Cygwin.
>>>>>>    > >  (cygQt5Network-5.dll is affected.)
>>>>>>    > >
>>>>>>    > >  ---
>>>>>   
> a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>>>>>    > >  +++
>>>>>   
> b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>>>>>    > >  @@ -239,7 +239,7 @@ void
>>>  QLocalSocket::connectToServer(OpenM
>>>>>>    > >      }
>>>>>>    > >      // create the socket
>>>>>>    > >  -    if (-1 == (d->connectingSocket =
>>>  qt_safe_socket(PF_UNIX,
>>>>>   SOCK_STREAM, 0, O_NONBLOCK))) {
>>>>>>    > >  +    if (-1 == (d->connectingSocket =
>>>  qt_safe_socket(PF_UNIX,
>>>>>   SOCK_STREAM, 0))) {
>>>>>>    > >
>>>  d->errorOccurred(UnsupportedSocketOperationError,
>>>>>   QLatin1String("QLocalSocket::connectToServer"));
>>>>>>    > >          return;
>>>>>>    > >
>>>>>>    >
>>>>>>    > It seems we keep going in circles on this point.  If 
> there is
>>>  a bug in
>>>>>>    > O_NONBLOCK, then please either narrow it down to an 
> STC, or
>>>  provide a
>>>>>>    > patch to Cygwin.
>>>>>> 
>>>>>>    Very basic question. What is STC?
>>>>>>    I googled but I cannot find what is it.
>>>>> 
>>>>>   https://cygwin.com/acronyms/#STC 
>>>> 
>>>> 
>>>>   Sorry I cannot make STC due to lack of knowledge of QT.
>>>>   In stead, I explain what gnuplot do.
>>>> 
>>>>   On gnuplot for qt,
>>>>   plot is done by child process named gnuplot_qt.
>>>> 
>>>>   When gnuplot connect with gnuplot with
>>>>     qt->socket.connectToServer(server);
>>>> 
>>>> 
>>>>   without the above patch ()
>>>>   qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK)))
>>>>   gnuplot cannot connect with gnuplot_qt.
>>>> 
>>>>   with the above patch ()
>>>>   qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))
>>>>   gnuplot can connect with gnuplot_qt.
>>>> 
>>>>   Perhaps qt with O_NONBLOCK is some wrong with process connection.
>>> 
>>>  Hi Tatsuro,
>>>  For the record, what Enrico supplied is what we'd call an STC, a 
> Simple Test
>>> 
>>>  Case.  Unfortunately his STC dealt with select() on a named pipe.
>>> 
>>>  Your gnuplot issue has to do with "Unix sockets", a form of 
> IPC
>>>  between
>>>  processes.  Cygwin uses Windows named pipes to implement "Unix
>>>  sockets" on
>>>  Windows.  This means we are mapping Unix/Linux socket constructs onto a
>>>  dissimilar feature of Windows, and there are many opportunities for 
> mismatch.
>>> 
>>>  Can you run your gnuplot under strace?  You would set up your 
> environment as
>>>  needed to reproduce the issue, then launch gnuplot as so:
>>>       strace -o gnuplot.trace gnuplot
>>>  This will create a trace file of Cygwin syscalls and operations.  Let 
> us know
>>>  how big (how many lines) are in the trace file and we'll see 
> what's
>>>  next.
>>> 
>>>  ..mark
>>> 
>> 
>>  I send xz commpress gnuplot.trace.
> 
> Next time we'll arrange private email for large things.  I'm now poring 
> over the 
> strace; thanks for sending it.
> 
> If it's not too much trouble, could you show what you tell gnuplot and how 
> you 
> set up the Qt environment?  Are you running gnuplot from inside qterminal?
> 
> ..mark
For qt graphics
gnuplot.exe uses driver process named gnuplot_qt.exe.

gnuplot.exe tries connect with gnuplot_qt.exe
by


qt->socket.connectToServer(server); 


in gnuplot.exe code but fails to connect with gnuplot_qt.exe.

 Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-11 Thread Mark Geisert

Tatsuro MATSUOKA wrote:

- Original Message -


From: Mark Geisert
To: cygwin
Cc:
Date: 2019/3/11, Mon 16:21
Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

T atsuro MATSUOKA wrote:

 - Original Message -


 From: Yaakov Selkowitz 
  > On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
  > >  I ask alpply a patch the below which enables to use qt

terminal

 on gnuplot

  > for Cygwin.
  > >  (cygQt5Network-5.dll is affected.)
  > >
  > >  ---

 a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp

  > >  +++

 b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp

  > >  @@ -239,7 +239,7 @@ void

QLocalSocket::connectToServer(OpenM

  > >  }
  > >  // create the socket
  > >  -if (-1 == (d->connectingSocket =

qt_safe_socket(PF_UNIX,

 SOCK_STREAM, 0, O_NONBLOCK))) {

  > >  +if (-1 == (d->connectingSocket =

qt_safe_socket(PF_UNIX,

 SOCK_STREAM, 0))) {

  > >

d->errorOccurred(UnsupportedSocketOperationError,

 QLatin1String("QLocalSocket::connectToServer"));

  > >  return;
  > >
  >
  > It seems we keep going in circles on this point.  If there is

a bug in

  > O_NONBLOCK, then please either narrow it down to an STC, or

provide a

  > patch to Cygwin.

  Very basic question. What is STC?
  I googled but I cannot find what is it.


 https://cygwin.com/acronyms/#STC



 Sorry I cannot make STC due to lack of knowledge of QT.
 In stead, I explain what gnuplot do.

 On gnuplot for qt,
 plot is done by child process named gnuplot_qt.

 When gnuplot connect with gnuplot with
   qt->socket.connectToServer(server);


 without the above patch ()
 qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK)))
 gnuplot cannot connect with gnuplot_qt.

 with the above patch ()
 qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))
 gnuplot can connect with gnuplot_qt.

 Perhaps qt with O_NONBLOCK is some wrong with process connection.


Hi Tatsuro,
For the record, what Enrico supplied is what we'd call an STC, a Simple Test

Case.  Unfortunately his STC dealt with select() on a named pipe.

Your gnuplot issue has to do with "Unix sockets", a form of IPC
between
processes.  Cygwin uses Windows named pipes to implement "Unix
sockets" on
Windows.  This means we are mapping Unix/Linux socket constructs onto a
dissimilar feature of Windows, and there are many opportunities for mismatch.

Can you run your gnuplot under strace?  You would set up your environment as
needed to reproduce the issue, then launch gnuplot as so:
 strace -o gnuplot.trace gnuplot
This will create a trace file of Cygwin syscalls and operations.  Let us know
how big (how many lines) are in the trace file and we'll see what's
next.

..mark



I send xz commpress gnuplot.trace.


Next time we'll arrange private email for large things.  I'm now poring over the 
strace; thanks for sending it.


If it's not too much trouble, could you show what you tell gnuplot and how you 
set up the Qt environment?  Are you running gnuplot from inside qterminal?


..mark


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-11 Thread Mark Geisert

Corinna Vinschen wrote:

On Mar 11 00:21, Mark Geisert wrote:

Tatsuro MATSUOKA wrote:

[...]
without the above patch ()
qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK)))
gnuplot cannot connect with gnuplot_qt.

with the above patch ()
qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))
gnuplot can connect with gnuplot_qt.

Perhaps qt with O_NONBLOCK is some wrong with process connection.


Hi Tatsuro,
For the record, what Enrico supplied is what we'd call an STC, a Simple Test
Case.  Unfortunately his STC dealt with select() on a named pipe.

Your gnuplot issue has to do with "Unix sockets", a form of IPC between
processes.  Cygwin uses Windows named pipes to implement "Unix sockets" on
Windows.


No, wait!  While there is code in Cygwin which is supposed to use
Windows named pipes to implement AF_UNIX sockets at one point, thos
code is far from being complete.

As yet, Cygwin uses loopback IPv4 sockets to implement AF_UNIX sockets.


Thank you Corinna for the correction.  That should make the strace output more 
understandable :-).


..mark


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-11 Thread Corinna Vinschen
On Mar 11 00:21, Mark Geisert wrote:
> Tatsuro MATSUOKA wrote:
> > [...]
> > without the above patch ()
> > qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK)))
> > gnuplot cannot connect with gnuplot_qt.
> > 
> > with the above patch ()
> > qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))
> > gnuplot can connect with gnuplot_qt.
> > 
> > Perhaps qt with O_NONBLOCK is some wrong with process connection.
> 
> Hi Tatsuro,
> For the record, what Enrico supplied is what we'd call an STC, a Simple Test
> Case.  Unfortunately his STC dealt with select() on a named pipe.
> 
> Your gnuplot issue has to do with "Unix sockets", a form of IPC between
> processes.  Cygwin uses Windows named pipes to implement "Unix sockets" on
> Windows.

No, wait!  While there is code in Cygwin which is supposed to use
Windows named pipes to implement AF_UNIX sockets at one point, thos
code is far from being complete.

As yet, Cygwin uses loopback IPv4 sockets to implement AF_UNIX sockets.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-11 Thread Mark Geisert

Tatsuro MATSUOKA wrote:

- Original Message -


From: Yaakov Selkowitz 
 > On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
 > >  I ask alpply a patch the below which enables to use qt terminal

on gnuplot

 > for Cygwin.
 > >  (cygQt5Network-5.dll is affected.)
 > >
 > >  ---

a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp

 > >  +++

b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp

 > >  @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
 > >  }
 > >  // create the socket
 > >  -if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX,

SOCK_STREAM, 0, O_NONBLOCK))) {

 > >  +if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX,

SOCK_STREAM, 0))) {

 > >  d->errorOccurred(UnsupportedSocketOperationError,

QLatin1String("QLocalSocket::connectToServer"));

 > >  return;
 > >
 >
 > It seems we keep going in circles on this point.  If there is a bug in
 > O_NONBLOCK, then please either narrow it down to an STC, or provide a
 > patch to Cygwin.

 Very basic question. What is STC?
 I googled but I cannot find what is it.


https://cygwin.com/acronyms/#STC



Sorry I cannot make STC due to lack of knowledge of QT.
In stead, I explain what gnuplot do.

On gnuplot for qt,
plot is done by child process named gnuplot_qt.

When gnuplot connect with gnuplot with
  qt->socket.connectToServer(server);


without the above patch ()
qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK)))
gnuplot cannot connect with gnuplot_qt.

with the above patch ()
qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))
gnuplot can connect with gnuplot_qt.

Perhaps qt with O_NONBLOCK is some wrong with process connection.


Hi Tatsuro,
For the record, what Enrico supplied is what we'd call an STC, a Simple Test 
Case.  Unfortunately his STC dealt with select() on a named pipe.


Your gnuplot issue has to do with "Unix sockets", a form of IPC between 
processes.  Cygwin uses Windows named pipes to implement "Unix sockets" on 
Windows.  This means we are mapping Unix/Linux socket constructs onto a 
dissimilar feature of Windows, and there are many opportunities for mismatch.


Can you run your gnuplot under strace?  You would set up your environment as 
needed to reproduce the issue, then launch gnuplot as so:

strace -o gnuplot.trace gnuplot
This will create a trace file of Cygwin syscalls and operations.  Let us know 
how big (how many lines) are in the trace file and we'll see what's next.


..mark


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-10 Thread Tatsuro MATSUOKA
- Original Message -

> From: Yaakov Selkowitz  To: cygwin
> Cc: 
> Date: 2019/3/11, Mon 09:53
> Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
> 
> On Mon, 2019-03-11 at 09:28 +0900, Tatsuro MATSUOKA wrote:
>>  > On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
>>  > >  I ask alpply a patch the below which enables to use qt terminal 
> on gnuplot 
>>  > for Cygwin.
>>  > >  (cygQt5Network-5.dll is affected.)
>>  > > 
>>  > >  --- 
> a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>  > >  +++ 
> b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>  > >  @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
>>  > >      }
>>  > >      // create the socket
>>  > >  -    if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> SOCK_STREAM, 0, O_NONBLOCK))) {
>>  > >  +    if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> SOCK_STREAM, 0))) {
>>  > >          d->errorOccurred(UnsupportedSocketOperationError, 
> QLatin1String("QLocalSocket::connectToServer"));
>>  > >          return;
>>  > > 
>>  > 
>>  > It seems we keep going in circles on this point.  If there is a bug in
>>  > O_NONBLOCK, then please either narrow it down to an STC, or provide a
>>  > patch to Cygwin.
>> 
>>  Very basic question. What is STC?
>>  I googled but I cannot find what is it.
> 
> https://cygwin.com/acronyms/#STC 


Sorry I cannot make STC due to lack of knowledge of QT.
In stead, I explain what gnuplot do.

On gnuplot for qt, 
plot is done by child process named gnuplot_qt. 

When gnuplot connect with gnuplot with 
  qt->socket.connectToServer(server);


without the above patch ()
qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK)))
gnuplot cannot connect with gnuplot_qt.

with the above patch ()
qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))
gnuplot can connect with gnuplot_qt.

Perhaps qt with O_NONBLOCK is some wrong with process connection.



Tatsuro 


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-10 Thread Yaakov Selkowitz
On Mon, 2019-03-11 at 09:28 +0900, Tatsuro MATSUOKA wrote:
> > On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
> > >  I ask alpply a patch the below which enables to use qt terminal on 
> > > gnuplot 
> > for Cygwin.
> > >  (cygQt5Network-5.dll is affected.)
> > > 
> > >  --- 
> > > a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
> > >  +++ 
> > > b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
> > >  @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
> > >  }
> > >  // create the socket
> > >  -if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> > > SOCK_STREAM, 0, O_NONBLOCK))) {
> > >  +if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> > > SOCK_STREAM, 0))) {
> > >  d->errorOccurred(UnsupportedSocketOperationError, 
> > > QLatin1String("QLocalSocket::connectToServer"));
> > >  return;
> > > 
> > 
> > It seems we keep going in circles on this point.  If there is a bug in
> > O_NONBLOCK, then please either narrow it down to an STC, or provide a
> > patch to Cygwin.
> 
> Very basic question. What is STC?
> I googled but I cannot find what is it.

https://cygwin.com/acronyms/#STC

--
Yaakov



--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-10 Thread Andrey Repin
Greetings, Tatsuro MATSUOKA!

> Very basic question. What is STC?
> I googled but I cannot find what is it.

https://cygwin.com/acronyms/#STC


-- 
With best regards,
Andrey Repin
Monday, March 11, 2019 3:38:42

Sorry for my terrible english...


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-10 Thread Tatsuro MATSUOKA
- Original Message -

> From: Yaakov Selkowitz 
> To: cygwin@cygwin.com
> Cc: 
> Date: 2019/3/5, Tue 01:32
> Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
> 
> On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
>>  Dear Yaakov Selkowitz
>> 
>>  I ask alpply a patch the below which enables to use qt terminal on gnuplot 
> for Cygwin.
>>  (cygQt5Network-5.dll is affected.)
>> 
>>  --- a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>  +++ b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>  @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
>>      }
>>      // create the socket
>>  -    if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> SOCK_STREAM, 0, O_NONBLOCK))) {
>>  +    if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> SOCK_STREAM, 0))) {
>>          d->errorOccurred(UnsupportedSocketOperationError,
>>                         
> QLatin1String("QLocalSocket::connectToServer"));
>>          return;
>> 
> 
> It seems we keep going in circles on this point.  If there is a bug in
> O_NONBLOCK, then please either narrow it down to an STC, or provide a
> patch to Cygwin.



Very basic question. What is STC?
I googled but I cannot find what is it.

Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-05 Thread Tatsuro MATSUOKA
> I have updated the cygiwn by setup because cygwin is updated to 3.0.1-1.

NOT 3.0.1-1 but 3.0.2-1 .

Tatsuro




> 
> The above code works with or without O_NONBLOCK.
> 
> On cygwin 3.0.0, with O_NONBLOCK, the code does not work.
> 
> Thus situation is changing.
> 
> But connection of gnuplot to qnuplot_qt still fails.
> 
> There seem to be Qt for Cygwin specific issue.
> 
> I cannot narrow down the issue at this moment.
> 
> 
> I have to use Qt with debug symbols and gnuplot build with -g option and 
> trace 
> the behaviors.
> 
> It take time and now I do not have enough time.
> 
> Please wait while.


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-05 Thread Tatsuro MATSUOKA
- Original Message -

> From: Tatsuro MATSUOKA 
> To: Achim Gratz; cygwin
> Cc: 
> Date: 2019/3/6, Wed 10:10
> Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
> 
>>>   From: Achim Gratz
> 
>>>   To: cygwin
>>>   Cc: 
>>>   Date: 2019/3/6, Wed 04:24
>>>   Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
>>> 
>>>  T atsuro MATSUOKA writes:
>>>>    I contacted with Enrico who tells me the patch that I have shown.
>>> 
>>>   Yes, but that monkeys around the real problem.  What Yaakov is telling
>>>   you is that there are two options and we don't know yet which one 
> we
>>>   have to deal with.
>>> 
>>>   If O_NONBLOCK is needed, but does not work correctly under Cygwin, 
> then
>>>   that's a bug in Cygwin.  For this case, Corinna asks you to create 
> an
>>>   STC that demonstrates the bug so it can be triaged without having to
>>>   work with something as complex as the Qt terminal in Cygwin.
>>> 
>>>   If on the other hand O_NONBLOCK is in fact not needed and just shows
>>>   different behaviour on different systems without a bug in the
>>>   implementation being present, then upstream should remove that 
> argument.
>>> 
>>> 
>>>   Regards,
>>>   Achim.
>> 
>>  Seeing ML archive that Enrico indicated,
>> 
>>  Re: select() and named pipes
>> 
>>  #include 
>>  #include 
>>  #include 
>>  #include 
>>  #include 
>>  #include 
>>  #include 
>>  #include 
>> 
>>  #define FIFONAME "/tmp/pipe"
>> 
>>  int main(void)
>>  {
>>      int fd;
>>      int nsel;
>>      fd_set readfds;
>>      FD_ZERO();
>> 
>>      if (mkfifo(FIFONAME, 0600) < 0) {
>>      perror("mkfifo");
>>      exit(1);
>>      }
>> 
>>      fd = open(FIFONAME, O_RDONLY | O_NONBLOCK);
>> 
>>      if (fd < 0) {
>>      perror("open");
>>      remove(FIFONAME);
>>      exit(2);
>>      }
>> 
>>      FD_SET(fd, );
>>      do {
>>      nsel = select(fd + 1, , 0, 0, 0);
>>      } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));
>> 
>>      if (nsel == -1) {
>>      perror("select");
>>      exit(3);
>>      }
>> 
>>      if (FD_ISSET(fd, )) {
>>      char buf[100];
>>      int status;
>>      int count = 0;
>>      printf("%d: ", ++count);
>>      while ((status = read(fd, buf, sizeof(buf) - 1))) {
>>      if (status > 0) {
>>      buf[status] = '\0';
>>      printf("%s", buf);
>>      } else if (errno == EAGAIN) {
>>      printf("\n%d: ", ++count);
>>      } else {
>>      perror("read");
>>      break;
>>      }
>>      }
>>      }
>> 
>>      close(fd);
>>      remove(FIFONAME);
>>      return 0;
>>  }
>> 
>> 
>> 
>>  As you wrote this is a issue of Cygwin issue.
>>  But As long as O_NONBLOCK does not work on Cygwin, Enrico's workaround 
> can 
>>  be attached for qt.
> 
> Apart from Qt maintainer accepts Enrico's patch, I will raise O_NONBLOCK 
> issue by another post.


I have updated the cygiwn by setup because cygwin is updated to 3.0.1-1.

The above code works with or without O_NONBLOCK.

On cygwin 3.0.0, with O_NONBLOCK, the code does not work.

Thus situation is changing.

But connection of gnuplot to qnuplot_qt still fails.

There seem to be Qt for Cygwin specific issue.

I cannot narrow down the issue at this moment.


I have to use Qt with debug symbols and gnuplot build with -g option and trace 
the behaviors.

It take time and now I do not have enough time.

Please wait while.

Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-05 Thread Tatsuro MATSUOKA
>>  From: Achim Gratz

>>  To: cygwin
>>  Cc: 
>>  Date: 2019/3/6, Wed 04:24
>>  Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
>> 
>> T atsuro MATSUOKA writes:
>>>   I contacted with Enrico who tells me the patch that I have shown.
>> 
>>  Yes, but that monkeys around the real problem.  What Yaakov is telling
>>  you is that there are two options and we don't know yet which one we
>>  have to deal with.
>> 
>>  If O_NONBLOCK is needed, but does not work correctly under Cygwin, then
>>  that's a bug in Cygwin.  For this case, Corinna asks you to create an
>>  STC that demonstrates the bug so it can be triaged without having to
>>  work with something as complex as the Qt terminal in Cygwin.
>> 
>>  If on the other hand O_NONBLOCK is in fact not needed and just shows
>>  different behaviour on different systems without a bug in the
>>  implementation being present, then upstream should remove that argument.
>> 
>> 
>>  Regards,
>>  Achim.
> 
> Seeing ML archive that Enrico indicated,
> 
> Re: select() and named pipes
> 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> #define FIFONAME "/tmp/pipe"
> 
> int main(void)
> {
>     int fd;
>     int nsel;
>     fd_set readfds;
>     FD_ZERO();
> 
>     if (mkfifo(FIFONAME, 0600) < 0) {
>     perror("mkfifo");
>     exit(1);
>     }
> 
>     fd = open(FIFONAME, O_RDONLY | O_NONBLOCK);
> 
>     if (fd < 0) {
>     perror("open");
>     remove(FIFONAME);
>     exit(2);
>     }
> 
>     FD_SET(fd, );
>     do {
>     nsel = select(fd + 1, , 0, 0, 0);
>     } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));
> 
>     if (nsel == -1) {
>     perror("select");
>     exit(3);
>     }
> 
>     if (FD_ISSET(fd, )) {
>     char buf[100];
>     int status;
>     int count = 0;
>     printf("%d: ", ++count);
>     while ((status = read(fd, buf, sizeof(buf) - 1))) {
>     if (status > 0) {
>     buf[status] = '\0';
>     printf("%s", buf);
>     } else if (errno == EAGAIN) {
>     printf("\n%d: ", ++count);
>     } else {
>     perror("read");
>     break;
>     }
>     }
>     }
> 
>     close(fd);
>     remove(FIFONAME);
>     return 0;
> }
> 
> 
> 
> As you wrote this is a issue of Cygwin issue.
> But As long as O_NONBLOCK does not work on Cygwin, Enrico's workaround can 
> be attached for qt.

Apart from Qt maintainer accepts Enrico's patch, I will raise O_NONBLOCK issue 
by another post.

Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-05 Thread Tatsuro MATSUOKA
- Original Message -

> From: Achim Gratz
> To: cygwin
> Cc: 
> Date: 2019/3/6, Wed 04:24
> Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
> 
>T atsuro MATSUOKA writes:
>>  I contacted with Enrico who tells me the patch that I have shown.
> 
> Yes, but that monkeys around the real problem.  What Yaakov is telling
> you is that there are two options and we don't know yet which one we
> have to deal with.
> 
> If O_NONBLOCK is needed, but does not work correctly under Cygwin, then
> that's a bug in Cygwin.  For this case, Corinna asks you to create an
> STC that demonstrates the bug so it can be triaged without having to
> work with something as complex as the Qt terminal in Cygwin.
> 
> If on the other hand O_NONBLOCK is in fact not needed and just shows
> different behaviour on different systems without a bug in the
> implementation being present, then upstream should remove that argument.
> 
> 
> Regards,
> Achim.

Seeing ML archive that Enrico indicated,

Re: select() and named pipes

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define FIFONAME "/tmp/pipe"

int main(void)
{
    int fd;
    int nsel;
    fd_set readfds;
    FD_ZERO();

    if (mkfifo(FIFONAME, 0600) < 0) {
    perror("mkfifo");
    exit(1);
    }

    fd = open(FIFONAME, O_RDONLY | O_NONBLOCK);

    if (fd < 0) {
    perror("open");
    remove(FIFONAME);
    exit(2);
    }

    FD_SET(fd, );
    do {
    nsel = select(fd + 1, , 0, 0, 0);
    } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));

    if (nsel == -1) {
    perror("select");
    exit(3);
    }

    if (FD_ISSET(fd, )) {
    char buf[100];
    int status;
    int count = 0;
    printf("%d: ", ++count);
    while ((status = read(fd, buf, sizeof(buf) - 1))) {
    if (status > 0) {
    buf[status] = '\0';
    printf("%s", buf);
    } else if (errno == EAGAIN) {
    printf("\n%d: ", ++count);
    } else {
    perror("read");
    break;
    }
    }
    }

    close(fd);
    remove(FIFONAME);
    return 0;
}



As you wrote this is a issue of Cygwin issue.
But As long as O_NONBLOCK does not work on Cygwin, Enrico's workaround can be 
attached for qt.

Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-05 Thread Tatsuro MATSUOKA
> From: Achim Gratz

> To: cygwin
> Cc: 
> Date: 2019/3/6, Wed 04:24
> Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
> 
>T atsuro MATSUOKA writes:
>>  I contacted with Enrico who tells me the patch that I have shown.
> 
> Yes, but that monkeys around the real problem.  What Yaakov is telling
> you is that there are two options and we don't know yet which one we
> have to deal with.
> 
> If O_NONBLOCK is needed, but does not work correctly under Cygwin, then
> that's a bug in Cygwin.  For this case, Corinna asks you to create an
> STC that demonstrates the bug so it can be triaged without having to
> work with something as complex as the Qt terminal in Cygwin.
> 
> If on the other hand O_NONBLOCK is in fact not needed and just shows
> different behaviour on different systems without a bug in the
> implementation being present, then upstream should remove that argument.
> 
> 
> Regards,
> Achim.

Here I desribe another discussion on Bug tracker on gnuplot
https://sourceforge.net/p/gnuplot/bugs/2147/



My summary from searching through the history shown in the links above:
* gnuplot calls QLocalSocket::connectToServer("name")
* Qt tries to open a named pipe for the socket using O_NONBLOCK
* This fails because Cygwin has problems with non-blocking named 
pipes. Back in 2010 Enrico Forestieri posted some simple examples of 
this (standalone tests, no involvement of gnuplot code) but this 
apparently did not lead to a fix. 
* the Qt patch at the head of this bug report would make gnuplot work, 
but needs to be wrapped in a conditional test for CYGWIN. I can 
understand why upstream Qt would not want to deal with this. 
Conclusion:  We probably can't fix it in the gnuplot code.  There is a trivial 
work-around that requires modifying the Qt source code, but 
this would only make sense for the purpose of making a Qt package 
specifically for Cygwin. 

Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-05 Thread Achim Gratz
Tatsuro MATSUOKA writes:
> I contacted with Enrico who tells me the patch that I have shown.

Yes, but that monkeys around the real problem.  What Yaakov is telling
you is that there are two options and we don't know yet which one we
have to deal with.

If O_NONBLOCK is needed, but does not work correctly under Cygwin, then
that's a bug in Cygwin.  For this case, Corinna asks you to create an
STC that demonstrates the bug so it can be triaged without having to
work with something as complex as the Qt terminal in Cygwin.

If on the other hand O_NONBLOCK is in fact not needed and just shows
different behaviour on different systems without a bug in the
implementation being present, then upstream should remove that argument.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves

--
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



Re: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-05 Thread Tatsuro MATSUOKA
--- yselkowitz wrote:
> On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
> > Dear Yaakov Selkowitz
> > 
> > I ask alpply a patch the below which enables to use qt terminal on gnuplot 
> > for Cygwin.
> > (cygQt5Network-5.dll is affected.)
> > 
> > --- a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
> > +++ b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
> > @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
> > }
> > // create the socket
> > -if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 
> > 0, O_NONBLOCK))) {
> > +if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 
> > 0))) {
> > d->errorOccurred(UnsupportedSocketOperationError,
> > QLatin1String("QLocalSocket::connectToServer"));
> > return;
> > 
> 
> It seems we keep going in circles on this point.  If there is a bug in
> O_NONBLOCK, then please either narrow it down to an STC, or provide a
> patch to Cygwin.
> 
> --
> Yaakov
> 
> 
> 
I contacted with Enrico who tells me the patch that I have shown.

His reply is the below.

**
Dear Tatsuro,

unfortunately I do not have an STC other than the evidence that the
above patch works for gnuplot. I have always had problems with O_NONBLOCK
on cygwin. For example, see
https://www.mail-archive.com/cygwin@cygwin.com/msg104221.html 

-- 
Enrico
**
At this moment, the above is that I can do for this matter.

Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-04 Thread Tatsuro MATSUOKA
> From: Yaakov Selkowitz

> To: cygwin
> Cc: 
> Date: 2019/3/5, Tue 01:32
> Subject: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
> 
> On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
>>  Dear Yaakov Selkowitz
>> 
>>  I ask alpply a patch the below which enables to use qt terminal on gnuplot 
> for Cygwin.
>>  (cygQt5Network-5.dll is affected.)
>> 
>>  --- a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>  +++ b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
>>  @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
>>      }
>>      // create the socket
>>  -    if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> SOCK_STREAM, 0, O_NONBLOCK))) {
>>  +    if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, 
> SOCK_STREAM, 0))) {
>>          d->errorOccurred(UnsupportedSocketOperationError,
>>                         
> QLatin1String("QLocalSocket::connectToServer"));
>>          return;
>> 
> 
> It seems we keep going in circles on this point.  If there is a bug in
> O_NONBLOCK, then please either narrow it down to an STC, or provide a
> patch to Cygwin.
> 

The patch was proposed by Enrico Forestieri.

I will contact him and report reply here.

Tatsuro

Tatsuro


--
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



Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)

2019-03-04 Thread Yaakov Selkowitz
On Mon, 2019-03-04 at 07:43 +0900, Tatsuro MATSUOKA wrote:
> Dear Yaakov Selkowitz
> 
> I ask alpply a patch the below which enables to use qt terminal on gnuplot 
> for Cygwin.
> (cygQt5Network-5.dll is affected.)
> 
> --- a/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
> +++ b/qtbase-opensource-src-5.9.4/src/network/socket/qlocalsocket_unix.cpp
> @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
> }
> // create the socket
> -if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, 
> O_NONBLOCK))) {
> +if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 
> 0))) {
> d->errorOccurred(UnsupportedSocketOperationError,
> QLatin1String("QLocalSocket::connectToServer"));
> return;
> 

It seems we keep going in circles on this point.  If there is a bug in
O_NONBLOCK, then please either narrow it down to an STC, or provide a
patch to Cygwin.

--
Yaakov



--
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