Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Error Starting Process: Cannot create pty (Run Program and see this error message. )
icon8.gif  Error Starting Process: Cannot create pty [message #1753589] Tue, 07 February 2017 23:15 Go to next message
Katherine Mowris is currently offline Katherine MowrisFriend
Messages: 1
Registered: February 2017
Junior Member
While running my C program in eclipse. I continue to get this message while running one of my project files. The code I am running is posted below. I created the project with MAC OSX GCC and created a new source file as I normally do. Any help would be greatly appreciated! Thank you!

#include <stdio.h>
int main(void)
{
char string[80], characters;
int string_counter, num_letters, num_digits, num_spaces;
printf("Enter a line of text:\n");
characters=getchar( );
num_letters=num_digits=num_spaces=0;
string_counter=0;
while (string[string_counter]!='\0')
{
characters=getchar();
char ch=string[string_counter];
if ((ch>='A' && ch<='Z') || (ch>='a' && ch<='z'))
num_letters++;
else if (ch>='0' && ch<='9')
num_digits++;
else if (ch==' ' || ch == '\n')
num_spaces++;
else if (ch=='#')
break;
else
string_counter++;
}
printf("Letters: %d, Digits: %d: Spaces: %d", num_letters, num_digits, num_spaces);
return 0;
}

Re: Error Starting Process: Cannot create pty [message #1753628 is a reply to message #1753589] Wed, 08 February 2017 10:01 Go to previous messageGo to next message
Alex Freidin is currently offline Alex FreidinFriend
Messages: 29
Registered: July 2009
Junior Member
PTY is a pseudo-terminal that Eclipse (CDT-DSF) uses to connect the application STDIO with Eclipse Console.
It either couldn't create the PTY or failed to load the spawner library. More info is in the LOG.
Delete your LOG in <workspace>/.metadata/.log, reproduce the problem and attach the new .log file.
Re: Error Starting Process: Cannot create pty [message #1768436 is a reply to message #1753628] Tue, 18 July 2017 17:00 Go to previous messageGo to next message
Yancheng Ou is currently offline Yancheng OuFriend
Messages: 2
Registered: July 2017
Junior Member
index.php/fa/30037/0/I have the problem either after upgrading my OS from macOS 10.12 to macOS 10.13 beta. All of my projects fail to run, but I can run them via terminal.

Here's the log:

!ENTRY org.eclipse.cdt.launch 4 150 2017-07-18 23:37:49.648
!MESSAGE Error starting process.
!STACK 0
java.io.IOException: Cannot create pty
at org.eclipse.cdt.utils.pty.PTY.<init>(PTY.java:149)
at org.eclipse.cdt.utils.pty.PTY.<init>(PTY.java:114)
at org.eclipse.cdt.utils.pty.PTY.<init>(PTY.java:89)
at org.eclipse.cdt.launch.internal.LocalRunLaunchDelegate.exec(LocalRunLaunchDelegate.java:281)
at org.eclipse.cdt.launch.internal.LocalRunLaunchDelegate.runLocalApplication(LocalRunLaunchDelegate.java:108)
at org.eclipse.cdt.launch.internal.LocalRunLaunchDelegate.launch(LocalRunLaunchDelegate.java:76)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
!SUBENTRY 1 org.eclipse.cdt.launch 4 150 2017-07-18 23:37:49.648
!MESSAGE Cannot create pty
!STACK 0
java.io.IOException: Cannot create pty
at org.eclipse.cdt.utils.pty.PTY.<init>(PTY.java:149)
at org.eclipse.cdt.utils.pty.PTY.<init>(PTY.java:114)
at org.eclipse.cdt.utils.pty.PTY.<init>(PTY.java:89)
at org.eclipse.cdt.launch.internal.LocalRunLaunchDelegate.exec(LocalRunLaunchDelegate.java:281)
at org.eclipse.cdt.launch.internal.LocalRunLaunchDelegate.runLocalApplication(LocalRunLaunchDelegate.java:108)
at org.eclipse.cdt.launch.internal.LocalRunLaunchDelegate.launch(LocalRunLaunchDelegate.java:76)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

But If I want to run again... It stuck at Launching: Launching delegate... and I failed to obtain the log.
The log file I uploaded is the log file records the PTY errors at the end of the file.
  • Attachment: 1.log
    (Size: 249.43KB, Downloaded 18 times)
Re: Error Starting Process: Cannot create pty [message #1768474 is a reply to message #1768436] Wed, 19 July 2017 09:05 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 397
Registered: June 2014
Senior Member
Hi,

Can you file a bug report please. The problem here is that CDT has failed to open the PTY, what I don't understand/know is why that worked in 10.12 and not in 10.13. Perhaps Apple changed something, or perhaps the permissions for /dev/ptyXXX changed?

This is the code that opens the PTY, that as far as I can tell is failing in your case. If you can run this on your computer you can help diagnose the problem.

Call the ptym_open with a char buffer of sufficient size and, if a <0 is returned, please let me know what causes it?

I don't have easy access to a Mac myself, so any support you can provide will be of immense benefit to the whole community.

Thanks,
Jonah


int
ptym_open(char * pts_name)
{
	char *ptr1, *ptr2;
	int fdm;
	
	strcpy(pts_name, "/dev/ptyXY");
	/* array index: 012345689 (for references in following code) */
	for (ptr1 = "pqrstuvwxyzPQRST"; *ptr1 != 0; ptr1++) {
		pts_name[8] = *ptr1;
		for (ptr2 = "0123456789abcdef"; *ptr2 != 0; ptr2++) {
			pts_name[9] = *ptr2;
			/* try to open master */
			fdm = open(pts_name, O_RDWR);
			if (fdm < 0) {
				if (errno == ENOENT) {/* different from EIO */
					return -1;  /* out of pty devices */
				} else {
					continue;  /* try next pty device */
				}
			}
			pts_name[5] = 't'; /* chage "pty" to "tty" */
			return fdm;   /* got it, return fd of master */
		}
	}
	return -1; /* out of pty devices */
}
Re: Error Starting Process: Cannot create pty [message #1773600 is a reply to message #1768436] Fri, 29 September 2017 20:17 Go to previous messageGo to next message
Yongle Lin is currently offline Yongle LinFriend
Messages: 1
Registered: September 2017
Junior Member
I encounter the same problem when I update my macOS 10.12 to 10.13. Have you found the solution to this problem?
Re: Error Starting Process: Cannot create pty [message #1773668 is a reply to message #1773600] Mon, 02 October 2017 15:50 Go to previous messageGo to next message
Yancheng Ou is currently offline Yancheng OuFriend
Messages: 2
Registered: July 2017
Junior Member
CDT 9.3.1 is released, you might get rid of it by upgrading your CDT plugin.
Re: Error Starting Process: Cannot create pty [message #1773940 is a reply to message #1773668] Fri, 06 October 2017 21:27 Go to previous message
Kevin Boddie is currently offline Kevin BoddieFriend
Messages: 1
Registered: October 2017
Junior Member
Upgrading CDT ( 9.3.2 ) fixed this issue for me! Thanks!
Previous Topic:mutiple definitions error in a C project
Next Topic:cygwin/mingw support needed
Goto Forum:
  


Current Time: Mon Dec 11 05:50:20 GMT 2017

Powered by FUDForum. Page generated in 0.02000 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software