Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ccivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!rochester!ritcv!ccivax!crp From: crp@ccivax.UUCP (Chuck Privitera) Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: Re: restore R dumps core Message-ID: <213@ccivax.UUCP> Date: Tue, 30-Oct-84 08:51:39 EST Article-I.D.: ccivax.213 Posted: Tue Oct 30 08:51:39 1984 Date-Received: Wed, 31-Oct-84 06:30:42 EST References: <229@tellab3.UUCP> Organization: CCI Telephony Systems Group, Rochester NY Lines: 87 Xref: godot net.bugs.4bsd:545 net.unix-wizards:3385 > Under 4.2BSD, restore R causes a segmentation fault then proceeds to > dump core. Using ADB I found out it dies in bcopy() which is called > from readtape(). Does anyone have a fix for this? I really haven't > got the time or patience to wade through restore. Thanks. > -- > ...ihnp4!tellab1!steve > Steve Harpster > Tellabs, Inc. I ran in to the very same problem. Here's the fix, line numbers may be off: rcsdiff -c5 -r1.1 -r1.2 main.c *** /tmp/,RCSt1001216 Tue Oct 30 08:42:11 1984 --- /tmp/,RCSt2001216 Tue Oct 30 08:42:13 1984 *************** *** 188,197 done(0); /* * Resume an incremental file system restoration. */ case 'R': initsymtable(symtbl); skipmaps(); skipdirs(); createleaves(symtbl); createlinks(); --- 188,198 ----- done(0); /* * Resume an incremental file system restoration. */ case 'R': + setup1(); initsymtable(symtbl); skipmaps(); skipdirs(); createleaves(symtbl); createlinks(); rcsdiff -c5 -r1.1 -r1.2 tape.c *** /tmp/,RCSt1001224 Tue Oct 30 08:42:52 1984 --- /tmp/,RCSt2001224 Tue Oct 30 08:42:57 1984 *************** *** 160,169 curfile.action = USING; getfile(xtrmap, xtrmapskip); } /* * Prompt user to load a new dump volume. * "Nextvol" is the next suggested volume to use. * This suggested volume is enforced when doing full * or incremental restores, but can be overrridden by * the user when only extracting a subset of the files. --- 160,188 ----- curfile.action = USING; getfile(xtrmap, xtrmapskip); } /* + * Initialize fssize variable for 'R' command to work. + */ + + setup1() + { + struct stat stbuf; + + if (stat(".", &stbuf) < 0) { + perror("cannot stat ."); + done(1); + } + fssize = stbuf.st_blksize; + if (fssize <= 0 || ((fssize - 1) & fssize) != 0) { + fprintf(stderr, "bad block size %d\n", fssize); + done(1); + } + } + + /* * Prompt user to load a new dump volume. * "Nextvol" is the next suggested volume to use. * This suggested volume is enforced when doing full * or incremental restores, but can be overrridden by * the user when only extracting a subset of the files.