Subject: segmentation faults when loading Lisp code
From: Oliver Kullmann
Date: Thu, 20 Jan 2011 16:38:21 +0000
Hello,
we have a problem with Maxima, the same in 5.21.1 and 5.23.2,
where we use Ecl 10.4.1.
For large computation we need to reset the (far too low) default
memory settings of Ecl, where we have written the following functions:
frame_stack_ecl : 2^14;
binding_stack_ecl : 2^17;
c_stack_ecl : 2^22;
heap_size_ecl : 2^30;
lisp_stack_ecl : 2^18;
show_memory_ecl() := (
print("frame_stack_ecl:", get_frame_stack_ecl()),
print("binding_stack_ecl:", get_binding_stack_ecl()),
print("c_stack_ecl:", get_c_stack_ecl()),
print("heap_size_ecl:", get_heap_size_ecl()),
print("lisp_stack_ecl:", get_lisp_stack_ecl())
)$
default_memory_ecl() := (
set_frame_stack_ecl(frame_stack_ecl),
set_binding_stack_ecl(binding_stack_ecl),
set_c_stack_ecl(c_stack_ecl),
set_heap_size_ecl(heap_size_ecl),
set_lisp_stack_ecl(lisp_stack_ecl)
)$
which includes the following file with the underlying Lisp code:
(defun $set_frame_stack_ecl (fs)
(ext:set-limit 'ext:frame-stack fs)
fs
)
(defun $get_frame_stack_ecl ()
(ext:get-limit 'ext:frame-stack)
)
(defun $set_binding_stack_ecl (bs)
(ext:set-limit 'ext:binding-stack bs)
bs
)
(defun $get_binding_stack_ecl ()
(ext:get-limit 'ext:binding-stack)
)
(defun $set_c_stack_ecl (cs)
(ext:set-limit 'ext:c-stack cs)
cs
)
(defun $get_c_stack_ecl ()
(ext:get-limit 'ext:c-stack)
)
(defun $set_heap_size_ecl (hs)
(ext:set-limit 'ext:heap-size hs)
hs
)
(defun $get_heap_size_ecl ()
(ext:get-limit 'ext:heap-size)
)
(defun $set_lisp_stack_ecl (ls)
(ext:set-limit 'ext:lisp-stack ls)
ls
)
(defun $get_lisp_stack_ecl ()
(ext:get-limit 'ext:lisp-stack)
)
This all works when called from the Maxima shell, but Maxima segfaults when loading a file
containing the expression
default_memory_ecl();
(where this file loads the .mac-file containing the above Maxima-definitions, and
that file loads the file with the above Lisp-definitions).
Whether the segfault occurs depends on the circumstances, sometimes a "batch"
succeeds where a load doesn't. But altogether it seems completely impossible
to set the memory-limits in batch-mode (and that's what we need --- we need to
run Maxima in batch-mode for performing many computations, which all need more
memory).
If you need more information on how to reproduce the problem, I'll try my best,
however I have the feeling that it depends in some random fashion on details
of the environment (though in our environment it's completely reproducible).
Hope something can be done about it (yet we are really completely unable to run
the experiments --- there are many of them, and whatever we do in batch-mode,
it segfaults).
Hope something can be done.
Thanks for your attention!
Oliver
--
Dr. Oliver Kullmann
Computer Science Department
Swansea University
Faraday Building, Singleton Park
Swansea SA2 8PP, UK
http://cs.swan.ac.uk/~csoliver/