Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!sun-spots-request From: sdl!monet!gregt@uunet.uu.net (Greg Tusar) Newsgroups: comp.sys.sun Subject: STREAMS tty driver problems.. Keywords: Miscellaneous Message-ID: <2916@brazos.Rice.edu> Date: 8 Nov 89 00:17:59 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 66 Approved: Sun-Spots@rice.edu X-Refs: Related: v8n179 X-Sun-Spots-Digest: Volume 8, Issue 192, message 8 of 14 I'm in the process of writing a STREAMS tty driver, and I'm having a rather tough time of it. The driver is for an Omnibyte OB68K board which sits in a Sun 4/260 (SunOS 4.0.3).. The specific problem that I've run up against is that when a port is closed, and the stream is getting dismantled, something in qdetach() generates a data fault... My close routine is nowhere in the call stack trace. The actual call stack trace looks like this : physmem ffd $c _panic(0xf80cce23,0x0,0x3e8,0x1e84800,0x0,0x0) + 7c _trap(0x9,0xffffeb64,0x0,0x80,0x1,0xc50) + 1c8 fault(0x0,0x0,0xf80e4db8,0xf8132200,0x9f,0x439) + 64 _qdetach(0xff058898,0x1,0x0,0x400ce4,0x4000e4,0x0) + 58 _strdismantle(0xf80e4db8,0x2,0x0,0x4000e5,0xff058874,0x0) + fc _strclose(0xff13020c,0x2,0xa20,0x900,0xf80c91cc,0xf80e4db8) + 70 _spec_close(0xff130208,0xff13020c,0xff130208,0x4801,0x4801,0x4801) + 160 _vn_close(0xff13020c,0x2,0x1,0x29ab0,0xe12c,0x0) + 1c _vno_close(0xf81244ac,0xf80d4800,0x4,0xf80e4db8,0x1,0xff13020c) + 3c _closef(0xf81244ac,0x400fa4,0x1000,0xf8127f84,0x408001,0x13) + 84 _close(0xffffefe0,0xf80c4448,0xf80c4448,0xfffff608,0xf81244ac,0xfffff705) + 94 _syscall(0x8000000) + 2d0 0xf80cce23/s _sizestr+0xbf: Data fault So I guess I have some configuration problem, but I can't find it, and we don't have a source license. My question is, does anyone know what in particular qdetach() takes apart? Is the fault generated by qdetach trying to call my close routine through some structure I haven't initialized properly? Most of the stuff like qinit, module_info and streamtab structures were lifted directly from the Sun Driver Ed. manual. Sun hasn't been a great source of information, one of their support group told me "We just adopted it from System V, and no one here really knows anything about it.." The STREAMS driver section of the driver manual itself was stolen directly from the Systen V manuals. This is really begining to bother me. If Sun supplants the old tty notion with STREAMS, it really shouldn't be this mysterious.. Has anyone else had any bad experiences related to this? ANY hints or suggestions about the qdetatch routine would be GREATLY appreciated. My STREAMS structs look like this... static struct module_info rminfo = { /* read side */ 0, "ob", 0, INFPSZ, 150, 50 }; static struct module_info wminfo = { /* write side */ 0, "ob", 0, INFPSZ, 150, 50 }; static struct qinit rinit = { obrput, NULL, obopen, obclose, NULL, &rminfo, NULL }; static struct qinit winit = { obwput, NULL, NULL, NULL, NULL, &wminfo, NULL }; struct streamtab obinfo = { &rinit, &winit, NULL, NULL, NULL }; thanks, greg tusar