public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
       [not found] <1439412702.1866573.1551653028041.JavaMail.yahoo.ref@mail.yahoo.co.jp>
@ 2019-03-03 22:43 ` Tatsuro MATSUOKA
  2019-03-04 16:32   ` Yaakov Selkowitz
  0 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-03 22:43 UTC (permalink / raw)
  To: cygwin, yselkowitz, Achim Gratz

----- Original Message -----

> From: Yaakov Selkowitz 
> To: cygwin
> Cc: 
> Date: 2018/2/24, Sat 05:02
> Subject: [ANNOUNCEMENT] Qt 5.9.4
> 
>T he following packages have been uploaded to the Cygwin distribution:
>
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;



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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-03 22:43 ` Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4) Tatsuro MATSUOKA
@ 2019-03-04 16:32   ` Yaakov Selkowitz
  2019-03-04 22:29     ` Tatsuro MATSUOKA
                       ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Yaakov Selkowitz @ 2019-03-04 16:32 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-04 16:32   ` Yaakov Selkowitz
@ 2019-03-04 22:29     ` Tatsuro MATSUOKA
  2019-03-05 12:57     ` Tatsuro MATSUOKA
  2019-03-11  0:28     ` Tatsuro MATSUOKA
  2 siblings, 0 replies; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-04 22:29 UTC (permalink / raw)
  To: Yaakov Selkowitz, cygwin

> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-04 16:32   ` Yaakov Selkowitz
  2019-03-04 22:29     ` Tatsuro MATSUOKA
@ 2019-03-05 12:57     ` Tatsuro MATSUOKA
  2019-03-05 19:24       ` Achim Gratz
  2019-03-11  0:28     ` Tatsuro MATSUOKA
  2 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-05 12:57 UTC (permalink / raw)
  To: Yaakov Selkowitz, cygwin

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-05 12:57     ` Tatsuro MATSUOKA
@ 2019-03-05 19:24       ` Achim Gratz
  2019-03-05 23:58         ` Tatsuro MATSUOKA
  2019-03-06  0:10         ` Tatsuro MATSUOKA
  0 siblings, 2 replies; 31+ messages in thread
From: Achim Gratz @ 2019-03-05 19:24 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-05 19:24       ` Achim Gratz
@ 2019-03-05 23:58         ` Tatsuro MATSUOKA
  2019-03-06  0:10         ` Tatsuro MATSUOKA
  1 sibling, 0 replies; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-05 23:58 UTC (permalink / raw)
  To: Achim Gratz, cygwin

> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-05 19:24       ` Achim Gratz
  2019-03-05 23:58         ` Tatsuro MATSUOKA
@ 2019-03-06  0:10         ` Tatsuro MATSUOKA
  2019-03-06  1:10           ` Tatsuro MATSUOKA
  1 sibling, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-06  0:10 UTC (permalink / raw)
  To: Achim Gratz, cygwin

----- 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 <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/select.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#define FIFONAME "/tmp/pipe"

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

    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, &readfds);
    do {
        nsel = select(fd + 1, &readfds, 0, 0, 0);
    } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));

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

    if (FD_ISSET(fd, &readfds)) {
        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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-06  0:10         ` Tatsuro MATSUOKA
@ 2019-03-06  1:10           ` Tatsuro MATSUOKA
  2019-03-06  1:55             ` Tatsuro MATSUOKA
  0 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-06  1:10 UTC (permalink / raw)
  To: Achim Gratz, cygwin

>>  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 <stdio.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <sys/select.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <unistd.h>
> 
> #define FIFONAME "/tmp/pipe"
> 
> int main(void)
> {
>     int fd;
>     int nsel;
>     fd_set readfds;
>     FD_ZERO(&readfds);
> 
>     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, &readfds);
>     do {
>         nsel = select(fd + 1, &readfds, 0, 0, 0);
>     } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));
> 
>     if (nsel == -1) {
>         perror("select");
>         exit(3);
>     }
> 
>     if (FD_ISSET(fd, &readfds)) {
>         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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-06  1:10           ` Tatsuro MATSUOKA
@ 2019-03-06  1:55             ` Tatsuro MATSUOKA
  2019-03-06  2:25               ` Tatsuro MATSUOKA
  0 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-06  1:55 UTC (permalink / raw)
  To: Achim Gratz, cygwin

----- 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 <stdio.h>
>>  #include <stdlib.h>
>>  #include <errno.h>
>>  #include <sys/select.h>
>>  #include <sys/types.h>
>>  #include <sys/stat.h>
>>  #include <fcntl.h>
>>  #include <unistd.h>
>> 
>>  #define FIFONAME "/tmp/pipe"
>> 
>>  int main(void)
>>  {
>>      int fd;
>>      int nsel;
>>      fd_set readfds;
>>      FD_ZERO(&readfds);
>> 
>>      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, &readfds);
>>      do {
>>          nsel = select(fd + 1, &readfds, 0, 0, 0);
>>      } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));
>> 
>>      if (nsel == -1) {
>>          perror("select");
>>          exit(3);
>>      }
>> 
>>      if (FD_ISSET(fd, &readfds)) {
>>          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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-06  1:55             ` Tatsuro MATSUOKA
@ 2019-03-06  2:25               ` Tatsuro MATSUOKA
  0 siblings, 0 replies; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-06  2:25 UTC (permalink / raw)
  To: Achim Gratz, cygwin

> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-04 16:32   ` Yaakov Selkowitz
  2019-03-04 22:29     ` Tatsuro MATSUOKA
  2019-03-05 12:57     ` Tatsuro MATSUOKA
@ 2019-03-11  0:28     ` Tatsuro MATSUOKA
  2019-03-11  0:50       ` Andrey Repin
  2019-03-11  0:53       ` Yaakov Selkowitz
  2 siblings, 2 replies; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-11  0:28 UTC (permalink / raw)
  To: Yaakov Selkowitz, cygwin

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  0:28     ` Tatsuro MATSUOKA
@ 2019-03-11  0:50       ` Andrey Repin
  2019-03-11  0:53       ` Yaakov Selkowitz
  1 sibling, 0 replies; 31+ messages in thread
From: Andrey Repin @ 2019-03-11  0:50 UTC (permalink / raw)
  To: Tatsuro MATSUOKA, cygwin

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  0:28     ` Tatsuro MATSUOKA
  2019-03-11  0:50       ` Andrey Repin
@ 2019-03-11  0:53       ` Yaakov Selkowitz
  2019-03-11  3:33         ` Tatsuro MATSUOKA
  1 sibling, 1 reply; 31+ messages in thread
From: Yaakov Selkowitz @ 2019-03-11  0:53 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  0:53       ` Yaakov Selkowitz
@ 2019-03-11  3:33         ` Tatsuro MATSUOKA
  2019-03-11  7:21           ` Mark Geisert
  0 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-11  3:33 UTC (permalink / raw)
  To: Yaakov Selkowitz, cygwin

----- Original Message -----

> From: Yaakov Selkowitz <yselkowitz
> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  3:33         ` Tatsuro MATSUOKA
@ 2019-03-11  7:21           ` Mark Geisert
  2019-03-11  7:56             ` Tatsuro MATSUOKA
  2019-03-11  9:45             ` Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4) Corinna Vinschen
  0 siblings, 2 replies; 31+ messages in thread
From: Mark Geisert @ 2019-03-11  7:21 UTC (permalink / raw)
  To: cygwin

Tatsuro MATSUOKA wrote:
> ----- Original Message -----
>
>> From: Yaakov Selkowitz <yselkowitz
>> 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


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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  7:21           ` Mark Geisert
@ 2019-03-11  7:56             ` Tatsuro MATSUOKA
  2019-03-12  4:21               ` Mark Geisert
  2019-03-11  9:45             ` Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4) Corinna Vinschen
  1 sibling, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-11  7:56 UTC (permalink / raw)
  To: Mark Geisert, cygwin

[-- Attachment #1: Type: text/plain, Size: 3411 bytes --]

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

Tatsuro

[-- Attachment #2: gnuplot.trace.tar.xz --]
[-- Type: application/x-xz, Size: 254836 bytes --]

[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  7:21           ` Mark Geisert
  2019-03-11  7:56             ` Tatsuro MATSUOKA
@ 2019-03-11  9:45             ` Corinna Vinschen
  2019-03-12  4:16               ` Mark Geisert
  1 sibling, 1 reply; 31+ messages in thread
From: Corinna Vinschen @ 2019-03-11  9:45 UTC (permalink / raw)
  To: Mark Geisert; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  9:45             ` Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4) Corinna Vinschen
@ 2019-03-12  4:16               ` Mark Geisert
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Geisert @ 2019-03-12  4:16 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-11  7:56             ` Tatsuro MATSUOKA
@ 2019-03-12  4:21               ` Mark Geisert
  2019-03-12  6:51                 ` Tatsuro MATSUOKA
  0 siblings, 1 reply; 31+ messages in thread
From: Mark Geisert @ 2019-03-12  4:21 UTC (permalink / raw)
  To: cygwin

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


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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4)
  2019-03-12  4:21               ` Mark Geisert
@ 2019-03-12  6:51                 ` Tatsuro MATSUOKA
  2019-03-12  8:04                   ` Patch request to qt 5.9.4 Mark Geisert
  0 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-12  6:51 UTC (permalink / raw)
  To: Mark Geisert, cygwin





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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-12  6:51                 ` Tatsuro MATSUOKA
@ 2019-03-12  8:04                   ` Mark Geisert
  2019-03-12  8:26                     ` Tatsuro MATSUOKA
  2019-03-12 19:34                     ` Achim Gratz
  0 siblings, 2 replies; 31+ messages in thread
From: Mark Geisert @ 2019-03-12  8:04 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: TEXT/PLAIN, Size: 812 bytes --]

On Tue, 12 Mar 2019, Tatsuro MATSUOKA wrote:
[...]
>> From: Mark Geisert
>> 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.

Yes, I understand that is happening at a low level.  What exactly are you 
typing at your keyboard to make gnuplot produce the Qt graphics?  I would 
like to reproduce your issue on my system; what do I need to do?

Please refer to the specific questions I was asking above.
Thank you,

..mark

[-- Attachment #2: Type: text/plain, Size: 219 bytes --]


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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-12  8:04                   ` Patch request to qt 5.9.4 Mark Geisert
@ 2019-03-12  8:26                     ` Tatsuro MATSUOKA
  2019-03-12 19:37                       ` Achim Gratz
  2019-03-12 23:22                       ` Tatsuro MATSUOKA
  2019-03-12 19:34                     ` Achim Gratz
  1 sibling, 2 replies; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-12  8:26 UTC (permalink / raw)
  To: Mark Geisert, cygwin

----- Original Message -----

> From: Mark Geisert 
> To: cygwin
> Cc: 
> Date: 2019/3/12, Tue 17:04
> Subject: Re: Patch request to qt 5.9.4
> 
> On Tue, 12 Mar 2019, Tatsuro MATSUOKA wrote:
> [...]
>>>  From: Mark Geisert
>>>  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.
> 
> Yes, I understand that is happening at a low level.  What exactly are you 
> typing at your keyboard to make gnuplot produce the Qt graphics?  I would 
> like to reproduce your issue on my system; what do I need to do?
> 
> Please refer to the specific questions I was asking above.
> Thank you,
> 
> ..mark

Gnuplot distrubuted on Cyygwin does not link with Qt.
I am distrbuting develoment version of gnuplot with Qt (patched).
I have to prepare gnuplot binary without patch.

I have my web site and I will prepare binaries without stripped debug information
and upload on my web.

I will do it tomorrow morning. (Before job.)

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-12  8:04                   ` Patch request to qt 5.9.4 Mark Geisert
  2019-03-12  8:26                     ` Tatsuro MATSUOKA
@ 2019-03-12 19:34                     ` Achim Gratz
  1 sibling, 0 replies; 31+ messages in thread
From: Achim Gratz @ 2019-03-12 19:34 UTC (permalink / raw)
  To: cygwin

Mark Geisert writes:
> Yes, I understand that is happening at a low level.  What exactly are
> you typing at your keyboard to make gnuplot produce the Qt graphics?

set term qt
plot NaN

> I would like to reproduce your issue on my system; what do I need to
> do?

The above will hang indefinitely.


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

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-12  8:26                     ` Tatsuro MATSUOKA
@ 2019-03-12 19:37                       ` Achim Gratz
  2019-03-12 23:22                       ` Tatsuro MATSUOKA
  1 sibling, 0 replies; 31+ messages in thread
From: Achim Gratz @ 2019-03-12 19:37 UTC (permalink / raw)
  To: cygwin

Tatsuro MATSUOKA writes:
> Gnuplot distrubuted on Cyygwin does not link with Qt.

No of course not.  But you can take the source package and add the
configure option (it's just commented and put aside) back in.

> I am distrbuting develoment version of gnuplot with Qt (patched).
> I have to prepare gnuplot binary without patch.

I can upload a test version of gnuplot with qt enabled if anybody needs
that.


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

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-12  8:26                     ` Tatsuro MATSUOKA
  2019-03-12 19:37                       ` Achim Gratz
@ 2019-03-12 23:22                       ` Tatsuro MATSUOKA
  2019-03-13  1:12                         ` Mark Geisert
  1 sibling, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-12 23:22 UTC (permalink / raw)
  To: Mark Geisert, cygwin

----- Original Message -----

> From: Tatsuro MATSUOKA 
> To: Mark Geisert  cygwin
> Cc: 
> Date: 2019/3/12, Tue 17:25
> Subject: Re: Patch request to qt 5.9.4
> 
> ----- Original Message -----
> 
>>  From: Mark Geisert 
>>  To: cygwin
>>  Cc: 
>>  Date: 2019/3/12, Tue 17:04
>>  Subject: Re: Patch request to qt 5.9.4
>> 
>>  On Tue, 12 Mar 2019, Tatsuro MATSUOKA wrote:
>>  [...]
>>>>   From: Mark Geisert
>>>>   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.
>> 
>>  Yes, I understand that is happening at a low level.  What exactly are you 
>>  typing at your keyboard to make gnuplot produce the Qt graphics?  I would 
>>  like to reproduce your issue on my system; what do I need to do?
>> 
>>  Please refer to the specific questions I was asking above.
>>  Thank you,
>> 
>>  ..mark
> 
> Gnuplot distrubuted on Cyygwin does not link with Qt.
> I am distrbuting develoment version of gnuplot with Qt (patched).
> I have to prepare gnuplot binary without patch.
> 
> I have my web site and I will prepare binaries without stripped debug 
> information
> and upload on my web.
> 
> I will do it tomorrow morning. (Before job.)
> 
> Tatsuro

I have prepared binaries:
http://tmacchant3.starfree.jp/gnuplot/Eng/cyg_qt_test/

test
From gnplot prompt 

gnuplot> set terminal qt 
gnuplot> plot x 

Without Qt patch

Could not connect to existing gnuplot_qt. Starting a new one.

Warning: slow font initialization



With Qt patchplot appears

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-12 23:22                       ` Tatsuro MATSUOKA
@ 2019-03-13  1:12                         ` Mark Geisert
  2019-03-13  4:27                           ` Tatsuro MATSUOKA
  0 siblings, 1 reply; 31+ messages in thread
From: Mark Geisert @ 2019-03-13  1:12 UTC (permalink / raw)
  To: cygwin

Tatsuro MATSUOKA wrote:
> ----- Original Message -----
>
>> From: Tatsuro MATSUOKA
>> To: Mark Geisert  cygwin
>> Cc:
>> Date: 2019/3/12, Tue 17:25
>> Subject: Re: Patch request to qt 5.9.4
>>
>> ----- Original Message -----
>>
>>>  From: Mark Geisert
>>>  To: cygwin
>>>  Cc:
>>>  Date: 2019/3/12, Tue 17:04
>>>  Subject: Re: Patch request to qt 5.9.4
>>>
>>>  On Tue, 12 Mar 2019, Tatsuro MATSUOKA wrote:
>>>  [...]
>>>>>   From: Mark Geisert
>>>>>   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.
>>>
>>>  Yes, I understand that is happening at a low level.  What exactly are you
>>>  typing at your keyboard to make gnuplot produce the Qt graphics?  I would
>>>  like to reproduce your issue on my system; what do I need to do?
>>>
>>>  Please refer to the specific questions I was asking above.
>>>  Thank you,
>>>
>>>  ..mark
>>
>> Gnuplot distrubuted on Cyygwin does not link with Qt.
>> I am distrbuting develoment version of gnuplot with Qt (patched).
>> I have to prepare gnuplot binary without patch.
>>
>> I have my web site and I will prepare binaries without stripped debug
>> information
>> and upload on my web.
>>
>> I will do it tomorrow morning. (Before job.)
>>
>> Tatsuro
>
> I have prepared binaries:
> http://tmacchant3.starfree.jp/gnuplot/Eng/cyg_qt_test/
>
> test
> From gnplot prompt
>
> gnuplot> set terminal qt
> gnuplot> plot x
>
> Without Qt patch
>
> Could not connect to existing gnuplot_qt. Starting a new one.
>
> Warning: slow font initialization
>
>
>
> With Qt patchplot appears

Thank you very much, Tatsuro.  I have reproduced your issue and your fix.  I 
will dig into the Cygwin internals and let you know what I find out.

H/T to Achim for his comments and offer of help.

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-13  1:12                         ` Mark Geisert
@ 2019-03-13  4:27                           ` Tatsuro MATSUOKA
  2019-03-13  8:33                             ` Mark Geisert
  0 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-13  4:27 UTC (permalink / raw)
  To: Mark Geisert, cygwin

----- Original Message -----

> From: Mark Geisert 
> To: cygwin
> Cc: 
> Date: 2019/3/13, Wed 10:12
> Subject: Re: Patch request to qt 5.9.4
> 
>T atsuro MATSUOKA wrote:
>>  ----- Original Message -----
>> 
>>>  From: Tatsuro MATSUOKA
>>>  To: Mark Geisert  cygwin
>>>  Cc:
>>>  Date: 2019/3/12, Tue 17:25
>>>  Subject: Re: Patch request to qt 5.9.4
>>> 
>>>  ----- Original Message -----
>>> 
>>>>   From: Mark Geisert
>>>>   To: cygwin
>>>>   Cc:
>>>>   Date: 2019/3/12, Tue 17:04
>>>>   Subject: Re: Patch request to qt 5.9.4
>>>> 
>>>>   On Tue, 12 Mar 2019, Tatsuro MATSUOKA wrote:
>>>>   [...]
>>>>>>    From: Mark Geisert
>>>>>>    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.
>>>> 
>>>>   Yes, I understand that is happening at a low level.  What exactly 
> are you
>>>>   typing at your keyboard to make gnuplot produce the Qt graphics?  
> I would
>>>>   like to reproduce your issue on my system; what do I need to do?
>>>> 
>>>>   Please refer to the specific questions I was asking above.
>>>>   Thank you,
>>>> 
>>>>   ..mark
>>> 
>>>  Gnuplot distrubuted on Cyygwin does not link with Qt.
>>>  I am distrbuting develoment version of gnuplot with Qt (patched).
>>>  I have to prepare gnuplot binary without patch.
>>> 
>>>  I have my web site and I will prepare binaries without stripped debug
>>>  information
>>>  and upload on my web.
>>> 
>>>  I will do it tomorrow morning. (Before job.)
>>> 
>>>  Tatsuro
>> 
>>  I have prepared binaries:
>>  http://tmacchant3.starfree.jp/gnuplot/Eng/cyg_qt_test/ 
>> 
>>  test
>>  From gnplot prompt
>> 
>>  gnuplot> set terminal qt
>>  gnuplot> plot x
>> 
>>  Without Qt patch
>> 
>>  Could not connect to existing gnuplot_qt. Starting a new one.
>> 
>>  Warning: slow font initialization
>> 
>> 
>> 
>>  With Qt patchplot appears
> 
> Thank you very much, Tatsuro.  I have reproduced your issue and your fix.  I 
> will dig into the Cygwin internals and let you know what I find out.
> 
> H/T to Achim for his comments and offer of help.
> 
> ..mark
One note: for gnuplot.exe and gnuplot_qt.exe, debug symbols are not stripped and 
you can trace gdb but I did not know debug info 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-13  4:27                           ` Tatsuro MATSUOKA
@ 2019-03-13  8:33                             ` Mark Geisert
  2019-03-15  8:06                               ` Mark Geisert
  0 siblings, 1 reply; 31+ messages in thread
From: Mark Geisert @ 2019-03-13  8:33 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1723 bytes --]

On Wed, 13 Mar 2019, Tatsuro MATSUOKA wrote:
[...]
>>>  I have prepared binaries:
>>>  http://tmacchant3.starfree.jp/gnuplot/Eng/cyg_qt_test/
>>>
>>>  test
>>>  From gnplot prompt
>>>
>>>  gnuplot> set terminal qt
>>>  gnuplot> plot x
>>>
>>>  Without Qt patch
>>>
>>>  Could not connect to existing gnuplot_qt. Starting a new one.
>>>
>>>  Warning: slow font initialization
>>>
>>>
>>>
>>>  With Qt patchplot appears
[...]
> One note: for gnuplot.exe and gnuplot_qt.exe, debug symbols are not stripped and 
> you can trace gdb but I did not know debug info for Qt.

I believe I've found the root cause of this issue of outbound connect on a 
non-blocking socket not working under Cygwin.

It's in Qt's qlocalsocket_unix.cpp.  On line 285 there's a call to 
qt_safe_connect().  At this point the socket fd has already been set 
non-blocking.  Within qt_safe_connect() there's a call (eventually) to 
Cygwin's connect().  That connect() is returning -1 with errno set to 
EINPROGRESS.

Back in qlocalsocket_unix.cpp, line 287 does a 'switch(errno)' but doesn't
have a case for EINPROGRESS.  That error condition reaches the 'default:'
case, returning without the connection being completed.  I don't know why 
there's no error report to the user.

Note that you don't want to quick-fix this by adding a 'case EINPROGRESS:'
that simply acts like the connection is completed.  I think somebody who 
knows Qt network internals will have to develop a real fix.

It seems nobody has run across a non-blocking connect() that doesn't 
immediately complete connection.. but Posix mandates an EINPROGRESS error 
in that situation so Cygwin appears to be doing the right thing.

..mark

[-- Attachment #2: Type: text/plain, Size: 219 bytes --]


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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-13  8:33                             ` Mark Geisert
@ 2019-03-15  8:06                               ` Mark Geisert
  2019-03-15  9:40                                 ` Tatsuro MATSUOKA
  0 siblings, 1 reply; 31+ messages in thread
From: Mark Geisert @ 2019-03-15  8:06 UTC (permalink / raw)
  To: cygwin

Mark Geisert wrote:
> I believe I've found the root cause of this issue of outbound connect on a
> non-blocking socket not working under Cygwin.
[...]

Hi Tatsuro,
This Qt issue should be reported to their developers.  Do you have experience 
opening a ticket with them?  If so, please do so and let me know the ticket/bug 
number.  I will participate in discussion there.  I could also open a ticket 
myself if you prefer that I do it.

It seems to me that we should continue to apply your one-line patch that turns 
off O_NONBLOCK at that one Qt location, as a workaround for this Qt problem on 
Cygwin.  When the Qt devs fix the root cause and release a new Qt containing the 
fix, we can then remove our local patch.

..mark

Yaakov: Does this all sound reasonable to you?

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-15  8:06                               ` Mark Geisert
@ 2019-03-15  9:40                                 ` Tatsuro MATSUOKA
  2019-03-16  0:41                                   ` Tatsuro MATSUOKA
  0 siblings, 1 reply; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-15  9:40 UTC (permalink / raw)
  To: Mark Geisert, cygwin

----- Original Message -----

> From: Mark Geisert 
> To: cygwinm
> Cc: 
> Date: 2019/3/15, Fri 17:06
> Subject: Re: Patch request to qt 5.9.4
> 
> Mark Geisert wrote:
>>  I believe I've found the root cause of this issue of outbound connect 
> on a
>>  non-blocking socket not working under Cygwin.
> [...]
> 
> Hi Tatsuro,
> This Qt issue should be reported to their developers.  Do you have experience 
> opening a ticket with them?  If so, please do so and let me know the ticket/bug 
> number.  I will participate in discussion there.  I could also open a ticket 
> myself if you prefer that I do it.
> 
> It seems to me that we should continue to apply your one-line patch that turns 
> off O_NONBLOCK at that one Qt location, as a workaround for this Qt problem on 
> Cygwin.  When the Qt devs fix the root cause and release a new Qt containing the 
> 
> fix, we can then remove our local patch.
> 
> ..mark
> 
> Yaakov: Does this all sound reasonable to you?
> 
I do not have experience opening a ticket of Qt.
However, I frequently open bug tickets to gnuplot and GNU Octave.

I will try it tomorrow and report here about submit of the ticket.

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Patch request to qt 5.9.4
  2019-03-15  9:40                                 ` Tatsuro MATSUOKA
@ 2019-03-16  0:41                                   ` Tatsuro MATSUOKA
  0 siblings, 0 replies; 31+ messages in thread
From: Tatsuro MATSUOKA @ 2019-03-16  0:41 UTC (permalink / raw)
  To: Mark Geisert, cygwin

>>  Hi Tatsuro,

>>  This Qt issue should be reported to their developers.  Do you have 
> experience 
>>  opening a ticket with them?  If so, please do so and let me know the 
> ticket/bug 
>>  number.  I will participate in discussion there.  I could also open a 
> ticket 
>>  myself if you prefer that I do it.
>> 
>>  It seems to me that we should continue to apply your one-line patch that 
> turns 
>>  off O_NONBLOCK at that one Qt location, as a workaround for this Qt problem 
> on 
>>  Cygwin.  When the Qt devs fix the root cause and release a new Qt 
> containing the 
>> 
>>  fix, we can then remove our local patch.
>> 
>>  ..mark
>> 
>>  Yaakov: Does this all sound reasonable to you?
>>  
> I do not have experience opening a ticket of Qt.
> However, I frequently open bug tickets to gnuplot and GNU Octave.
> 
> I will try it tomorrow and report here about submit of the ticket.

Mark

I created the Qt bug.

https://bugreports.qt.io/browse/QTBUG-74486

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2019-03-16  0:41 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1439412702.1866573.1551653028041.JavaMail.yahoo.ref@mail.yahoo.co.jp>
2019-03-03 22:43 ` Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4) Tatsuro MATSUOKA
2019-03-04 16:32   ` Yaakov Selkowitz
2019-03-04 22:29     ` Tatsuro MATSUOKA
2019-03-05 12:57     ` Tatsuro MATSUOKA
2019-03-05 19:24       ` Achim Gratz
2019-03-05 23:58         ` Tatsuro MATSUOKA
2019-03-06  0:10         ` Tatsuro MATSUOKA
2019-03-06  1:10           ` Tatsuro MATSUOKA
2019-03-06  1:55             ` Tatsuro MATSUOKA
2019-03-06  2:25               ` Tatsuro MATSUOKA
2019-03-11  0:28     ` Tatsuro MATSUOKA
2019-03-11  0:50       ` Andrey Repin
2019-03-11  0:53       ` Yaakov Selkowitz
2019-03-11  3:33         ` Tatsuro MATSUOKA
2019-03-11  7:21           ` Mark Geisert
2019-03-11  7:56             ` Tatsuro MATSUOKA
2019-03-12  4:21               ` Mark Geisert
2019-03-12  6:51                 ` Tatsuro MATSUOKA
2019-03-12  8:04                   ` Patch request to qt 5.9.4 Mark Geisert
2019-03-12  8:26                     ` Tatsuro MATSUOKA
2019-03-12 19:37                       ` Achim Gratz
2019-03-12 23:22                       ` Tatsuro MATSUOKA
2019-03-13  1:12                         ` Mark Geisert
2019-03-13  4:27                           ` Tatsuro MATSUOKA
2019-03-13  8:33                             ` Mark Geisert
2019-03-15  8:06                               ` Mark Geisert
2019-03-15  9:40                                 ` Tatsuro MATSUOKA
2019-03-16  0:41                                   ` Tatsuro MATSUOKA
2019-03-12 19:34                     ` Achim Gratz
2019-03-11  9:45             ` Patch request to qt 5.9.4 (Re: [ANNOUNCEMENT] Qt 5.9.4) Corinna Vinschen
2019-03-12  4:16               ` Mark Geisert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).