Ok, to reproduce the problem, running a lisp prog under strace fails
but works ok if you dont run it under strace, make a 4.5Mb test file
of 400,000 lines:
$ sbcl --noinform --eval '(progn (dotimes (x 400000) (format t "line
~a~%" x)) (quit))' >test-file
Then make a script 'test.lisp' with these contents:-
(let ((i 0) (len 0))
(with-open-file (s #p"test-file")
(do ((line (read-line s nil)
(read-line s nil)))
(incf len (1+ (length line)))
(format t "i=~a l=~a~%" i len))))
Then run it as a script, it will read through the whole file, all OK:
$ sbcl --script test.lisp
..outputs lots of lines, last one is..
*) Now run the same command under strace (output to /dev/null, we dont
care) you get the corruption warning:-
$ strace -o/dev/null sbcl --script test.lisp
...outputs lots of lines, then...
heap WP violation? fault_addr=ffffffb9, page_index=-1
CORRUPTION WARNING in SBCL pid 6651:
Memory fault at ffffffb9 (pc=0x100138d78c, sp=0x7ffff0cb7630)
The integrity of this image is possibly compromised.
*) Experimenting with files of different line lengths, it is not the
number of lines but the size of the file read so far - something to do
with triggering garbage collection maybe.
*) The above output is from an sbcl-1.0.33 binary I built with
'#define QSHOW_SIGNALS 1' in src/nuntime/runtime.h
*) The *features* are:
(:ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS
:SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86-64 :UNIX
:ELF :LINUX :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
:C-STACK-IS-CONTROL-STACK :LINKAGE-TABLE :COMPARE-AND-SWAP-VOPS
:STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
:CYCLE-COUNTER :COMPLEX-FLOAT-VOPS :FLOAT-EQL-VOPS :INLINE-CONSTANTS
:OS-PROVIDES-DLOPEN :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T)
*) box is Fedora core 11, uname -a:
Linux imb09-02933 126.96.36.199-99.fc11.x86_64 #1 SMP Tue Nov 17 21:30:38
EST 2009 x86_64 x86_64 x86_64 GNU/Linux
*) I dont know how to get a backtrace, I am dropped back to the command-line.
Anything else, just let me know. Should I log it in launchpad?
2009/12/3 Gábor Melis <mega@...>:
> On Wednesday 02 December 2009, Michael Pheasant wrote:
>> I'd like to strace my sbcl core (SBCL 1.0.30, Fedora Core 11, Linux
>> 188.8.131.52-96.fc11.i686.PAE), but cant, as sbcl gives errors like:
>> CORRUPTION WARNING in SBCL pid 5833(tid 3086854928):
>> I would like to trace system calls sbcl is doing. In particular i
>> want to see the IO calls and check whether the IO is being buffered
>> or is byte-by-byte.
>> I'm not sure if there is any other way to do this. Using the sb-sprof
>> & sb-profile facilities I do not seem to be able to get detailed
>> enough information about the underlying system calls.
> Hello Mike
> Could you be more specific about what happens and how to reproduce it; I
> can start a recent sbcl with strace.
> See "1.3.2 Signal Related Bugs" of