Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Console Input Termination Issue

Ok, I’ve analyzed the problem a bit. The EOFHandler was a very got hint to start. It gets triggered in any case. The problem lies in the PTY. It seems as if the console receives the ctrl+d and closes the file descriptor (PTYOutputStream and native close0). But the PTY does not actually receive the EOF signal. That worked with when the pipes were connected (unchecking the option in the run configuration), as then the underlying application actually received the EOF.

 

On windows that did not occur as it used the Spawner and avoided the PTY.

 

I could fix the issue by sending ASCII EOF (i.e. ‘\4’) to the stream before close. That is possible either in the PTYOutputStream implementation or even in the native implementation of close0 in ptyio.c. Does anybody have a concern about fixing it this way?

 

Regards

Thomas

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Corbat Thomas
Sent: Montag, 7. September 2015 10:18
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] Console Input Termination Issue

 

Thanks for the replies!

 

> I don't quite understand how your users trigger the hang.  When exactly do they sent EOF?  And how do
they do that?  I tried ctrl+d from the console but nothing happened and cin>>c continued to work.

Perhaps you encountered the focus problem and the ctrl+d had not been sent to the console at all. I could reproduce it on a linux system now. If you have an executable which reads characters form the standard input in a while loop and just sends them to standard out, it works until I press ctrl+d. After that no input is recognized. It actually seems as if the input was terminated, but the termination does not get sent to the application (input is not closed for the executable).

On the Mac CDT also beachballs until the executable is terminated.

 

> Perhaps this bug is going to interest you: https://bugs.eclipse.org/bugs/show_bug.cgi?id=159803

 

Yes, that seems to be it. So far we did not consider this a huge issue, since we could modify the run configuration as a workaround.

 

Regards

Thomas

 

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Marc-André Laperle
Sent: Freitag, 4. September 2015 19:18
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] Console Input Termination Issue

 

Perhaps this bug is going to interest you:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=159803

I actually looked into fixing this once but there were still issues with focus. I don't have the patch at hand but I remember vaguely it was just adding a "EOFHandler" just like in org.eclipse.debug.internal.ui.views.console.ProcessConsolePageParticipant. Might be a good time to revisit that!

Marc-Andre


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Marc Khouzam [marc.khouzam@xxxxxxxxxxxx]
Sent: Friday, 04 September 2015 1:03 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Console Input Termination Issue

That's my fault.  We never offered that option for DSF-GDB so when updating the Run launch for Mars,
I removed that option to have a single look-and-feel for the launch main tab.  I couldn't think of  a reason
you wouldn't want to connect to a terminal, and it seemed more confusing than anything to have that option.

I don't quite understand how your users trigger the hang.  When exactly do they sent EOF?  And how do
they do that?  I tried ctrl+d from the console but nothing happened and cin>>c continued to work.


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Corbat Thomas [thomas.corbat@xxxxxx]
Sent: September 4, 2015 11:33 AM
To: CDT General developers list. (cdt-dev@xxxxxxxxxxx)
Subject: [cdt-dev] Console Input Termination Issue

Hi

 

Linux and Mac users at our site have experienced issues with terminating the console input by sending EOF (ctrl + d). There used to be a workaround by unchecking the “Connect process input and output to terminal” option in the run configuration, but this seems to be gone, or let’s say missing in the CMainTab2 (Checked in 8.8 RC2a and Master).

 

As an effect we have the launched executable hang while reading from console (e.g. std::cin >> c) in an unrecoverable state – no further input is sent, but the read operation does not fail either. The application has to be terminated.

It works on Windows with ctrl+z though.

 

Does anybody have a clue whether there is another workaround or an option to configure this?

 

Kind Regards

Thomas


Back to the top