[gnu.bash.bug] bash 1.02 seg-faults on ^D

young@VLSI.LL.MIT.EDU (George Young) (08/30/89)

This is a bug report for bash version 1.02 .  Environment:
TARGET:	SUN3	(sun 3/50, 12 Mbyte diskless)
OS:	SUNOS3	(actually 3.5)
BISON:	bison
CC:	gcc -traditional -O -g

Make ran without problems.  'bash' runs fine except:
	When I type a ^D alone on a line, bash crashes with a segmentation
	violation.  (If I exit bash with "exit" everthing's fine).
gdb trace looks like:

Program received signal 11, Segmentation fault
0x2c390 in strlen ()
(gdb) where
#0  0x2c390 in strlen ()
#1  0x451e in shell_getc () (parse.y line 393)
#2  0x497e in read_token (command=0) (parse.y line 1027)
#3  0x485a in yylex () (parse.y line 961)
#4  0x34f6 in yyparse () (bison.simple line 214)
#5  0x2974 in read_command () (shell.c line 634)
#6  0x2852 in reader_loop () (shell.c line 574)
#7  0x26a0 in main (argc=1, argv=(char **) 0xefffcf8, env=(char **) 0xefffd00) (shell.c line 465)

This seems to be happening at line 434 of parse.y, when the
'current_readline_line' arg to strlen has a bogus (-1 I think) value.
The bug is quite repeatable.

..............................................................................
			Unrelated bash comments:
It would be helpful to have an 'autologout' timer,
set by some variable.  I know this is only effective if one is sitting at
a shell prompt, but lots of people leave a terminal sitting at a shell prompt
for days (or weeks!).

Documentation:  a full reference manual would be nice, when you have time, but
in the mean time a heavily commented '.bashrc' file with lots of goodies would
be very helpful, especially for users of '[t]csh' (like me) who would like to
convert to bash.

In general, this is a nifty shell; I have adopted it as my preferred shell on
all our machines.
George Young,  Rm. B-141		young@vlsi.ll.mit.edu
MIT Lincoln Laboratory			young@ll-vlsi.arpa
244 Wood St.				[129.55.11.7]
Lexington, Massachusetts  02173		(617) 981-2756

bfox@AUREL.CALTECH.EDU (Brian Fox) (08/30/89)

   From: George Young <young@vlsi.ll.mit.edu>
   Date: Tue, 29 Aug 89 13:15:49 EDT

   This is a bug report for bash version 1.02 .  Environment:
   TARGET:	SUN3	(sun 3/50, 12 Mbyte diskless)
   OS:	SUNOS3	(actually 3.5)
   BISON:	bison
   CC:	gcc -traditional -O -g

   Make ran without problems.  'bash' runs fine except:
	   When I type a ^D alone on a line, bash crashes with a segmentation
	   violation.  (If I exit bash with "exit" everthing's fine).
   gdb trace looks like:

   Program received signal 11, Segmentation fault
   0x2c390 in strlen ()
   (gdb) where
   #0  0x2c390 in strlen ()
   #1  0x451e in shell_getc () (parse.y line 393)
   #2  0x497e in read_token (command=0) (parse.y line 1027)
   #3  0x485a in yylex () (parse.y line 961)
   #4  0x34f6 in yyparse () (bison.simple line 214)
   #5  0x2974 in read_command () (shell.c line 634)
   #6  0x2852 in reader_loop () (shell.c line 574)
   #7  0x26a0 in main (argc=1, argv=(char **) 0xefffcf8, env=(char **) 0xefffd00) (shell.c line 465)

   This seems to be happening at line 434 of parse.y, when the
   'current_readline_line' arg to strlen has a bogus (-1 I think) value.
   The bug is quite repeatable.

   ..............................................................................
			   Unrelated bash comments:
   It would be helpful to have an 'autologout' timer,
   set by some variable.  I know this is only effective if one is sitting at
   a shell prompt, but lots of people leave a terminal sitting at a shell prompt
   for days (or weeks!).

   Documentation:  a full reference manual would be nice, when you have time, but
   in the mean time a heavily commented '.bashrc' file with lots of goodies would
   be very helpful, especially for users of '[t]csh' (like me) who would like to
   convert to bash.

   In general, this is a nifty shell; I have adopted it as my preferred shell on
   all our machines.
   George Young,  Rm. B-141		young@vlsi.ll.mit.edu
   MIT Lincoln Laboratory			young@ll-vlsi.arpa
   244 Wood St.				[129.55.11.7]
   Lexington, Massachusetts  02173		(617) 981-2756

bfox@AUREL.CALTECH.EDU (Brian Fox) (08/30/89)

   From: George Young <young@vlsi.ll.mit.edu>
   Date: Tue, 29 Aug 89 13:15:49 EDT

   It would be helpful to have an 'autologout' timer, set by some
   variable.

I have heard this request before, but I have not yet heard a good reason
for having it.

   I know this is only effective if one is sitting at a shell prompt,

Why?  It could just be based on idle time.

   but lots of people leave a terminal sitting at a shell prompt for
   days (or weeks!).

So what?  They are not taking any cycles by just sitting there.  They
would be taking up more cycles if the shell was getting alarm clock
signals telling it that `autologout' time had passed.

Brian