Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!decwrl!hplabs!hplabsc!daemon From: wpl@burdvax.prc.unisys.com (William P Loftus) Newsgroups: comp.mail.elm Subject: BSD Segmentation fault bug with fix Message-ID: <1844@hplabsc.HP.COM> Date: Mon, 18-May-87 10:44:26 EDT Article-I.D.: hplabsc.1844 Posted: Mon May 18 10:44:26 1987 Date-Received: Tue, 19-May-87 04:09:09 EDT Sender: daemon@hplabsc.HP.COM Reply-To: wpl@burdvax.prc.unisys.com (William P Loftus) Organization: Unisys/Paoli Research Center, Paoli, PA Lines: 54 Approved: taylor@hplabs (with 'postmail') I'm not sure if this is the same segmentation fault other people using ELM on BSD (Sun) machines, but it is one cause. BUG: if you have "copy = ON" in your .elmrc, and you invoke elm: % elm wpl After sending the mail elm would crash with a segmentation fault. The problem was in savecopy.c at lineline 82 of 180: --- if ((errno = can_open(savename, WRITE_ACCESS))) { dprint(2, (debugfile, "Error: attempt to autosave to a file that can't be appended to!\n")); dprint(2, (debugfile, "\tfilename = \"%s\"\n", savename)); dprint(2, (debugfile, "** %s - %s **\n", error_name(errno), error_description(errno))); error1("permission to append to %s denied!", savename); sleep(2); return(FALSE); } --- The parameter WRITE_ACCESS in the call to can_open is wrong. can_open expects the second parameter to be a char* not an integer as WRITE_ACCESS is. The fix is to replace WRITE_ACCESS with "a" as done in the following code: --- if ((errno = can_open(savename, "a"))) { dprint(2, (debugfile, "Error: attempt to autosave to a file that can't be appended to!\n")); dprint(2, (debugfile, "\tfilename = \"%s\"\n", savename)); dprint(2, (debugfile, "** %s - %s **\n", error_name(errno), error_description(errno))); error1("permission to append to %s denied!", savename); sleep(2); return(FALSE); } --- Hope this helps someone. BTW, ELM 1.5b works fine for me now... -- William P Loftus UUCP: wpl@burdvax.UUCP Unisys/Paoli Research Center ARPA: wpl@burdvax.prc.unisys.com PO Box 517 BITNET: 202527899@VUVAXCOM Paoli, PA 19301 215-648-7222 (work) 215-649-0633 (home)