*BSD News Article 39937


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!pipex!uunet!sawmill!sawmill!rjk
From: rjk@sparcmill.grauel.com (Richard J Kuhns)
Subject: possible execl() bug in FreeBSD 2.0
Message-ID: <RJK.94Dec28105837@sparcmill.grauel.com>
Followup-To: comp.os.386bsd.bugs
Sender: root@sawmill.uucp (Admin (csh))
Nntp-Posting-Host: sparcmill
Organization: Grauel Enterprises, Inc.
Date: 28 Dec 1994 15:58:37 GMT
Lines: 57

After switching to FreeBSD v2.0 (installed from the Walnut Creek CDRom), I
could no longer access the cartridge tape drive on another machine on our
local net using (GNU)tar, as follows:

freebsd:~/Src/tar-1.11.2$ ./tar -tvf sparcmill:/dev/rmt/0
./tar: ready to try pipe
./tar: ready to fork
./tar: ready to try execl
./tar: can't open sparcmill:/dev/rmt/0 : Input/output error
freebsd:~/Src/tar-1.11.2$ 

--I added the `ready to' messages because the core file that was left wasn't
very useful:

freebsd:~/Src/tar-1.11.2$ gdb ./tar ./tar.core
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.11 (i386-unknown-freebsd), Copyright 1993 Free Software Foundation, Inc...
Core was generated by `tar'.
Program terminated with signal 11, Segmentation fault.
#0  0x804b986 in end ()
(gdb) bt
#0  0x804b986 in end ()
Cannot access memory at address 0x24de4.
(gdb)
freebsd:~/Src/tar-1.11.2$ 

tar was apparently dieing in the section of code in rtapelib.c that tries
to execl() various alternative names for the remote shell program until one
works:

	  execl ("/usr/ucb/rsh", "rsh", system,
		 "/etc/rmt", (char *) 0);
	  execl ("/usr/bin/remsh", "remsh", system,
		 "/etc/rmt", (char *) 0);
	  execl ("/usr/bin/rsh", "rsh", system,
		 "/etc/rmt", (char *) 0);
	  execl ("/usr/bsd/rsh", "rsh", system,
		 "/etc/rmt", (char *) 0);
	  execl ("/usr/bin/nsh", "nsh", system,
		 "/etc/rmt", (char *) 0);

After I removed all of the unnecessary execl()s, leaving only the one for
"/usr/bin/rsh", tar was able to access the remote tape drive with no
problems.

It looks (to me, anyhow) like the unsuccessful execl()s are corrupting
something that they shouldn't be.

If I can provide any more help tracking it down, please let me know.
--
Rich Kuhns			rjk@grauel.com
PO Box 6249
100 Sawmill Road
Lafayette, IN  47903
(317)477-6000 x319