Article View: gnu.bash.bug
Article #140bash bug report
From: Emil M. Scoffone
Date: Mon, 26 Jun 1989 16:16
Date: Mon, 26 Jun 1989 16:16
290 lines
8873 bytes
8873 bytes
GNU program: Bash 1.01
Machine: Compaq Deskpro 386/16
Operating System: System V/386 Release 3.2
(vendor: Bell Technologies)
Compiler: GNU C, version 1.35, with GNU as and ld.
I defined a new machine name `i386' in Makefile, for PCs.
The UNIXPC operating system type seems to be for Xenix, so I
used the SYSV-i386 combination for distinguishing a PC based machine
running sysV.
Mail (if needed) to escoffon@ucsd.edu.
****************************************
These are bugs I found while installing bash:
----------------------------------------
in `shell.c':
SIGVTALRM and SIGPROF are undefined signals under sysv.
Fix:
used #ifdef's to selectively include the signals.
----------------------------------------
in `general.c':
in `dup2':
fDUPFD undeclared
Fix:
changed to F_DUPFD
in `gethostname':
namelen undeclared
Fix:
changed to namlen
----------------------------------------
in `parse.y': (this is a warning, I think)
in `decode_prompt_string':
assignment needs a cast (line 1516)
Fix:
added `extern char *index();' declaration.
Note that people who load with libPW.a should probably redefine
`index' to `strchr', since there is a `index' routine in that
library.
----------------------------------------
Note also that I had to change the name `unwind_correct.c' to
`uw_correct.c', since sysV takes at most 14 characters for filenames.
I subscribe to your opinions on the subject.
****************************************
These are bugs I found while running bash:
----------------------------------------
When a command is run that returns a nonzero exit code xxx, bash
prints the message
Signal xxx (core dumped)
This is because `struct wait' is incorrectly defined in `jobs.h':
the low and high byte of the return value from wait(2) are swapped.
Fix: rewrote `struct wait' to give the right byte order.
----------------------------------------
****************************************
In addition to the bug fixes, I made some other (convenience) changes:
----------------------------------------
`shell_ulimit' was slightly modified to be more in line with the
description of ulimit(2) on my system.
----------------------------------------
On my computer, ^H by default acts as the `erase' character; bash
uses RUBOUT for this purpose. In order to be consistent, I changed the
keymap for ^H from `rl_backward' to `rl_rubout'.
The macro CTRLH_SAME_AS_RUBOUT (defined in `readline.h') can be used to
turn the new mapping on or off.
----------------------------------------
I use shl(1) in lieu of job control under SysV. This implies that one
cannot turn ISIG off, since the terminal driver interprets the `switch'
character and signals shl. By default, the readline package will turn
ISIG off when NOJOBS is defined, which makes it impossible to switch
out of bash.
The macro WANT_SHL (defined in `readline.h') can be used to turn the
switching on or off under sysV.
----------------------------------------
****************************************
I also made some minor changes here and there, which are not worth
a long-winded report. The rest of the file shows all the differences
between my modified bash files and the 1.01 distribution.
diff dist-bash/FEATURES old-bash/FEATURES
diff dist-bash/LICENSE old-bash/LICENSE
diff dist-bash/Makefile old-bash/Makefile
30c30
< MAINTAINER = '"escoffon@ucsd.edu"'
---
> MAINTAINER = '"bfox@ai.mit.edu"'
34c34
< DESTDIR = /usr/local/bin
---
> DESTDIR = /usr/gnu/bin
39,40c39,40
< # SUN3, SUN4, SUN386i, i386, VAX, SONY, CONVEX, HP, HP9KS300
< TARGET = i386
---
> # SUN3, SUN4, SUN386i, VAX, SONY, CONVEX, HP, HP9KS300
> TARGET = SUN3
45c45
< OS = SYSV
---
> OS = SUNOS4
73c73
< TERMCAP = curses
---
> TERMCAP = termcap
99c99
< SPROMPT = '"${PROGRAM}> "'
---
> SPROMPT = '"${PROGRAM}>"'
112,113c112,113
< #MALLOC = $(ALLOC_SOURCE)malloc-rcheck.o
< MALLOC= $(ALLOC_SOURCE)malloc.o
---
> MALLOC = $(ALLOC_SOURCE)malloc-rcheck.o
> #MALLOC= $(ALLOC_SOURCE)malloc.o
125c125
< uw_protect.c
---
> unwind_protect.c
137c137
< braces.o uw_protect.o
---
> braces.o unwind_protect.o
diff dist-bash/README old-bash/README
diff dist-bash/alias.c old-bash/alias.c
diff dist-bash/alias.h old-bash/alias.h
diff dist-bash/braces.c old-bash/braces.c
diff dist-bash/builtins.c old-bash/builtins.c
25,26d24
< #if !(defined(SYSV) && defined(i386))
< #include <sys/resource.h>
27a26
> #include <sys/resource.h>
29d27
< #endif
2424d2421
< #if !(defined(SYSV) && defined(i386))
2426d2422
< #endif /* SYSV && i386 */
2439,2441d2434
< #ifdef i386
< return (ulimit (1, 0));
< #else /* i386 */
2443d2435
< #endif /* i386 */
diff dist-bash/builtins.h old-bash/builtins.h
diff dist-bash/config.h old-bash/config.h
6,9d5
< #ifdef __GNUC__
< #define alloca __builtin_alloca
< #endif
<
68a65
>
diff dist-bash/copy_cmd.c old-bash/copy_cmd.c
diff dist-bash/dispose_cmd.c old-bash/dispose_cmd.c
diff dist-bash/emacs_keymap.c old-bash/emacs_keymap.c
diff dist-bash/execute_cmd.c old-bash/execute_cmd.c
diff dist-bash/flags.c old-bash/flags.c
diff dist-bash/flags.h old-bash/flags.h
diff dist-bash/funmap.c old-bash/funmap.c
diff dist-bash/general.c old-bash/general.c
28,30d27
< #if defined(SYSV) && defined(i386)
< #include <string.h>
< #else
32d28
< #endif /* SYSV && i386 */
370c366
< int dup2 (f, t) int f, t; { close (t); return (fcntl (f, F_DUPFD, t)); }
---
> int dup2 (f, t) int f, t; { close (t); return (fcntl (f, fDUPFD, t)); }
382c378
< name[namlen - 1] = '\0';
---
> name[namelen - 1] = '\0';
diff dist-bash/general.h old-bash/general.h
diff dist-bash/glob.c old-bash/glob.c
54,56d53
< #ifdef __GNUC__
< #define alloca __builtin_alloca
< #else
58d54
< #endif
diff dist-bash/hash.c old-bash/hash.c
diff dist-bash/hash.h old-bash/hash.h
diff dist-bash/history.c old-bash/history.c
diff dist-bash/history.h old-bash/history.h
diff dist-bash/inform old-bash/inform
diff dist-bash/jobs.c old-bash/jobs.c
diff dist-bash/jobs.h old-bash/jobs.h
9,14c9
< union wait {
< struct {
< unsigned char low; unsigned char high;
< } bytes;
< unsigned short word;
< };
---
> union wait { struct { char high; char low; } bytes; short word; };
17c12
< #define w_termsig bytes.low & ~0200
---
> #define w_termsig bytes.low
20c15
< #define w_coredump bytes.low & 0200
---
> #define w_coredump w_termsig & 0x7f
110a106
>
diff dist-bash/keymaps.c old-bash/keymaps.c
diff dist-bash/longest_signal old-bash/longest_signal
diff dist-bash/mail-shell old-bash/mail-shell
diff dist-bash/mailcheck.c old-bash/mailcheck.c
27,30d26
< #ifdef __GNUC__
< #define alloca __builtin_alloca
< #endif
<
diff dist-bash/make_cmd.c old-bash/make_cmd.c
diff dist-bash/newversion.c old-bash/newversion.c
diff dist-bash/nojobs.c old-bash/nojobs.c
diff dist-bash/parse.y old-bash/parse.y
1404d1403
< extern char *index ();
diff dist-bash/print_cmd.c old-bash/print_cmd.c
diff dist-bash/readline.c old-bash/readline.c
85d84
< #ifndef WANT_SHL
90d88
< #endif
567,569d566
< #ifdef CTRLH_SAME_AS_RUBOUT
< keymap[CTRL('H')] = rl_rubout;
< #else
571d567
< #endif
diff dist-bash/readline.h old-bash/readline.h
89,101d88
< /* escoffon@ucsd.edu
< If on, then readline does not turn signal generation off when in SysV.
< The idea is that ISIG is kept on, and therefore a ^Z will signal the
< shell layer manager, shl(1). */
< #if defined(SYSV)
< #define WANT_SHL
< #endif
<
< /* escoffon@ucsd.edu
< If on, then readline maps backspaces (^H) and delete to perform
< the same operation. */
< #define CTRLH_SAME_AS_RUBOUT
<
diff dist-bash/shell.c old-bash/shell.c
737,742c737
< #ifdef SIGVTALRM
< SIGVTALRM,
< #endif
< #ifdef SIGPROF
< SIGPROF,
< #endif
---
> SIGVTALRM, SIGPROF,
diff dist-bash/shell.h old-bash/shell.h
diff dist-bash/subst.c old-bash/subst.c
diff dist-bash/test.c old-bash/test.c
diff dist-bash/trap.c old-bash/trap.c
diff dist-bash/trap.h old-bash/trap.h
diff dist-bash/uw_protect.c old-bash/uw_protect.c
diff dist-bash/variables.c old-bash/variables.c
28,31d27
< #ifdef __GNUC__
< #define alloca __builtin_alloca
< #endif
<
diff dist-bash/variables.h old-bash/variables.h
diff dist-bash/version.h old-bash/version.h
diff dist-bash/vi_keymap.c old-bash/vi_keymap.c
Technical Details
Message-ID:
<8906261616.AA22518@sdchemv1.chem.ucsd.edu>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!dptcdc!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!UCSD.EDU!emil%chemShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!dptcdc!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!UCSD.EDU!emil%chem From: emil%chem@UCSD.EDU (Emil M. Scoffone) Newsgroups: gnu.bash.bug Subject: bash bug report Message-ID: <8906261616.AA22518@sdchemv1.chem.ucsd.edu> Date: 26 Jun 89 16:16:06 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 290