2.6 Troubleshooting and Testing
2.6.1 Problems Compiling
FILE PROBLEM / MESSAGE HOW TO FIX
*.c include file not found. Correct the status of STDC_HEADERS in scmfig.h.
fix #include statement or add #define for system type to scmfig.h.
*.c Function should return a value. Ignore.
Parameter is never used.
Condition is always false.
Unreachable code in function.
scm.c assignment between incompatible types. Change SIGRETTYPE in scm.c.
time.c CLK_TCK redefined. incompatablility between <stdlib.h> and <sys/types.h>.
Remove STDC_HEADERS in scmfig.h.
Edit <sys/types.h> to remove incompatability.
subr.c Possibly incorrect assignment in function lgcd. Ignore.
sys.c statement not reached. Ignore.
constant in conditional expression.
sys.c undeclared, outside of functions. #undef STDC_HEADERS in scmfig.h.
scl.c syntax error. #define SYSTNAME to your system type in scl.c (softtype).
2.6.2 Problems Linking
PROBLEM HOW TO FIX
_sin etc. missing. Uncomment LIBS in makefile.
2.6.3 Testing
Loading r4rstest.scm in the distribution will run an [R4RS]
conformance test on scm
.
> (load "r4rstest.scm")
-|
;loading r4rstest.scm
SECTION(2 1)
SECTION(3 4)
#<primitive-procedure boolean?>
#<primitive-procedure char?>
#<primitive-procedure null?>
#<primitive-procedure number?>
…
Loading pi.scm in the distribution will enable you to compute
digits of pi.
> (load "pi.scm")
;loading pi.scm
;done loading pi.scm
#<unspecified>
> (pi 100 5)
00003 14159 26535 89793 23846 26433 83279 50288 41971 69399
37510 58209 74944 59230 78164 06286 20899 86280 34825 34211
70679
;Evaluation took 550 ms (60 in gc) 36976 cells work, 1548.B other
#<unspecified>
Performance
Loading bench.scm will compute and display performance statistics
of SCM running pi.scm. ‘make bench’ or ‘make benchlit’
appends the performance report to the file BenchLog, facilitating
tracking effects of changes to SCM on performance.
2.6.4 Problems Starting
PROBLEM HOW TO FIX
/bin/bash: scm: program not found Is ‘scm’ in a ‘$PATH’ directory?
/bin/bash: /usr/local/bin/scm: Permission denied chmod +x /usr/local/bin/scm
Opening message and then machine crashes. Change memory model option to C compiler (or makefile).
Make sure sizet definition is correct in scmfig.h.
Reduce the size of HEAP_SEG_SIZE in setjump.h.
Input hangs. #define NOSETBUF
ERROR: heap: need larger initial. Increase initial heap allocation using -a<kb> or INIT_HEAP_SIZE.
ERROR: Could not allocate. Check sizet definition.
Use 32 bit compiler mode.
Don’t try to run as subproccess.
remove <FLAG> in scmfig.h and recompile scm. Do so and recompile files.
add <FLAG> in scmfig.h and recompile scm.
ERROR: Init5f4.scm not found. Assign correct IMPLINIT in makefile or scmfig.h.
Define environment variable SCM_INIT_PATH to be the full pathname of Init5f4.scm.
WARNING: require.scm not found. Define environment variable SCHEME_LIBRARY_PATH to be the full pathname of the scheme library [SLIB].
Change library-vicinity in Init5f4.scm to point to library or remove.
Make sure the value of (library-vicinity) has a trailing file separator (like / or \).
2.6.5 Problems Running
PROBLEM HOW TO FIX
Runs some and then machine crashes. See above under machine crashes.
Runs some and then ERROR: … (after a GC has happened). Remove optimization option to C compiler and recompile.
#define SHORT_ALIGN in scmfig.h.
Some symbol names print incorrectly. Change memory model option to C compiler (or makefile).
Check that HEAP_SEG_SIZE fits within sizet.
Increase size of HEAP_SEG_SIZE (or INIT_HEAP_SIZE if it is smaller than HEAP_SEG_SIZE).
ERROR: Rogue pointer in Heap. See above under machine crashes.
Newlines don’t appear correctly in output files. Check file mode (define OPEN_… in Init5f4.scm).
Spaces or control characters appear in symbol names. Check character defines in scmfig.h.
Negative numbers turn positive. Check SRS in scmfig.h.
;ERROR: bignum: numerical overflow Increase NUMDIGS_MAX in scmfig.h and recompile.
VMS: Couldn’t unwind stack. #define CHEAP_CONTINUATIONS in scmfig.h.
VAX: botched longjmp.
2.6.6 Reporting Problems
Reported problems and solutions are grouped under Compiling, Linking,
Running, and Testing. If you don’t find your problem listed there,
you can send a bug report to agj@alum.mit.edu
or
scm-discuss@gnu.org
. The bug report should include:
- The version of SCM (printed when SCM is invoked with no arguments).
- The type of computer you are using.
- The name and version of your computer’s operating system.
- The values of the environment variables
SCM_INIT_PATH
and
SCHEME_LIBRARY_PATH
.
- The name and version of your C compiler.
- If you are using an executable from a distribution, the name, vendor,
and date of that distribution. In this case, corresponding with the
vendor is recommended.