Bug 248071 - C/C++ Local Application launch does not properly initialize terminal session
Summary: C/C++ Local Application launch does not properly initialize terminal session
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 5.0   Edit
Hardware: All Unix All
: P3 enhancement (vote)
Target Milestone: 7.0   Edit
Assignee: Anton Leherbauer CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 196337
  Show dependency tree
 
Reported: 2008-09-21 16:58 EDT by Mirko Raner CLA
Modified: 2010-07-28 15:25 EDT (History)
8 users (show)

See Also:


Attachments
Patch with proposed fix. (14.44 KB, patch)
2009-10-28 16:10 EDT, Pawel Piech CLA
no flags Details | Diff
Build libraries for linux-x86 platform. (10.89 KB, application/octet-stream)
2009-10-28 18:08 EDT, Pawel Piech CLA
no flags Details
Updated patch with warnings fixes. (25.97 KB, patch)
2009-10-29 18:36 EDT, Pawel Piech CLA
no flags Details | Diff
Updated binaries for linux.x86 (11.15 KB, patch)
2009-10-29 18:44 EDT, Pawel Piech CLA
no flags Details | Diff
Binaries for win32.x86. (11.67 KB, application/octet-stream)
2009-10-30 12:10 EDT, Pawel Piech CLA
no flags Details
Updated patch with complete file set and aix. (64.37 KB, patch)
2009-10-30 13:16 EDT, Pawel Piech CLA
no flags Details | Diff
linux.x86 binaries built on RHEL WS 4 (9.62 KB, application/zip)
2009-11-05 07:36 EST, Anton Leherbauer CLA
no flags Details
solaris.sparc binaries built on Solaris 9 (10.91 KB, application/zip)
2009-11-09 06:35 EST, Anton Leherbauer CLA
no flags Details
Complete source patch with @since tags, javadoc and cosmetics (71.72 KB, patch)
2009-11-09 10:16 EST, Anton Leherbauer CLA
aleherb+eclipse: iplog-
Details | Diff
Mac OS patch (13.79 KB, patch)
2010-02-04 04:30 EST, Anton Leherbauer CLA
aleherb+eclipse: iplog-
Details | Diff
Mac OS second try (13.96 KB, patch)
2010-02-10 10:28 EST, Anton Leherbauer CLA
aleherb+eclipse: iplog-
Details | Diff
Mac OS last try (15.11 KB, patch)
2010-02-12 08:30 EST, Anton Leherbauer CLA
aleherb+eclipse: iplog-
Details | Diff
Mac OS 'last try' binaries (15.89 KB, application/octet-stream)
2010-02-15 15:19 EST, James Blackburn CLA
jamesblackburn+eclipse: iplog-
Details
Final source patch (Java + C) for linux, solaris and macosx (74.37 KB, patch)
2010-02-16 08:27 EST, Anton Leherbauer CLA
aleherb+eclipse: iplog-
Details | Diff
Binaries for linux (x86, x86_64) and solaris (31.62 KB, application/zip)
2010-02-16 08:30 EST, Anton Leherbauer CLA
no flags Details
Mac OS 10.5.8 binaries (19.86 KB, application/zip)
2010-04-29 03:05 EDT, Mirko Raner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mirko Raner CLA 2008-09-21 16:58:41 EDT
Build ID: I20080617-2000

Steps To Reproduce:
This problem surfaced in relation to bug 196337, but it can be reproduced with regular C/C++ Local Application launches on Solaris. It severely hinders the development of terminal-based applications with CDT on Solaris.
To reproduce:

1. Create and run a C/C++ Local Application launch that launches "/bin/bash -i" (make sure that "Connect process input/output to a terminal" is enabled)
2. As the standard console will not pass Ctrl-C to the terminal, choose a different interrupt character: for example, use "@" by typing "stty intr @" at the shell prompt
3. Now use the cat command to copy from standard input to a file by typing "cat >testfile" at the prompt
4. To exit the "cat" program, type the interrupt character "@" followed by return (return is necessary because of line buffering)

==> Problem #1: cat should terminate because the "@" character should trigger an interrupt equivalent to Ctrl-C, but nothing happens

5. Terminate the "cat" program by ending the input with Ctrl-D (which signals the end of input and does get passed on by the console view)

==> Problem #2: instead of just terminating the "cat" program the shell itself also gets terminated by the Ctrl-D

I believe the root of the problem is related to the session set-up in exec_pty.c, line 99 (see http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core.solaris/library/exec_pty.c?annotate=1.5&root=Tools_Project#l99):

        setpgid(getpid(), getpid());

The process is made a process group leader but the session is never registered with the terminal API. Line 99 should probably read:

        tcsetpgrp(STDIN_FILENO, setsid());

I tried this modification but it caused trouble when calling stty, because whereas stdin and stdout are connected to a proper terminal, stderr is connected to a pipe (see line 86), which is not a terminal. When I removed the pipe and redirected stderr directly to the pseudo-terminal's slave device, problem #1 (process interruption) went away. As a negative side effect I noticed that the console coloring for stdout and stderr got sometimes mixed up. Problem #2 (Ctrl-D terminating not only the active process but also the parent shell) still persisted after my change.

I am mainly working on Solaris so I don't know whether this sort of problem affects other platforms as well. I started using the CDT Spawner for bug 196337, but the above described problem prevents local terminals from behaving correctly under Solaris. Developers working on terminal-based applications for Solaris will also be affected by this issue.
Comment 1 Pawel Piech CLA 2009-10-28 16:10:54 EDT
Created attachment 150767 [details]
Patch with proposed fix.

The main feature of this patch is a new "console" option to the PTY class.  It tells it whether the PTY is to be used with the console view.  If console==true, the current PTY behavior is preserved (i.e. the PTY is configured for no echo), otherwise the PTY is configured for standard behavior.  The PTY.isConsole() flag is also used by Spawner.exec2(), which if console==true, redirects process's stderr to a pipe as is done now (otherwise it redirects it to the PTY).
The second feature is PTY.setTerminalSize(), which allows PTY master owner to update the terminal size.

The patch does not include binaries, which will need to be built and committed for each platform.
Comment 2 Mirko Raner CLA 2009-10-28 17:09:25 EDT
Thanks for submitting that, Pawel. I hope it gets integrated into the Eclipse code base very promptly, as it would enable us to finish the last couple of steps for bug 196337, so that local terminal access works reasonably.

I originally filed this bug against Solaris, but of course we need to address it for Linux, too. Perhaps we should reset this bug's Platform attribute to All?
Comment 3 Pawel Piech CLA 2009-10-28 18:08:04 EDT
Created attachment 150778 [details]
Build libraries for linux-x86 platform.
Comment 4 Pawel Piech CLA 2009-10-29 18:36:23 EDT
Created attachment 150884 [details]
Updated patch with warnings fixes.

This patch adds fixes from bugs: bug 82744, bug 145737, bug 237611, bug 272364, bug 272370, bug 272373.
Comment 5 Pawel Piech CLA 2009-10-29 18:44:57 EDT
Created attachment 150885 [details]
Updated binaries for linux.x86
Comment 6 Anton Leherbauer CLA 2009-10-30 10:11:50 EDT
(In reply to comment #4)
> Created an attachment (id=150884) [details]
> Updated patch with warnings fixes.
> This patch adds fixes from bugs: bug 82744, bug 145737, bug 237611, bug 272364,
> bug 272370, bug 272373.

Pawel, I think the patch is incomplete.
I don't see the changes from those bugs and the patch also does not seem to address the original problems from comment 0.
I tried the attached linux binaries with the process connector plug-in from bug 196337, but this did not work very well for me.  I connected to 'sh' but there was no echo and output was distorted.
Comment 7 Anton Leherbauer CLA 2009-10-30 10:43:29 EDT
(In reply to comment #6)
> I don't see the changes from those bugs and the patch also does not seem to
> address the original problems from comment 0.

Correction: It looks like the changes from those bugs are included, but some files are missing in the patch.
Comment 8 Pawel Piech CLA 2009-10-30 11:18:09 EDT
(In reply to comment #7)
> Correction: It looks like the changes from those bugs are included, but some
> files are missing in the patch.

Yes, I noticed this last night as well when I tried to apply the patch in a new workspace.  I'll re-generate the patch when I get back to Linux.

(In reply to comment #6)
> I tried the attached linux binaries with the process connector plug-in from bug
> 196337, but this did not work very well for me.  I connected to 'sh' but there
> was no echo and output was distorted.
That's a bummer.  I've been testing with /bin/bash and it looked pretty good.  I'll try 'sh' as well.
Comment 9 Pawel Piech CLA 2009-10-30 12:10:04 EDT
Created attachment 150946 [details]
Binaries for win32.x86.
Comment 10 Pawel Piech CLA 2009-10-30 13:16:30 EDT
Created attachment 150950 [details]
Updated patch with complete file set and aix.

Seems that I also forgot about aix...
Comment 11 Pawel Piech CLA 2009-10-30 13:47:56 EDT
(In reply to comment #6)
> I tried the attached linux binaries with the process connector plug-in from bug
> 196337, but this did not work very well for me.  I connected to 'sh' but there
> was no echo and output was distorted.
I tried 'sh' and it worked for me as well as bash.  Do you see any errors about the PTY library loading?  Are you able to debug PTY and see if the library does get loaded?
Comment 12 Christian Damus CLA 2009-10-30 13:58:11 EDT
(In reply to comment #11)
>
> I tried 'sh' and it worked for me as well as bash.  Do you see any errors about
> the PTY library loading?  Are you able to debug PTY and see if the library does
> get loaded?

Note that sh is often just a symlink to bash.  Do you both have a similar configuration in that respect?
Comment 13 Pawel Piech CLA 2009-10-30 14:08:19 EDT
(In reply to comment #12)
> Note that sh is often just a symlink to bash.  Do you both have a similar
> configuration in that respect?
For me (on Ubuntu 8.04) it's actually a link to dash.  In either case though, if there was no echo there must have been a more serious problem... as in the PTY didn't get created.
Comment 14 Anton Leherbauer CLA 2009-11-05 07:34:51 EST
(In reply to comment #13)
> (In reply to comment #12)
> > Note that sh is often just a symlink to bash.  Do you both have a similar
> > configuration in that respect?
> For me (on Ubuntu 8.04) it's actually a link to dash.  In either case though,
> if there was no echo there must have been a more serious problem... as in the
> PTY didn't get created.

The libpty.so cannot be loaded.  I get an UnsatisfiedLinkError:
Error: .../org.eclipse.cdt.core.linux.x86/os/linux/x86/libpty.so: Can't load IA 32-bit .so on a IA 32-bit platform
The same happens with the libspawner.so.

When I build the libraries locally, it works.
This is on RHEL WS 4 (Update 8).

I'll attach the libraries from my workspace.
Comment 15 Anton Leherbauer CLA 2009-11-05 07:36:19 EST
Created attachment 151409 [details]
linux.x86 binaries built on RHEL WS 4
Comment 16 Anton Leherbauer CLA 2009-11-09 06:35:28 EST
Created attachment 151685 [details]
solaris.sparc binaries built on Solaris 9
Comment 17 Anton Leherbauer CLA 2009-11-09 10:16:40 EST
Created attachment 151698 [details]
Complete source patch with @since tags, javadoc and cosmetics

This patch adds @since tags and javadoc to new API in PTY.java, includes the win32 changes and some cosmetics.
Comment 18 Martin Oberhuber CLA 2010-02-03 08:00:33 EST
CQ:WIND00199002 - scheduled for CDT 7.0m6

Since we don't have a Mac available at Wind River, we will need some Community help for creating spawner binaries and testing on the Mac. Any voluneers?
Comment 19 James Blackburn CLA 2010-02-03 17:21:29 EST
I applied Toni's patch and rebuilt the natives on Mac OS. Unfortunately the problem, as described in comment 0, is still there.  Running through the steps works in a native shell, but fails in a run launch.  I verified that the java was picking up my newly built lib with lsof, and have clean'ed, etc.

Furthermore if I press ctrl-D Eclipse locks up (the native call doesn't appear to return). This happens with or without the patch:

   java.lang.Thread.State: RUNNABLE
	at org.eclipse.cdt.utils.spawner.SpawnerOutputStream.close0(Native Method)
	at org.eclipse.cdt.utils.spawner.SpawnerOutputStream.close(SpawnerOutputStream.java:73)
	at org.eclipse.debug.internal.core.InputStreamMonitor.closeInputStream(InputStreamMonitor.java:151)
	at org.eclipse.debug.internal.core.StreamsProxy.closeInputStream(StreamsProxy.java:120)
Comment 20 Pawel Piech CLA 2010-02-03 18:36:32 EST
(In reply to comment #19)
> I applied Toni's patch and rebuilt the natives on Mac OS. Unfortunately the
> problem, as described in comment 0, is still there.  Running through the steps
> works in a native shell, but fails in a run launch.  I verified that the java
> was picking up my newly built lib with lsof, and have clean'ed, etc.

I assume you were trying this out from the Eclipse Console.  I don't think we can solve the Eclipe console problems and it's not a real terminal.  This patch is mainly to enable a real terminal (from the TM project) to re-use the CDT spawner.  

Would you be able to try the TM terminal connector from bug 196337?  BTW, if it's a popular feature, we could try to use the TM terminal for CDT's GDB integration.  This at least would give a better use case for fixing this bug.
Comment 21 Anton Leherbauer CLA 2010-02-04 04:30:18 EST
Created attachment 158151 [details]
Mac OS patch

I noticed that the Mac OS code does not seem to make the tty the controlling terminal.  This might be the reason why you still see the problems in comment 0.
Could you try again with this patch?
I have no explanation for the blocking native call.  It just does a close(fd).
Comment 22 James Blackburn CLA 2010-02-04 16:02:50 EST
(In reply to comment #21)
> Could you try again with this patch?

Thanks Toni. Unfortunately no luck still. The patch has made a difference - now if I run bash as a run launch, it exits immediately with "return code -1". In the debugger the behaviour seems to the same as the existing jnilibs.
Comment 23 Anton Leherbauer CLA 2010-02-10 10:28:40 EST
Created attachment 158730 [details]
Mac OS second try

There was also a setsid() call missing.  Could you try once more?  This time I am quite confident, otherwise I need a Mac...
Comment 24 James Blackburn CLA 2010-02-11 15:48:50 EST
(In reply to comment #23)
> Created an attachment (id=158730) [details]
> Mac OS second try
> 
> There was also a setsid() call missing.  Could you try once more?  This time I
> am quite confident, otherwise I need a Mac...

It's a bit better Toni, the echo'ing seems to have disappeared. Sadly trying "stty int @" givens an error:

bash-3.2$ stty intr @
bash: [11283: 1] tcsetattr: Inappropriate ioctl for device

[1]+  Stopped                 stty intr @
bash-3.2$ 

Is this expected?
Comment 25 James Blackburn CLA 2010-02-11 15:55:40 EST
(In reply to comment #24)
> It's a bit better Toni, the echo'ing seems to have disappeared. Sadly trying
> "stty int @" givens an error:

Sorry, that's actually a run launch.

In the debugger it looks similar to before:
bash-3.2$ stty intr @
stty intr @
bash-3.2$ cat > foo
cat > foo


@
@
Comment 26 Anton Leherbauer CLA 2010-02-12 07:11:19 EST
(In reply to comment #24)
> (In reply to comment #23)
> > Created an attachment (id=158730) [details] [details]
> > Mac OS second try
> > 
> > There was also a setsid() call missing.  Could you try once more?  This time I
> > am quite confident, otherwise I need a Mac...
> 
> It's a bit better Toni, the echo'ing seems to have disappeared. Sadly trying
> "stty int @" givens an error:
> 
> bash-3.2$ stty intr @
> bash: [11283: 1] tcsetattr: Inappropriate ioctl for device
> 
> [1]+  Stopped                 stty intr @
> bash-3.2$ 
> 
> Is this expected?

Thanks for trying again.  This error is due to the fact that in console mode stderr is not associated with the tty (Mirko mentioned this already in comment#0).
I concentrated my test on the real tty mode in the terminal view so that I missed that problem (which exists on linux and solaris too).
I guess in console mode we need to keep the setpgid() call instead of the setsid() to restore the current behavior.
Comment 27 Anton Leherbauer CLA 2010-02-12 08:30:25 EST
Created attachment 158976 [details]
Mac OS last try

James, could you give this patch one more try?  This should keep the current behavior for console mode, i.e. all limitations of comment#0 are still present, but there should be no regression.

I built and tested on linux-x84, linux-x86_64 and solaris-sparc and verified that it works there.
Comment 28 James Blackburn CLA 2010-02-14 17:26:04 EST
(In reply to comment #27)
> James, could you give this patch one more try?  

I have done, and the issue in comment 24 is gone.

Unfortunately, even using the local program connector from bug 196337, I'm unable to make it handle crtl-C or some other set interrupt signal.  In fact the behaviour seems equivalent to the currently checked in mac os x libs :s
Comment 29 Anton Leherbauer CLA 2010-02-15 03:31:38 EST
(In reply to comment #28)
> (In reply to comment #27)
> > James, could you give this patch one more try?  
> 
> I have done, and the issue in comment 24 is gone.

Phew.

> Unfortunately, even using the local program connector from bug 196337, I'm
> unable to make it handle crtl-C or some other set interrupt signal.  In fact
> the behaviour seems equivalent to the currently checked in mac os x libs :s

If you tried with Mirko's latest patch, this is to be expected.  It does not yet use the new API.  It should work with Pawel's local program connector, though.
I just noticed that Pawel's "Updated terminal process plugin" attachment is actually a CDT patch, but you can use the obsoleted attachment at https://bugs.eclipse.org/bugs/attachment.cgi?id=150775 instead.

Thanks for your patience!
Comment 30 James Blackburn CLA 2010-02-15 15:19:38 EST
Created attachment 159125 [details]
Mac OS 'last try' binaries

(In reply to comment #29)
> Thanks for your patience!

Phew, looks good using Pawel's Process connection type.

Binaries attached, built on 10.6.2:
Macintosh-9:os james$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646.1~2/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1 --host=i686-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)
Comment 31 Mirko Raner CLA 2010-02-16 01:02:04 EST
Thanks for working on this guys! I didn't have a chance to try it out yet, but I'm looking forward to seeing your efforts become a part of Eclipse!
Comment 32 Anton Leherbauer CLA 2010-02-16 03:26:18 EST
(In reply to comment #30)
> Phew, looks good using Pawel's Process connection type.

Excellent.  I think we are finally ready to commit the changes and binaries for following platforms:

- linux.x86
- linux.x86_64
- solaris.sparc
- macosx
- win32

All other platforms will stay unchanged and thus will not support the new API, but should still be functional as before, ie. the libraries should still link successfully (At least this is what I can confirm for linux and solaris).

If anybody bothers to build and test for other platforms, please attach source patch and binaries ASAP.
Comment 33 Martin Oberhuber CLA 2010-02-16 03:44:27 EST
(In reply to comment #32)
> All other platforms will stay unchanged and thus will not support the new API,
> but should still be functional as before

Just wondering, what does "not support the new API" mean in practice? 

From a quick look at the code, it seems that a plain Java client which
calls the new API

   PTY#setTerminalSize(int,int)

on a Platform which still runs the old native libs will run into a NoSuchMethodError. I think that this should be documented as an @throws clause in the method's Javadoc. Catching the error and handling it somehow may be another option. 

Throwing an unchecked exception seems OK to me in the interest of keeping things simple, but I do think that the behavior on an unsupported PLatform should be documented.
Comment 34 Anton Leherbauer CLA 2010-02-16 04:23:10 EST
(In reply to comment #33)
> From a quick look at the code, it seems that a plain Java client which
> calls the new API
> 
>    PTY#setTerminalSize(int,int)
> 
> on a Platform which still runs the old native libs will run into a
> NoSuchMethodError. I think that this should be documented as an @throws clause
> in the method's Javadoc. Catching the error and handling it somehow may be
> another option. 

This will cause an UnsatisfiedLinkError.  I suggest to catch the error and log it once per session.

> Throwing an unchecked exception seems OK to me in the interest of keeping
> things simple, but I do think that the behavior on an unsupported PLatform
> should be documented.

I don't even know the state of current pty support on all different platforms, but I'll add a comment to setTerminalSize() and the new constructor.
Comment 35 Anton Leherbauer CLA 2010-02-16 08:27:38 EST
Created attachment 159173 [details]
Final source patch (Java + C) for linux, solaris and macosx
Comment 36 Anton Leherbauer CLA 2010-02-16 08:30:35 EST
Created attachment 159174 [details]
Binaries for linux (x86, x86_64) and solaris
Comment 37 Anton Leherbauer CLA 2010-02-17 07:05:06 EST
Committed to HEAD.
Special thanks to Mirko, Pawel and James.
Comment 38 Pawel Piech CLA 2010-02-17 11:25:28 EST
(In reply to comment #37)
> Committed to HEAD.
> Special thanks to Mirko, Pawel and James.

Thank you Toni!  

BTW, if bug 196337 is fixed in TM, CDT could support redirecting of debugee process output to a true terminal rather than the standard console.
Comment 39 Mirko Raner CLA 2010-04-24 18:26:52 EDT
I'm having trouble loading the CDT 7.0.0 M6 native library for this (I'm using Mac OS X 10.5.8):
http://www.eclipse.org/forums/index.php?t=msg&th=166981
Please leave a comment if you have any insight on this. Thanks!
Comment 40 Anton Leherbauer CLA 2010-04-28 07:04:29 EDT
(In reply to comment #39)
> I'm having trouble loading the CDT 7.0.0 M6 native library for this (I'm using
> Mac OS X 10.5.8):
> http://www.eclipse.org/forums/index.php?t=msg&th=166981
> Please leave a comment if you have any insight on this. Thanks!

James built the libs on 10.6.2 (comment 30).  Maybe that's the problem?
You could try and build the libraries on your Mac.  They should work on later version as well, I guess.
Comment 41 Mirko Raner CLA 2010-04-29 03:05:24 EDT
Created attachment 166435 [details]
Mac OS 10.5.8 binaries

Indeed, there seems to be a problem running Mac OS X 10.6 binaries on a 10.5 system. The 10.6 binaries contain a new 10.6-specfic load command, LC_DYLD_INFO_ONLY (0x80000022). I compiled the latest sources locally, replaced the *.jnilib files in org.eclipse.cdt.core.macosx_5.2.0.201003151310.jar, and restarted Eclipse with -clean, and the libraries were loaded without any problem.

I assume that Mac OS 10.6 is fully backwards compatible and that the 10.5 libraries would also work on 10.6. If someone can verify that the attached libraries (compiled on 10.5.8) are fine on 10.6 as well then I would suggest to use the 10.5 binaries instead of the 10.6 ones.
Comment 42 Mirko Raner CLA 2010-04-29 03:32:45 EDT
On my Mac OS X 10.5.8 system, I see problem #2 (from comment #0) fixed, but not problem #1. Without redefining the interrupt character, when I press Command-C while executing the cat command I just see "^C" being printed to the terminal, but no interrupt being triggered. Similar, after issuing an "stty intr @", I just see "@" characters printed.
I'm using the local terminal connector from bug 196337 with the patch for bug 310376.

My terminal settings seem to be all right:

bash-3.2$ stty -a
speed 9600 baud; 0 rows; 0 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr igncr ixon -ixoff ixany imaxbel iutf8
        -ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
        -dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
        stop = ^S; susp = ^Z; time = 0; werase = ^W;

I also checked the signal handlers by sending SIGINTs manually. When I send a SIGINT to the shell itself nothing happens (not sure whether that's okay or not); when I send a SIGINT to the child process (i.e., cat) it terminates, but I get a warning like

bash: [7244: 2] tcsetattr: Inappropriate ioctl for device

The warning does not occur when sending SIGINT to other long-running processes (I ran a "find /" to test).

In other words, on Mac OS 10.5.8 I still don't see full terminal functionality with the local terminal connector. Does anyone know how and where exactly a Ctrl-C key press is turned into an interrupt signal and what other tests would be helpful to debug why Ctrl-C doesn't work properly?
Comment 43 Anton Leherbauer CLA 2010-04-29 04:44:49 EDT
(In reply to comment #42)
> bash: [7244: 2] tcsetattr: Inappropriate ioctl for device

This would indicated that stderr is not connected to the pty.
This is expected behavior in console (non-terminal) mode.  Are you sure you have used PTY(false)?
Comment 44 Mirko Raner CLA 2010-05-01 00:34:29 EDT
(In reply to comment #43)
> Are you sure you have used PTY(false)?

Oops, my fault. Sorry for the false alarm. I had made the change, but in my launch configuration I accidentally picked up the bundle from the development platform, not from the workspace. So please disregard comment #42.
I should probably stop working on this stuff so late at night ;-)

However, it does look like the binaries shipped with CDT 7.0.0 M6 will only run on Mac OS 10.6.

James (or someone else running 10.6), can you verify that the binaries that I supplied in attachment #166435 [details] also work on Mac OS 10.6? If they work I would suggest that we replace the current binaries with the 10.5 ones.
Comment 45 James Blackburn CLA 2010-05-01 07:53:48 EDT
(In reply to comment #44)
> James (or someone else running 10.6), can you verify that the binaries that I

Thanks Mirko, I did some simple tests, and I can load and use the libraries fine on 10.6 x86. 
Have committed, should be part of Monday's M7 build.