Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!nrl-cmf!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Strange C Program Message-ID: <7340@brl-smoke.ARPA> Date: 25 Feb 88 10:23:05 GMT References: <238@mccc.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <238@mccc.UUCP> pjh@mccc.UUCP (Peter J. Holsberg) writes: >generates "EMT trap - core dumped" message, but when run by ROOT, it >works like a charm! Help!! > of = fopen("random", "w"); > fprintf(of, "%11d",fseed); Really, posting to the net is an expensive (to others!) way to do your debugging. The only reason I'm responding is to make the point that the total absence of any error checking in your code has made it extremely non-robust. My suspicion is that for some reason you're not able to create the file "random" for writing (perhaps there is already one present owned by "root" and not publicly writable?). The use in fprintf() of the NULL `of' value that you should have checked for right after the fopen() can have strange results. You should learn how to use the debugger(s) on your system; in particular a function call traceback would show whether or not the problem occurred inside fprintf(), and it would also show what arguments the function received.