From owner-freebsd-bugs Fri Oct 27 10:16:51 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id KAA05699 for bugs-outgoing; Fri, 27 Oct 1995 10:16:51 -0700 Received: from rocky.sri.MT.net (sri.MT.net [204.94.231.129]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id KAA05675 for ; Fri, 27 Oct 1995 10:16:45 -0700 Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id LAA04338; Fri, 27 Oct 1995 11:18:55 -0600 Date: Fri, 27 Oct 1995 11:18:55 -0600 From: Nate Williams Message-Id: <199510271718.LAA04338@rocky.sri.MT.net> To: kedron@tribe.com (Kedron Wolcott) Cc: bugs@freebsd.org Subject: Re: 2.0.5 mktemp bug. In-Reply-To: <199510271707.KAA08844@tribe.com> References: <199510271707.KAA08844@tribe.com> Sender: owner-bugs@freebsd.org Precedence: bulk > Sorry about not filing this report with the send-pr command, but I'm just > learning Unix now and I don't have the mail program up. > > However, I do think this is a bug. The program > > --------- > #include > > void > main ( void ) > { > mktemp( "/tmp/tmp.XXXX" ); > } > --------- > > gives me a bus-error core dump. As well it should. This is the exepected behavior. From the manpage. The mktemp() function takes the given file name template and overwrites a portion of it to create a file name. The routine is attempting to write to a constant string, which it can't so it cores. You need to give a writeable memory location to mktemp(). Nate