Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!IRIS.KTH.DK!operator From: operator@IRIS.KTH.DK (Martin Liversage) Newsgroups: comp.sys.sgi Subject: Re: news_server dies on VGX dropping core Message-ID: <9102060912.AA18739@iris.kth.dk> Date: 6 Feb 91 09:12:23 GMT References: <4291@ns-mx.uiowa.edu> Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 43 In article <4291@ns-mx.uiowa.edu> randy frank writes: > Running a program which seems to run fine on GTX and PI 4Ds. Program > uses four shared memory segments (Two are 2K, one is 64K, and the fourth > is ~16M). Program is actually three programs. Each is spawned via system(). > Each has its own graphics window(s). A total of 5 windows are used when the > programs run. There is a launcher program which sits in the background > until one of the programs stop. Then it waits for all others to detach > from shared memory and it takes control. Problem: news_server drops core > when the programs try to quit. I just want to point out that the NeWS server uses a shared memory segment (at least on my machine: 4D/20, IRIX 3.2). It has a shared memory id of 0 and has permission 0555 (so anyone can write to it). Programming in C it is very easy to forget to initialize a variable, and if it has storage class static or extern it will be initialized to 0. Maybe your program by mistake attaches to segment 0 and writes to it. This will cause the NeWS server to bomb, but you will probably discover that the behaviour in general will be erratic. There is probably also a difference between different hardware platforms in how the shared memory segment is used causing you program to behave differently on different machins. I once made this mistake and my machine went on crashing in strange ways all day long until I solved the problem. I think that this shared memory segment writable by anyone is pretty dangerous to programmers fiddling with shared memory (but giving it an id of 0 is inviting for real trouble). Hope this helps. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \ \ Martin Liversage 8616 m /\ \ \ Royal Dental College Copenhagen / \_ K2 - Mountain of Fate \ \ Department of Pediatric Dentistry / \ \ and Dreams \ \ Norre Alle 20 / | | \ \ \ DK-2200 Kobenhavn N /\ | \ \ \ \ +45 31 37 17 00 - 4276 / \ ^ | \ \ \ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\