Thread View: net.bugs
3 messages
3 total messages
Started by Andy Tannenbaum
Sat, 26 May 1984 03:39
how to unscrew yourself after vnews core dumps
Author: Andy Tannenbaum
Date: Sat, 26 May 1984 03:39
Date: Sat, 26 May 1984 03:39
44 lines
2317 bytes
2317 bytes
On our VAX 750 4.1C, vnews core dumps when you type crap to the N command and try to break out with INTR. I haven't investigated the bug cuz the sources aren't lying around here, but if ever you get booted out of vnews with a core dump after a few hours and you want to recover your .newsrc, here's how to do it! (Welcome to kludge of the century.) Key thing is that the .newsrc lines are stored in core in the same format that they're stored on disk. First, get the useful strings out of the core image: % strings core | see > foo "Strings" gets printable ascii strings out of a file. Fine piece of work, comes with 4bsd. "See" makes sure that you can vi the file. See is cat -v, I didn't want ickey!rob to complain. Now, edit the file and look for the string: net.general: (Assuming you read net.general). Make sure you put the colon after! There is an area that looks like a .newsrc but with no colons, I suspect it's a list of "last article in newsgroup" or something. Don't be fooled by cheap substitutes, demand the colon! Now, walk backward to what looks like the top of the .newsrc file, and delete the cruft before it. Walk to what looks like the end and delete the cruft after. You might have some short lines of garbage characters within the .newsrc data, delete those lines, it's ok. What's left should have the same number of lines as your old .newsrc (check with wc). Diff them and eyeball them, I think you'll find that you've regenerated your .newsrc. (I just figured this out after just having spent a good deal of time reading news and then getting booted out.) If this comes in handy, good. If not, I hope you at least find it amusing. Andy Tannenbaum Masscomp Inc Westford MA (617) 692-6200 x274
Re: how to unscrew yourself (revised bug fix)
Author: Mark Plotnick
Date: Mon, 28 May 1984 22:33
Date: Mon, 28 May 1984 22:33
110 lines
4365 bytes
4365 bytes
This supercedes the bug fix posted yesterday. The code for the 'N' command zeroes fp, the file pointer to the current article. If you try to go to a nonexistent newsgroup, it'll print out an error message and return to the command loop. If you type ' ' (or any other command that requests more of the current article to be displayed), it'll try to read in another chunk of the current article. appfile() will die (on a vax, you'll get a bus error) because iop (which is fp) is NULL. Readnews doesn't have this problem because showtail() checks to see if fp is NULL. If it is, the program won't try to display the article, BUT will still mark it as having been read! Here are suggested fixes to visual.c and readr.c. They simply make sure that obit == -1 (and therefore that, if an invalid newsgroup is entered, getnextart will re-read the article back in). The fix I posted yesterday only checked that fp==NULL and tried to simulate an A command to read the article back in. This was an insufficient test because apparently fp is ALWAYS NULL after the call to next_ng_command, even if the command was successful and the newsgroup was changed. This problem only showed up if you N'ed to a valid newsgroup that had fewer articles than the number of the previous article in the previous newsgroup. Thanks to Andy for promptly pointing this out. I should have noticed the real problem in the first place. obit was being set to -1 in next_ng_command, except in one case - when an invalid newsgroup was asked for - and this was the case that was giving Andy coredumps! Suggestions to those who are thinking about re-writing the netnews code: - next_ng_command should return THREE different values rather than two: one to signify that the newsgroup change was successful, one to indicate that it wasn't (thus the old article should be redisplayed), and one to indicate that there aren't any more newsgroups to be jumped to. - more generally, ask MRH to put you on the netnews designers mailing list so that we can redesign this marvelous piece of software before it becomes another uucp. *** visual.c.1.5 Mon May 28 15:35:25 1984 --- visual.c Mon May 28 17:36:18 1984 *************** *** 654,659 fclose(fp); fp = NULL; } if (next_ng_command()) quitflg = 1; break; --- 654,660 ----- fclose(fp); fp = NULL; } + obit = -1; if (next_ng_command()) quitflg = 1; break; *************** *** 1318,1324 register int c; register char *icol; /* &linebuf[0] <= icol <= maxcol */ ! if (artread || artlines >= nlines) return; maxcol = linebuf; icol = linebuf; --- 1319,1325 ----- register int c; register char *icol; /* &linebuf[0] <= icol <= maxcol */ ! if (artread || artlines >= nlines || iop==NULL) return; maxcol = linebuf; icol = linebuf; *** readr.c.1.5 Mon May 28 16:04:20 1984 --- readr.c Mon May 28 17:47:58 1984 *************** *** 421,426 fclose(fp); fp = NULL; } if (next_ng_command()) return TRUE; break; --- 421,437 ----- fclose(fp); fp = NULL; } + #ifdef MIT + /* mp, 5/84: make sure we re-open the article. next_ng_command + will always set obit to -1, except when a non- + existent group name is given. This is a glitch, since if + bit==obit, getnextart won't re-open the article and fp will + STILL be NULL. So we set obit to -1, as in the U command, + to ensure that getnextart always re-opens an article. + Actually, this statement should probably be placed at the + top of next_ng_command. */ + obit = -1; + #endif if (next_ng_command()) return TRUE; break;
Re: how to unscrew yourself after vnews core dumps
Author: Rsk the Wombat
Date: Wed, 30 May 1984 17:04
Date: Wed, 30 May 1984 17:04
13 lines
1066 bytes
1066 bytes
Checking back in the dusty directories of past abuse, I find the
following script:
strings core | egrep "^((fa)|(general)|(junk)|(net)|(test)|(to)).*[:!] [0-9]*"
This does a fair job of recovering your .newsrc; to check on how well
it did, pipe its output through sort(1) and diff it with the output of
"sort ~/.newsrc".
--
Rsk the Wombat
UUCP: { allegra, decvax, ihnp4, harpo, teklabs, ucbvax } !pur-ee!rsk
{ cornell, eagle, hplabs, ittvax, lanl-a, ncrday } !purdue!rsk
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads