From owner-freebsd-emulation Wed Sep 4 4: 9:29 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3EAA737B400 for ; Wed, 4 Sep 2002 04:09:25 -0700 (PDT) Received: from mailgate.Cadence.COM (mailgate.Cadence.COM [158.140.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0DB743E42 for ; Wed, 4 Sep 2002 04:09:24 -0700 (PDT) (envelope-from dmlb@dmlb.org) Received: from exmbx01camb.global.cadence.com (exmbx01camb.Cadence.COM [194.32.100.67]) by mailgate.Cadence.COM (8.9.3/8.9.3) with ESMTP id EAA10632; Wed, 4 Sep 2002 04:09:21 -0700 (PDT) Received: from pc598cam ([194.32.96.109]) by exmbx01camb.global.cadence.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 4 Sep 2002 12:11:15 +0100 Message-ID: <001b01c25403$c65353e0$6d6020c2@pc598cam> From: "Duncan Barclay" To: "John E Hein" Cc: "Mark Santcroos" , References: <20020904020952.GB7157@dhcp01.pn.xcllnt.net><20020904064620.GA713@laptop.6bone.nl><000801c253f7$2cae8ea0$6d6020c2@pc598cam> <15733.59121.143526.699051@brain.timing.com> Subject: Re: TIOCSCTTY not implemented in linuxulator? Date: Wed, 4 Sep 2002 12:11:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 04 Sep 2002 11:11:15.0492 (UTC) FILETIME=[C9135E40:01C25403] X-Received: By mailgate.Cadence.COM as EAA10632 at Wed Sep 4 04:09:21 2002 Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org From: "John E Hein" Sent: Wednesday, September 04, 2002 11:56 AM [sorry about quoting/format, using outlook at ${REALJOB}] > Duncan Barclay wrote at 10:40 +0100 on Sep 4: > > > Hi Duncan, > > > > > > Can you find out (ktrace) to which devices it is sending these ioctls? > > > > It's the tty side of a pty/ttp pair. Matlab spawns a subprocess, and it's > > the subprocess that issues these ioctls. > > See this freebsd-emulation thread ("can't quit matlab"): > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=2 06ec3e38e06e5d2&seekm=15218.39637.311548.512594_localhost.econ.vt.edu%40ns.s ol.net#link1 > > Note that the 540e is TIOCSCTTY: > > /usr/src/linux-2.2.19/include/asm-i386/ioctls.h:#define TIOCSCTTY 0x540E > > Particularly look at the 3rd message in the thread that talks about the > /dev/ptmx workaround and unix98 ptys. > If someone could solve this, it'd be great. > Yup, this is the problem I'm trying to solve. Exiting without using the /dev/ptmx problem. ktrace output on spawned matlab process. 54357 matlab_helper NAMI "/compat/linux/dev/ttyp2" 54357 matlab_helper NAMI "/dev/ttyp2" 54357 matlab_helper RET linux_newstat 0 54357 matlab_helper CALL setsid 54357 matlab_helper RET setsid 54357/0xd455 54357 matlab_helper CALL linux_open(0xbfbfed58,0x2,0x60) 54357 matlab_helper NAMI "/compat/linux/dev/ttyp2" 54357 matlab_helper NAMI "/dev/ttyp2" 54357 matlab_helper RET linux_open 4 54357 matlab_helper CALL linux_ioctl(0x4,TIOCSER_TEMT,0x8049362) 54357 matlab_helper RET linux_ioctl -1 errno 22 Invalid argument 54357 matlab_helper CALL linux_ioctl(0x4,TIOCSER_TEMT,0x8049367) 54357 matlab_helper RET linux_ioctl -1 errno 22 Invalid argument 54357 matlab_helper CALL linux_ioctl(0x4,TIOCSCTTY,0x8049362) 54357 matlab_helper RET linux_ioctl -1 errno 22 Invalid argument 54357 matlab_helper CALL getpgrp 54357 matlab_helper RET getpgrp 54357/0xd455 54357 matlab_helper CALL linux_ioctl(0x4,TIOCSPGRP,0xbfbfecb4) 54357 matlab_helper RET linux_ioctl 0 54357 matlab_helper CALL read(0,0xbfbfecfc,0x4) [end of trace] Trying to quit matlab causes it to hang, kill -9 works. If I start matlab with /usr/local/bin/matlab -glnx86 -nosplash -nodesktop so I get matlab running in a terminal, after the kill -9, the terminal doesn't receive keyboard input. Adding case LINUX_TIOCSCTTY: args->cmd = TIOCSCTTY; return (ioctl(p, (struct ioctl_args *)args)); to /sys/compat/linux/linux_ioctl.h, correctly restores the terminal but does not fix the exit problem itself. i.e. kill -9 is still needed. Duncan ________________________________________________________________________ Duncan Barclay | God smiles upon the little children, dmlb@dmlb.org | the alcoholics, and the permanently stoned. dmlb@freebsd.org| Steven King ________________________________________________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message