Subject: Re: kern/32682: netbsd-3 ptyfs intermittent failure with Matlab
To: Christos Zoulas <christos@zoulas.com>
From: Hauke Fath <hf@spg.tu-darmstadt.de>
List: netbsd-bugs
Date: 07/17/2006 16:54:30
Am 31.01.2006 um 12:52 Uhr -0500 schrieb Christos Zoulas:
>
>Can you show what w(1) prints and the "interesting" ptys in /dev/[pt]ty??.
>I suspect what is going on, is that you have a rogue program that is
>opening old style pty's behind the pty subsystem's back, so when ptyfs
>tries to open the same pty, it fails. So when it fails for pts/4 for
>example, what does lsof say for /dev/{t,p}typ4?

Getting back to this after a while...

I have pkgsrc-2006Q1 packages out now which were built on a machine 
without the /dev/[pt]ty[pqrs]? pty device files, and deployed on 
clients that do not have them, either, but use ptyfs mounted to 
/dev/pts instead.

But I still see matlab failing to open a /dev/pts/? every now and 
then, although the /dev/ptmx && /dev/pts/? way should be the only way 
to get a pty on the machine now, so no concurrent access, right?

The details:

[ kdump | tail ...]

  25589 MATLAB   CALL  open(0xb9f56725,0x8002,0)
  25589 MATLAB   NAMI  "/emul/linux/dev/ptmx"
  25589 MATLAB   NAMI  "/dev/ptmx"
  25589 MATLAB   RET   open 8
  25589 MATLAB   CALL  ioctl(8,_IO('T',0x1,0),0xbfbf537c)
  25589 MATLAB   RET   ioctl 0
  25589 MATLAB   CALL  ioctl(8,_IOW('T',0x30,0x4),0xbfbf54ac)
  25589 MATLAB   GIO   fd 8 read 40 bytes
        "\^D\0\0\0\^D\0\0\0/dev/null\0\0\0\0\0\0\0/dev/pts/4\0\0\0\0\0\0"
  25589 MATLAB   RET   ioctl 0
  25589 MATLAB   CALL  stat64(0xbfbf54fc,0xbfbf5434)
  25589 MATLAB   NAMI  "/emul/linux/dev/pts/4"
  25589 MATLAB   NAMI  "/dev/pts/4"
  25589 MATLAB   RET   stat64 0
  25589 MATLAB   CALL  statfs(0xbfbf54fc,0xbfbf64fc)
  25589 MATLAB   NAMI  "/emul/linux/dev/pts/4"
  25589 MATLAB   NAMI  "/dev/pts/4"
  25589 MATLAB   RET   statfs 0
  25589 MATLAB   CALL  ioctl(8,_IOR('T',0x31,0x4),0xbfbf6538)
  25589 MATLAB   RET   ioctl -1 errno -22 Invalid argument
  25589 MATLAB   CALL  ioctl(8,_IO('T',0x1,0),0xbfbf63ec)
  25589 MATLAB   RET   ioctl 0
  25589 MATLAB   CALL  ioctl(8,_IOW('T',0x30,0x4),0xbfbf651c)
  25589 MATLAB   GIO   fd 8 read 40 bytes
        "\^D\0\0\0\^D\0\0\0/dev/null\0\0\0\0\0\0\0/dev/pts/4\0\0\0\0\0\0"
  25589 MATLAB   RET   ioctl 0
  25589 MATLAB   CALL  stat64(0xbd3d5810,0xbfbf64a4)
  25589 MATLAB   NAMI  "/emul/linux/dev/pts/4"
  25589 MATLAB   NAMI  "/dev/pts/4"
  25589 MATLAB   RET   stat64 0
  25589 MATLAB   CALL  rt_sigaction(0x11,0xbfbf6218,0xbfbf618c,8)
  25589 MATLAB   RET   rt_sigaction 0
  25589 MATLAB   CALL  rt_sigprocmask(1,0xbfbf6390,0,8)
  25589 MATLAB   RET   rt_sigprocmask 0
  25589 MATLAB   CALL  open(0xba99b2d0,0x8002,0)
  25589 MATLAB   NAMI  "/emul/linux/dev/pts/4"
  25589 MATLAB   NAMI  "/dev/pts/4"
  25589 MATLAB   RET   open -1 errno -13 Permission denied
  25589 MATLAB   CALL  rt_sigprocmask(1,0xbfbf0350,0,8)
  25589 MATLAB   RET   rt_sigprocmask 0
  25589 MATLAB   CALL  kill(0x63f5, SIGABRT)
  25589 MATLAB   RET   kill 0
  25589 MATLAB   PSIG  SIGABRT SIG_DFL
  25589 MATLAB   NAMI  "MATLAB.core"
  14493 MATLAB   RET   poll 0
  14493 MATLAB   CALL  getppid
  14493 MATLAB   RET   getppid 1
  14493 MATLAB   CALL  kill(0x572a, SIGKILL)
  14493 MATLAB   RET   kill -1 errno -3 No such process
  14493 MATLAB   CALL  kill(0x1543, SIGKILL)
  14493 MATLAB   RET   kill 0
   5443 MATLAB   RET   nanosleep -1 errno -4 Interrupted system call
   5443 MATLAB   PSIG  SIGKILL SIG_DFL
  14493 MATLAB   PSIG  SIGRT1 caught handler=0xbd4be460 
mask=(1,2,3,4,6,8,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,30,31,32,33))
  14493 MATLAB   CALL  sigreturn(0x80a1ec0)
  14493 MATLAB   RET   sigreturn -1 errno -2 No such file or directory
  14493 MATLAB   CALL  exit_group(0)


[hf@Auernig] /<1>tmp/matlab-issues > uname -a
NetBSD Auernig.nt.e-technik.tu-darmstadt.de 3.0_STABLE NetBSD 
3.0_STABLE (SPG_PIII) #0: Wed May 31 13:18:31 CEST 2006 
hf@Gstoder.nt.e-technik.tu-darmstadt.de:/var/obj/netbsd-builds/3_0/i386/sys/arch/i386/compile/SPG_PIII 
i386
[hf@Auernig] /<1>tmp/matlab-issues > ls -la /dev/pts/
total 31
dr-xr-xr-x  1 root     wheel    512 Jun 23 03:15 .
drwxr-xr-x  5 root     wheel  30720 Jul 12 03:32 ..
crw--w----  1 ruebsam  tty     5, 0 Jun 22 09:04 0
crw--w----  1 ruebsam  tty     5, 1 Jul 17 16:25 1
crw-------  1 ruebsam  tty     5, 2 Jul 17 14:15 2
crw--w----  1 hf       tty     5, 3 Jul 17 16:28 3
[hf@Auernig] /<1>tmp/matlab-issues > ls -la /dev/[pt]ty??
crw-rw----  1 uucp  persons   8, 0 Jun 16  2005 /dev/tty00
crw-------  1 uucp  wheel     8, 1 Jun 16  2005 /dev/tty01
crw-------  1 uucp  wheel     8, 2 Jun 16  2005 /dev/tty02
crw-------  1 uucp  wheel     8, 3 Jun 16  2005 /dev/tty03
crw-------  1 root  wheel    47, 0 Jun 23 03:15 /dev/ttyE0
crw-------  1 root  wheel    47, 1 Jun 23 03:15 /dev/ttyE1
crw-------  1 root  wheel    47, 2 Jun 23 03:15 /dev/ttyE2
crw-------  1 root  wheel    47, 3 Jun 23 03:15 /dev/ttyE3
crw-------  1 root  wheel    47, 4 Jun 16  2005 /dev/ttyE4
crw-------  1 root  wheel    47, 5 Jun 16  2005 /dev/ttyE5
crw-------  1 root  wheel    47, 6 Jun 16  2005 /dev/ttyE6
crw-------  1 root  wheel    47, 7 Jun 16  2005 /dev/ttyE7
crw-rw----  1 uucp  persons   8, 0 Apr 20 03:28 /dev/ttyU0
crw-------  1 uucp  wheel    66, 1 Jun 16  2005 /dev/ttyU1
[hf@Auernig] /<1>tmp/matlab-issues > w
  4:33PM  up 25 days,  7:31, 3 users, load averages: 2.23, 2.33, 2.22
USER     TTY     FROM              LOGIN@  IDLE WHAT
ruebsam  :0      -                 8:30AM     ? /bin/sh /usr/pkg/bin/startkde
ruebsam  pts/1   :0.0              9:07AM     7 -tcsh
hf       pts/3   localhost:10.0    3:55PM     0 w
[hf@Auernig] /<1>tmp/matlab-issues >


The complete ktrace and the matlab core are at
http://www.spg.tu-darmstadt.de/~hf/netbsd/pr32682/matlab-issues.tar.bz2

	hauke

-- 
/~\  The ASCII Ribbon Campaign                    Hauke Fath
\ /    No HTML/RTF in email	        Institut für Nachrichtentechnik
  X     No Word docs in email	                  TU Darmstadt
/ \  Respect for open standards              Ruf +49-6151-16-3281