bugMIT/GNU Scheme - Bugs: bug #18079, setting the controlling tty of...

 
 

bug #18079: setting the controlling tty of pty-based subprocesses fails on Mac OS X

Submitted by:  Taylor R. Campbell <riastradh>
Submitted on:  Sat 21 Oct 2006 09:52:08 PM UTC  
 
Category: microcodeSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect behavior
Status: FixedPrivacy: Public
Assigned to: Chris Hanson <cph>Originator Name: 
Open/Closed: Closed
Keywords: 

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 29 Oct 2006 05:55:38 PM UTC, comment #4:

Turns out that the main problem was that the select code was broken: it was passing the number of file descriptors, not one greater than the highest one. After fixing that and using fork instead of vfork, it seems to work now.

Taylor R. Campbell <riastradh>
Project Member
Sun 22 Oct 2006 02:30:19 AM UTC, comment #3:

After a little more poking about, and grovelling through the xnu (Darwin kernel) source code, it seems that the call to setsid prior to all this is failing because the kernel refuses to make a session leader of any process created by vfork. I'm not sure why this is, so I'll ask some Darwin wizards about it.

Taylor R. Campbell <riastradh>
Project Member
Sun 22 Oct 2006 01:57:32 AM UTC, comment #2:

Never mind, I found the online docs.

Chris Hanson <cph>
Project AdministratorIn charge of this item.
Sun 22 Oct 2006 12:11:39 AM UTC, comment #1:

Is there any programming documentation for OS X available on the web? I'll need to see the details of this interaction to figure out what to do.

Chris Hanson <cph>
Project AdministratorIn charge of this item.
Sat 21 Oct 2006 09:52:08 PM UTC, original submission:

The ioctl command TIOCSCTTY consistently fails for me (line 355 in uxproc.c of the old microcode, line 347 of the new microcode), setting errno to 1, and the child process immediately exits with a status code of 1 if anything fails when setting it up.

GNU Emacs ignores the return value of ioctl with the TIOCSCTTY, but if I modify the code to do that, the subsequent call to tcsetpgrp loses. I'm not enough of a Unix terminal wizard to understand what's going on in any more depth, so I'm not sure what to do from here.

This lossage means that, although most programmatic subprocesses (through pipes) will work, inferior subprocesses (e.g., comint) under Edwin won't.

I tested this on OS X/x86 10.4.6; I've also observed it on OS X/PPC 10.4.somethingorother, although I haven't tested tweaking the code specifically on that platform.

Taylor R. Campbell <riastradh>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 29 Oct 2006 05:55:38 PM UTCriastradhStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Sun 22 Oct 2006 12:11:39 AM UTCcphAssigned toNone=>cph

Back to the top


Powered by Savane 3.1-cleanup1