📄 readme.bc
字号:
BOUNDS-CHECKER 2.11 INSTALLATION & OPERATING NOTES
3-6-95
-------------------------------------------------------------------
TABLE OF CONTENTS:
-------------------------------------------------------------------
The following is a list of headings within this file. For more
information, please refer to the Nu-Mega BBS or Compuserve Forum
1. INSTALLATION
2. PRE-SETTING THE BOUNDS-CHECKER SWITCHES
3. UPDATE DISPLAYS "Old Copy of Bounds-Checker is invalid"
4. GENERAL INFORMATION FOR NEW USERS
5. BOUNDS-CHECKER HANGS WHEN LOADING (GP FAULT OR INVALID OPCODE)
6. BOUNDS-CHECKER HANGS WHILE RUNNING (GP FAULT OR INVALID OPCODE)
7. BOUNDS-CHECKER HANGS WHEN TERMINATING
8. USING BOUNDS-CHECKER WITH 386MAX VERSION 7
9. QEMM ST-DBL.SYS (STEALTH MODE DBLSPACE)
10. STACK SIZE = 0
11. "Owner is Free Block" MESSAGE
12. USING BOUNDS-CHECKER WITH STACKER 4.0
13. BORLAND PROGRAMS WITH LESS THAN 8K STACKS
14. RUNNING WITH DR-DOS 6.0
15. USE OF "msize","fmsize" & "nmsize" FUNCTIONS
16. USING BOUNDS-CHECKER WITH METAGRAPHICS
17. OVERRUN OF BLOCK ALLOCATED BY BORLAND'S __OvrPrepare ROUTINE
18. CSCAPE PROGRAM APPEARS TO HANG
19. CTRL-ALT-DEL DOESN'T WORK
20. USING BCHK WITH SERIAL COMMUNICATIONS PROGRAMS
21. PCODE PROGRAMS
22. USING FOREIGN KEYBOARDS
23. GRAPHICS APPLICATION PROGRAM RUNS VERY SLOWLY.
24. R6001 ERROR NOT DETECTED WITH /NULL SWITCH
25. ACCESSES TO INTERRUPT VECTOR TABLE
26. FLOATING POINT NUMBERS CAUSE "CODE OVERWRITE" MESSAGE
27. USING FarMalloc OR FarFree AS LIBRARY NAMES (MICROSOFT)
28. "The Only Nu-Mega Driver Supported etc." MESSAGE
29. BOUNDS-CHECKING SPAWNED PROGRAMS
30. SUMMARY OF COMMON ERROR MESSAGES AND WHAT TO DO
-------------------------------------------------------------------
1. INSTALLATION
-------------------------------------------------------------------
To install BOUNDS-CHECKER Version 2.10, copy all the files from
the floppy to the hard disk in any directory on your path. Before
BOUNDS-CHECKER can be run, a memory manager such as HIMEM.SYS or
QEMM or 386MAX must be installed. If QEMM or 386MAX is used, do not
select any of the stealth options (e.g. VGASWAP in the 386MAX.PRO
file); also read the later sections in this file for notes on other
options that cause problems with BOUNDS-CHECKER.
The file ROUTINE.DAT contains the names of the string library
and memory allocation routines trapped by BOUNDS-CHECKER together
with a handling code. If this file is corrupted, it may cause
BOUNDS-CHECKER to display erroneous messages, so we suggest making
this a Read-Only file after installation.
-------------------------------------------------------------------
2. PRE-SETTING THE BOUNDS-CHECKER SWITCHES
-------------------------------------------------------------------
BOUNDS-CHECKER has a built-in table of default settings for most
of its switch options. To view or change these settings, run BCHK
without any parameters:
bchk
This selects a routine which displays the current settings and a
menu of commands to change them. On-line help for each option is
displayed when that line on the screen is selected.
When this routine is exited, the current switch selections will
be saved in a 2-byte file named BCHK.CFG. The next time BCHK is
run, it will read the BCHK.CFG file and use those selections to set
its options. Command line switches override any of these options.
-------------------------------------------------------------------
3. UPDATE DISPLAYS "Old Copy of Bounds-Checker is invalid"
-------------------------------------------------------------------
If BC.SYS from BOUNDS-CHECKER 1.xx is installed when the update
program is run, the message "Old Copy of Bounds-Checker is invalid"
is displayed. To fix this, reboot with a commercial memory manager
such as QEMM, 386MAX or HIMEM.SYS.
-------------------------------------------------------------------
4. GENERAL INFORMATION FOR NEW USERS
-------------------------------------------------------------------
The syntax for using BOUNDS-CHECKER is:
BCHK [BC options] program-name [program options]
BCHK.EXE and ROUTINE.DAT must be in your path. The program must
be compiled with a .MAP file, with debug data in the .EXE file, and
without optimizations (because our data checking functions read
parameters passed to a library from the stack). The .MAP file for
Borland programs must contain segment data - use the -s option.
BOUNDS-CHECKER will also read debug data from a Borland .TDS file,
so you may run TDSTRIP with the -s switch on a Borland .EXE file
that previously contained debug data as described above.
There must be an XMS memory manager loaded (HIMEM.SYS or QEMM or
386MAX).
When BOUNDS-CHECKER loads your application program, it takes all
the available XMS memory during loading - this can sometimes cause
a conflict with caching programs. BOUNDS-CHECKER first loads most
of its own code into extended memory, keeping just a 4K kernel in
base memory. It then reads the debug data from the application
program, parses it into extended memory, gets the names of the
source files, reads them, and parses them into extended memory as
well. When everything has been loaded, it releases 1 Mb of XMS
memory for the program to use (but you can change this amount with
the EXTMEM switch).
BOUNDS-CHECKER reads the .MAP file to find the end of your code
area, and the size of your application. It programs the Page Fault
hardware to trap if your code accesses anywhere outside it's own
space, or if anything writes to your code area.
BOUNDS-CHECKER also searches the debug data for the names of the
libraries listed in ROUTINE.DAT. When one of these names is found,
it replaces the first byte of the library with a protected-mode
instruction. When the library is called during execution of the
application, attempting to do this instruction causes an illegal
instruction trap, which passes control to BOUNDS-CHECKER. BOUNDS-
CHECKER traps string-write routines such as STRCPY, plus allocation
and free routines.
-------------------------------------------------------------------
5. BOUNDS-CHECKER HANGS WHEN LOADING (GP FAULT OR INVALID OPCODE)
-------------------------------------------------------------------
If you are using 386MAX version 7.0, you must put "NO58" on a
line by itself in the 386MAX.PRO file.
If you are using QEMM 7.03 with the stealth doublespace driver
(ST-DBL.SYS) installed, you must remove this driver and use LOADHI
to load DBLSPACE.SYS high.
When a program is loaded by BOUNDS-CHECKER, it first reads the
debug data and source files, and parses them into extended memory.
If an XMS memory problem occurs at this time, a General Protection
(GP) fault or an Invalid Opcode error will result. Usually this
means that there was not enough XMS memory or that some other
program (typically a disk-caching program such as SMARTDRV) wrote
over the XMS memory that BOUNDS-CHECKER was using. If a GP fault
occurs, the contents of the CS register will be 0040. If an Invalid
Opcode error occurs, the Map0 command will show a value of 0000H.
There are three courses of action to take:
First, remove any disk-caching programs (SMARTDRV, etc.). These
programs can request XMS memory at a time when BOUNDS-CHECKER has
taken all of it to load the debug data and source files.
Second, use the /EXTMEM 0 switch. BOUNDS-CHECKER will try to
leave 1M of XMS memory for the program to use, and may run short of
what it needs. This switch allows it to use all the available XMS
memory.
Third, use the /DISK switch, which causes BOUNDS-CHECKER to load
only the debug data into XMS memory, but not the source files. If
BOUNDS-CHECKER needs to display a source file, it reads it from the
disk at that time, which causes a small delay. Also, if BOUNDS-
CHECKER cannot find the source file, it will not prompt for the
path to the file, but will just show assembly language.
-------------------------------------------------------------------
6. BOUNDS-CHECKER HANGS WHILE RUNNING (GP FAULT OR INVALID OPCODE)
-------------------------------------------------------------------
The most common reason for your program to lock up while running
BOUNDS-CHECKER is a bug in your software, of a type that BOUNDS-
CHECKER does not detect. You should first try enabling additional
BOUNDS-CHECKER options and run your program again. Below are some
other suggestions to try:
a. If you were using /DISK, remove it. If you you do not
have enough memory for loading source, use /NS instead.
BOUNDS-CHECKER may be trying to load source files when DOS
calls are not allowable. This problem is more likely with
disk compression software such as STACKER.
b. Try using the /NZS switch. When this switch is selected,
BOUNDS-CHECKER will not zero the stack during startup. If
the Stack Area contains some initialization code or some
far pointers, this prevents them from being destroyed.
c. If you have a separate expanded memory manager such as
EMM386, remove it from CONFIG.SYS. In some cases, removing
the disk cache utility (such as SMARTDRV) will allow
BOUNDS-CHECKER to work with the expanded memory manager.
If using PC-KWIK, disable it before running BOUNDS-
CHECKER; it can be enabled again afterwards.
d. Programs that use EMM may appear hung when running in
/SMART mode because it is adding every EMM access to the
exception file as a separate entry. You must put
ACCESS ANYONE
{
EMM
}
into the exception file to prevent this.
e. If your program hangs or generates invalid op-code or
general protection violations while loading symbols and
source, it might be running out of .SYM space. BOUNDS-
CHECKER does not always know that is going to run out. The
usual symptom is that BOUNDS-CHECKER beeps and displays
the register contents and hangs. If this is the case, use
/DISK or /NS so the source is not pre-loaded.
-------------------------------------------------------------------
7. BOUNDS-CHECKER HANGS WHEN TERMINATING
-------------------------------------------------------------------
If your system hangs when BOUNDS-CHECKER terminates:
a. Remove your expanded memory manager (e.g.,EMM386) from
CONFIG.SYS.
b. If you are using .RTLINK, use the environment variables
SET RTVMEXP=0 and SET RTVMEXT=0.
-------------------------------------------------------------------
8. USING BOUNDS-CHECKER WITH 386MAX VERSION 7
-------------------------------------------------------------------
Problem: BOUNDS-CHECKER hangs with an Invalid Opcode error when
run with 386MAX Version 7.0
Solution: Put "NO58" on a line by itself in the 386MAX.PRO file.
This disables the INT 21H Function 58, which controls accessing of
the Upper Memory Blocks. The default state creates a problem in
trying to work through the DOS linkage structures.
-------------------------------------------------------------------
9. QEMM ST-DBL.SYS (STEALTH MODE DBLSPACE)
-------------------------------------------------------------------
Problem: BOUNDS-CHECKER pops up with Invalid Opcode when QEMM's
Stealth Mode Doublespace is installed. The "code" being executed is
within the fonts for the 8x8 character set.
Solution: This problem occurs only with MS-DOS version 6.2 with
Doublespace installed, running under QEMM V7.03+ with their stealth
doublespace driver (ST-DBL.SYS) installed in CONFIG.SYS.
When BOUNDS-CHECKER needs to display a screen, it loads the
fonts from the Video ROM. Normally QEMM would trap any access to
this space and process it so that the correct information is read.
However, BOUNDS-CHECKER is running in protected-mode when it loads
the fonts, so QEMM cannot take control.
The only solution is to load DBLSPACE.SYS high using QEMM's
LOADHI rather than using ST-DBL.SYS.
-------------------------------------------------------------------
10. STACK SIZE = 0
-------------------------------------------------------------------
Problem: When BOUNDS-CHECKER terminates the stack size is shown
as 0 bytes. Usually the stack used is shown as 2 bytes, and the
initial program size is blank. The report of allocated blocks not
freed may have strange addresses and sizes.
Solution: After loading a program, BOUNDS-CHECKER looks through
the debug data for the address of the symbol name "main" and sets
an INT3 style breakpoint on this address. It lets the program run
up to this point - when the breakpoint occurs, it zeroes the stack
and clears its 64K allocation data area in extended memory. If
BOUNDS-CHECKER cannot find "main", none of this is done, and so
when the program terminates, the report is wrong.
Some reasons why "main" would not be found:
"main" is in an overlay.
"main" is in a module compiled without debug data.
There is a module named "main.c" or "main.cpp" as well as
a symbol named "main" so that BOUNDS-CHECKER does not
know where to stop.
-------------------------------------------------------------------
11. "Owner is Free Block" MESSAGE
-------------------------------------------------------------------
Problem: BOUNDS-CHECKER pops up in an out-of-bounds error with
the message "Owner is Free Block".
Solution: This message means that the location being accessed
has not been assigned to any program: typically it is above the
program being checked, but below Video Memory.
The most common cause is a stack wrap-around, especially in
Borland programs because their default is no stack checking. If the
stack space is not large enough, the stack pointer SP goes down to
0000, and when the next stack store operation occurs, SP wraps
around to FFFE.
Another possible cause is using an allocation pointer that was
freed, especially where the pointer was copied to another variable.
Also, there are some third-party libraries which use the free space
above the program as a buffer without allocating it.
-------------------------------------------------------------------
12. USING BOUNDS-CHECKER WITH STACKER 4.0
-------------------------------------------------------------------
When using BOUNDS-CHECKER with Stacker 4.0, you must remove the
driver DPMS.EXE from the CONFIG.SYS file. This driver loads the
Stacker drivers into extended memory, which creates a protected-
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -