Thread View: comp.bugs.2bsd
7 messages
7 total messages
Started by maart
Thu, 01 Sep 1988 23:23
'sed -e' dumps core
Author: maart
Date: Thu, 01 Sep 1988 23:23
Date: Thu, 01 Sep 1988 23:23
2 lines
419 bytes
419 bytes
'sed -e' without any further argument dumps core. A fix should be easy.
Re: 'sed -e' dumps core
Author: Casey Leedom
Date: Sat, 03 Sep 1988 02:40
Date: Sat, 03 Sep 1988 02:40
8 lines
789 bytes
789 bytes
In article <1334@solo7.cs.vu.nl> maart@cs.vu.nl () writes: > 'sed -e' without any further argument dumps core. A fix should be easy. What version of 2BSD are you using? I just did this on our current 2.10BSD (soon to be released at the site near you) and didn't have any problems. Are you using 2.9BSD? Casey
Re: 'sed -e' dumps core
Author: David Elliott
Date: Sat, 03 Sep 1988 15:11
Date: Sat, 03 Sep 1988 15:11
65 lines
2297 bytes
2297 bytes
In article <15741@shemp.CS.UCLA.EDU> casey@admin.cognet.ucla.edu.UUCP (Casey Leedom) writes:
>In article <1334@solo7.cs.vu.nl> maart@cs.vu.nl () writes:
>> 'sed -e' without any further argument dumps core. A fix should be easy.
>
> What version of 2BSD are you using? I just did this on our current
>2.10BSD (soon to be released at the site near you) and didn't have any
>problems. Are you using 2.9BSD?
If you're on a DEC machine, or any machine that allows dereferencing of
NULL pointers, it probably works fine.
This is one of those long-standing problems, and is present in both
BSD and System V. There are actually 2 bugs. In the -f code, the
check for enough arguments left checks to see if eargc is 1 and then
decrements it, exiting if it isn't, but eargc can't be 1 at that point.
The -e code doesn't even check for enough arguments in System V, but
I seem to remember it does the same as for -f in BSD.
Here's the fix for System V (the BSD code should be similar):
*** sed0.c.old
--- sed0.c
***************
*** 97,106 ****
continue;
case 'f':
! if(eargc-- <= 0) exit(2);
if((fin = fopen(*++eargv, "r")) == NULL) {
! fprintf(stderr, "Cannot open pattern-file: %s\n", *eargv);
exit(2);
}
--- 97,110 ----
continue;
case 'f':
! if (eargc < 2) {
! fprintf(stderr, "-f requires a file argument\n");
! exit(2);
! }
! eargc--;
if((fin = fopen(*++eargv, "r")) == NULL) {
! perror(*eargv);
exit(2);
}
***************
*** 109,114 ****
--- 113,122 ----
continue;
case 'e':
+ if (eargc < 2) {
+ fprintf(stderr, "-e requires an argument\n");
+ exit(2);
+ }
eflag++;
fcomp();
eflag = 0;
--
David Elliott dce@mips.com or {ames,prls,pyramid,decwrl}!mips!dce
Re: 'sed -e' dumps core
Author: Keith Bostic
Date: Sat, 03 Sep 1988 18:37
Date: Sat, 03 Sep 1988 18:37
10 lines
842 bytes
842 bytes
In article <1334@solo7.cs.vu.nl>, maart@cs.vu.nl writes: > 'sed -e' without any further argument dumps core. > A fix should be easy. This is not useful information. Sed on what machine running what OS? If available, it would also be nice to know what version of sed (see what(1), or strings(1)) you were running. "sed -e" seems to work fine on 4.[0123]BSD and 4.3BSD-tahoe. Keith Bostic
Re: 'sed -e' dumps core
Author: Richard A. O'Keefe
Date: Mon, 05 Sep 1988 02:11
Date: Mon, 05 Sep 1988 02:11
7 lines
929 bytes
929 bytes
In article <25927@ucbvax.BERKELEY.EDU> bostic@ucbvax.BERKELEY.EDU (Keith Bostic) writes: >In article <1334@solo7.cs.vu.nl>, maart@cs.vu.nl writes: >> 'sed -e' without any further argument dumps core. >This is not useful information. Sed on what machine running what OS? This happens in SunOS 3.2 on a Sun-3/50 (sed[01].c 1.1 86/07/07), and SunOS 3.2rev2 on a Sun-4, but not in SunOS 4.0RRBeta2 on a 386i.
Re: 'sed -e' dumps core
Author: Brian Glendenning
Date: Mon, 05 Sep 1988 04:12
Date: Mon, 05 Sep 1988 04:12
5 lines
845 bytes
845 bytes
It dumps core on our Sun running SunOS 3.5 for one.
--
Brian Glendenning INTERNET - brian@radio.astro.toronto.edu
Radio Astronomy, U. Toronto UUCP - {uunet,pyramid}!utai!radio!brian
+1 (416) 978-5558 BITNET - glendenn@utorphys.bitnet
Re: 'sed -e' dumps core
Author: Maarten Litmaath
Date: Mon, 05 Sep 1988 20:31
Date: Mon, 05 Sep 1988 20:31
46 lines
1965 bytes
1965 bytes
In article <25927@ucbvax.BERKELEY.EDU> bostic@ucbvax.BERKELEY.EDU (Keith Bostic) writes:
\In article <1334@solo7.cs.vu.nl>, maart@cs.vu.nl writes:
\> 'sed -e' without any further argument dumps core.
\> A fix should be easy.
\
\This is not useful information. Sed on what machine running what
\OS? If available, it would also be nice to know what version of
\sed (see what(1), or strings(1)) you were running. "sed -e" seems
\to work fine on 4.[0123]BSD and 4.3BSD-tahoe.
\
\Keith Bostic
On 2.9BSD on a PDP11/44 the output of 'sed -e | cat -v' is:
Unrecognized command: M-pM-^@^]^B
On Sun UNIX 4.2 Release 3.5 the output of 'what /bin/sed' is:
/bin/sed
crt0.s 1.2 86/10/07 Copyr 1985 Sun Micro
sed0.c 1.2 86/10/07 SMI
sed1.c 1.2 86/10/07 SMI
fopen.c 1.2 86/10/07 SMI
filbuf.c 1.2 86/10/07 SMI
fprintf.c 1.2 86/10/07 SMI
doprnt.c 1.4 87/07/01 SMI
flsbuf.c 1.2 86/10/07 SMI
exit.c 1.2 86/10/07 Copyr 1984 Sun Micro
_itoa.s 1.2 86/10/07 Copyr 1984 Sun Micro
ctype_.c 1.2 86/10/07 SMI
findiop.c 1.2 86/10/07 SMI
calloc.c 1.2 86/10/07 SMI
malloc.c 1.3 86/10/07 SMI
isinf.c 1.2 86/10/07 SMI
memchr.c 1.2 86/10/07 SMI
q.s 1.2 86/10/07 Copyr 1984 Sun Micro
unpkd.s 1.2 86/10/07 Copyr 1984 Sun Micro
upottab.c 1.2 86/10/07 Copyr 1984 Sun Micro
isatty.c 1.2 86/10/07 SMI
And the output of 'sed -e':
Segmentation fault (core dumped)
--
Alles klar, |Maarten Litmaath @ Free U Amsterdam:
Herr Kommissar? |maart@cs.vu.nl, mcvax!botter!maart
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