Hello,
The following code used to work in 1.2.10, but does not in 1.2.11:
(deftype blist-type ()
'(cons (member blist)))
(defun pprint-blist (stream obj)
(format stream "[~<~A ~@{~A~^ ~_~}~:>]" (rest obj)))
(set-pprint-dispatch 'blist-type
#'pprint-blist)
The third form complains that
"The value BLIST-TYPE is not of type LIST.
[Condition of type TYPE-ERROR]"
I see in the release notes that SET-PPRINT-DISPATCH does some more checking
now. Was this code never legal? Is there a better way to do this (other
than using the CONS type specifier directly)?
I've not used DEFTYPE a lot, and I've found surprisingly few examples of in
the spec, CLTL2, Graham, or Seibel.
TIA,
g

Stas Boukarev <stassats@...> writes:
> Christophe Rhodes <csr21@...> writes:
>
>> Stas Boukarev <stassats@...> writes:
>>
>>> Adam Jensen <hanzer@...> writes:
>>>
>>>> Hi, I built SBCL 1.2.11 on FreeBSD, OpenBSD, and Lubuntu by following the basic instructions in the INSTALL document:
>>>>
>>>> $ sh make.sh --prefix=$HOME/local
>>>> $ cd tests && sh run-tests.sh
>>>>
>>>> Only OpenBSD "reached end of run-tests.sh normally" (which I found a bit surprising - OpenBSD is typically the fussier one). I have two questions:
>>>>
>>>> 1) Is it significant that the test process failed on Linux and FreeBSD?
>>> Those tests are expected to fail.
>>
>> Well, hang on: they're not marked as expected to fail. I know that
>> sleep non-consing has been erratic, particularly on 32-bit platforms; I
>> wouldn't have expected the threads FP-inheritance to fail on Linux.
> I expect them to fail, and they always failed on those platforms.
Ok, it now ignores reserved status bits on x86. Sleep still needs to be
rewritten.
--
With best regards, Stas.

Christophe Rhodes <csr21@...> writes:
> Stas Boukarev <stassats@...> writes:
>
>> Adam Jensen <hanzer@...> writes:
>>
>>> Hi, I built SBCL 1.2.11 on FreeBSD, OpenBSD, and Lubuntu by following the basic instructions in the INSTALL document:
>>>
>>> $ sh make.sh --prefix=$HOME/local
>>> $ cd tests && sh run-tests.sh
>>>
>>> Only OpenBSD "reached end of run-tests.sh normally" (which I found a bit surprising - OpenBSD is typically the fussier one). I have two questions:
>>>
>>> 1) Is it significant that the test process failed on Linux and FreeBSD?
>> Those tests are expected to fail.
>
> Well, hang on: they're not marked as expected to fail. I know that
> sleep non-consing has been erratic, particularly on 32-bit platforms; I
> wouldn't have expected the threads FP-inheritance to fail on Linux.
I expect them to fail, and they always failed on those platforms.
--
With best regards, Stas.

Stas Boukarev <stassats@...> writes:
> Adam Jensen <hanzer@...> writes:
>
>> Hi, I built SBCL 1.2.11 on FreeBSD, OpenBSD, and Lubuntu by following the basic instructions in the INSTALL document:
>>
>> $ sh make.sh --prefix=$HOME/local
>> $ cd tests && sh run-tests.sh
>>
>> Only OpenBSD "reached end of run-tests.sh normally" (which I found a bit surprising - OpenBSD is typically the fussier one). I have two questions:
>>
>> 1) Is it significant that the test process failed on Linux and FreeBSD?
> Those tests are expected to fail.
Well, hang on: they're not marked as expected to fail. I know that
sleep non-consing has been erratic, particularly on 32-bit platforms; I
wouldn't have expected the threads FP-inheritance to fail on Linux.
Cheers,
Christophe

Adam Jensen <hanzer@...> writes:
> Hi, I built SBCL 1.2.11 on FreeBSD, OpenBSD, and Lubuntu by following the basic instructions in the INSTALL document:
>
> $ sh make.sh --prefix=$HOME/local
> $ cd tests && sh run-tests.sh
>
> Only OpenBSD "reached end of run-tests.sh normally" (which I found a bit surprising - OpenBSD is typically the fussier one). I have two questions:
>
> 1) Is it significant that the test process failed on Linux and FreeBSD?
Those tests are expected to fail.
--
With best regards, Stas.

Hello,
When I do:
CL> (acos -1)
I get
arithmetic error DIVISION-BY-ZERO signalled
[Condition of type DIVISION-BY-ZERO]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {25824BD1}>)
Backtrace:
0: (SB-KERNEL:TWO-ARG-/ -1.0d0 0.0d0)
1: (ACOS -1)
2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ACOS -1) #<NULL-LEXENV>)
3: (EVAL (ACOS -1))
I can see that src/code/irrat.lisp contains special code for win32, but I
don't understand why it should be there in the first place (some 20 lines
before, I see some comment, "Many of these are unnecessary on x86", which
confuses me even more).
I'm wondering if special cases should be added for -1 and 1 for acos and
asin, or if we could just get rid of the conditional ?
serge

Helmut Jarausch <jarausch@...> writes:
> Furthermore, is there any means to single step a program?
>
Hello Helmut, long ago I found this snippet.
It works for me, both in Slime and on the SBCL
command line. Hope it helps, kindest regards.
Andrea
(proclaim '(optimize (debug 3)))
(defun foo (a b) (* (+ a b) b))
(step (foo 1 2))

Hey,
I am dropped into the ldb with the message:
"Heap exhausted during garbage collection: 0 bytes available, 16
requested."
The message itself is clear. Though I have a hard time figuring out
where my memory is going to.
I tried to use the ldb command dump but I always get
"invalid Lisp-level address"
How can I use dump command?
Further is there a way to print a large block of used memory in a "human
readable" way to improve the understanding of what is cluttering the
memory?
E.g.
ldb> dump magicKeyWords
#0xFFFF OBJECTTYPEA
#0xFFFE OBJECTTYPEA
....
Any help or suggestions appreciated.
Regards,
Simon K.
PS: There is also an open stackoverflow question related to this
http://stackoverflow.com/questions/29678491/print-memory-block-when-dropped-into-ldb

Hello,
I am trying to call a foreign library (http://moveit.ros.org/) from
SBCL and am encountering an error that drops SBCL to LDB. The error
message is:
> Signal 13 masked
> fatal error encountered in SBCL pid 5200(tid 140737353881408):
> some deferrable signals blocked, some unblocked
As best I understand, this means that the foreign code has modified
the signal mask in a way that is unacceptable to SBCL.
This occurs during some foreign calls all the time. It also occurs
during Lisp compilation some of the time (after the foreign library is
loaded).
Based on this thread
<https://www.mail-archive.com/postmodern-devel@.../msg00309.html&gt;,
I tried wrapping the foreign calls between
(SB-THREAD::BLOCK-DEFERRABLE-SIGNALS) and
(SB-UNIX::UNBLOCK-DEFERRABLE-SIGNALS) which stops the problem there.
However, I still have the occasional errors during Lisp compilation.
Not sure if this matters, but I am running one SBCL thread and the
foreign library is creating a few additional threads.
I am attaching a backtrace from LDB.
Any insight on how to track down/resolve this from the SBCL side?
Thank you,
-ntd

Hi,
I have a code (not mine) running for years, but failing with recent versions of SBCL, starting with 1.2.9 or so.
I reduced the problem to the following minimal example:
(defpackage "TESTREAL"
(:use "COMMON-LISP")
(:shadow "REAL"))
(in-package "TESTREAL")
;, Re-establish CL::REAL type
(deftype real (&optional low high)
`(cl::real ,low ,high))
;; Re-establish CL::REAL class
(setf (find-class 'real) (find-class 'cl:real))
Loading the package twice (!) produces the following output (sbcl 1.2.10):
CL-USER> (load "testreal.lisp")
WARNING: redefining DEFTYPE type to be a class: TESTREAL::REAL
T
CL-USER> (load "testreal.lisp")
; Evaluation aborted on #<SB-INT:BUG "Type has a translator" {100A5D8143}>.
The code provides a function REAL, but also relies on the CL::REAL type and the built-in class REAL. I guess, for that reason the shadowing, the deftype statement and the (setf (find-class 'real)...) was added years ago.
Currently, my remedy is to change the last line into
(unless (find-class 'real NIL)
(setf (find-class 'real) (find-class 'cl:real)))
which seem to work, though I'm very unhappy with this workaround.
Though I do not think that this is a bug of SBCL but maybe not conformal code, is there an easy way to get it running again without opening the door to hell?
Thanks for any suggestions!

On 2014-02-18 08:19, Stas Boukarev wrote:
> Siebe de Vos<Siebe@...> writes:
>
>> Hi,
>>
>> From the spec on barriers: "The file "memory-barriers.txt" ... is
>> highly recommended reading for anyone programming at this level."
>>
>> Unfortunately 'this level' is not defined. Does it include cons and car?
>> Then it would affect any level of Common Lisp, and you need barriers
>> whenever you share places.
>>
>> This would be a simple test:
>>
>> (let ((shared (cons t nil)))
>> (sb-thread:make-thread (lambda ()
>> (loop
>> (let ((cons (cons nil nil)))
>> (setf (car cons) t
>> shared cons)))))
>> (sb-thread:make-thread (lambda ()
>> (loop
>> (assert (consp shared)
>> () "#'cons needs a barrier!")
>> (assert (car shared)
>> () "(setf car) needs a barrier!")))))
>>
>> Can it fail on SBCL?
> It does fail on PPC.
(Mr. Boukarev, I like your short and precise writing. It forces me to be
precise too.)
After one year I'm coming back to my question.
The first assertion, (CONSP SHARED), can fail in this way:
- page 1 is synchronized to other caches
- SHARED on page 1 is initialized with a new cons
- threads 1 and 2 are started
- page 1 is synchronized with thread 2
- thread 2 calls CONSP on the unsynchronized garbage in page1
Is this possible? (It would mean that a new thread is started with
memory unsynchronized.)
Assuming CONSP only looks at the tag of SHARED and doesn't follow a
pointer, it won't fail because of a race between the two started
threads. Correct?
The second assertion, (CAR SHARED) being true, can fail in this way:
- the binding of SHARED is in page 1
- a new cons with car NIL is allocated on page 2 and bound to CONS
- page 2 is synchronized with thread 2
- the car of the CONS is set to T and SHARED is set to CONS
- page 1 is synchronized with thread 2
- thread 2 sees the new cons (on page 1) still with car being NIL (on
page 2)
Correct?
Can you give any other reason for the second assertion to fail?
Thanks,
Siebe

On Sun, Mar 22, 2015 at 6:42 AM, <Meino.Cramer@...> wrote:
> Hi,
>
> I installed SBCL on my Gentoo Linux PC, which works fine.
>
> Next were my two Arietta G25 (www.acmesystems.it/arietta)
> boards with Gentoo Linux also (SOCs).
>
> According to /proc/cpuinfo:
> processor : 0
> model name : ARM926EJ-S rev 5 (v5l)
> BogoMIPS : 198.76
> Features : swp half thumb fastmult edsp java
> CPU implementer : 0x41
> CPU architecture: 5TEJ
> CPU variant : 0x0
> CPU part : 0x926
> CPU revision : 5
>
>
> The problem here is, that sbcl depends on sbcl or one of four other
> CL implementation for being bootstrapped.
>
> As a CL to compile sbcl I tried
>
> http://prdownloads.sourceforge.net/sbcl/sbcl-1.2.7-armel-linux-binary.tar.bz2
> installed it and called sbcl -- with ends with an "illegal hardware
> instrcution".
>
> Then I tried
>
> http://prdownloads.sourceforge.net/sbcl/sbcl-1.2.7-armhf-linux-binary.tar.bz2
> (which fails of course, too: /lib/ld-linux-armhf.so.3 isn't installed
> on that system, it is softfloat...)
>
> Then I tried cmucl (part of the Gentoo package management, but not
> intended to be compiled/used on this platform) -- which fails to compile.
>
> According to the SBCL web site GNU Common Lisp (gcl) is not suitable
> for bootstrapping sbcl -- it is the only one so far which I get compiled
> on the Arietta and started.
>
> How can I proceed from here?
> How can I install SBCL on the Ariettas successfully?
>
Your CPU doesn't have VFP, so, you can't.
--
With best regards, Stas.

Hi,
I installed SBCL on my Gentoo Linux PC, which works fine.
Next were my two Arietta G25 (www.acmesystems.it/arietta)
boards with Gentoo Linux also (SOCs).
According to /proc/cpuinfo:
processor : 0
model name : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 198.76
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5
The problem here is, that sbcl depends on sbcl or one of four other
CL implementation for being bootstrapped.
As a CL to compile sbcl I tried
http://prdownloads.sourceforge.net/sbcl/sbcl-1.2.7-armel-linux-binary.tar.bz2
installed it and called sbcl -- with ends with an "illegal hardware
instrcution".
Then I tried
http://prdownloads.sourceforge.net/sbcl/sbcl-1.2.7-armhf-linux-binary.tar.bz2
(which fails of course, too: /lib/ld-linux-armhf.so.3 isn't installed
on that system, it is softfloat...)
Then I tried cmucl (part of the Gentoo package management, but not
intended to be compiled/used on this platform) -- which fails to compile.
According to the SBCL web site GNU Common Lisp (gcl) is not suitable
for bootstrapping sbcl -- it is the only one so far which I get compiled
on the Arietta and started.
How can I proceed from here?
How can I install SBCL on the Ariettas successfully?
Thank you very much in advance for any help!
Best regards,
Meino

I've got a program that calls SB-POSIX:STAT to get file inumbers for
doing circular directory checking. After a suitably long execution
time, the program halts during the check. I interrupted the process to
see what was happening and got a memory corruption warning. Attached is
the terminal output.
Also, the program keeps halting upon getting to a directory (same
directory every time for same invocation... frame 5 in the backtrace).
I have this problem with another program that does lots of filesystem
querying, so I think it has something to do with the large number of
files I'm calling stat(2) on, but I'm not sure.
Sometimes after continuing from the interrupt I get dumped back onto the
REPL, as if the thread were being killed. Unsure if that's related.
Running on Mac 10.8 and 10.9 with SBCL 1.2.2. I'm gonna compile the
program for the current SBCL in a bit, just need to do the work day
first.

Hi there,
Below is a file which if you save as foo.lisp, start a command line
sbcl, and then follow the included instructions leads to the type error
shown, at least on my 64 bit Linux.
(Of course one would not normally do such a thing but I'm trying to
redefine a function in yason to return an fset map rather than a
hash-table and this is the smallest case I could make out of it).
My CLHS knowledge is not deep enough to tell me if this is conforming or
not. If it is conforming I'd appreciate some pointers to why and how it
is.
If it is not I'd appreciate some advice on how best to work around it.
Many thanks,
Greg
----
(in-package :cl-user)
(defun foo ()
nil)
(defun bar ()
(let ((value (foo)))
value))
#|||
This is SBCL 1.2.4.debian, an implementation of ANSI Common Lisp.
* (compile-file "foo.lisp")
(compile-file "foo.lisp")
; compiling file "/tmp/foo.lisp" (written 19 MAR 2015 09:06:45 PM):
; compiling (IN-PACKAGE :CL-USER)
; compiling (DEFUN FOO ...)
; compiling (DEFUN BAR ...)
#P"/tmp/foo.fasl"
* (load "foo")
T
* (bar)
NIL
* (defun foo () 7)
STYLE-WARNING: redefining COMMON-LISP-USER::FOO in DEFUN
FOO
* (bar)
debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {10039CE4E3}>:
The value 7 is not of type NULL.
|||#

Sorry for bothering you.
I've tried to find some information on the web but didn't succeed.
I've found a bug report from 2012 and similar things.
I'd like to use SBCL (-1.2.9) together with SLIME.
First, I didn't manage to display the faulty source line,
e.g.
(defun gen-page-numbers (LastPage)
(declare (optimize debug))
(let ((offsets (make-array '(8) :element-type 'fixnum :initial-contents #1A(1 3 5 7 4 2 8 6))))
(do ((i 0 (1+ i))) ((>= i LastPage))
(multiple-value-bind (quot rem) (floor i 8)
(format t "~d " (+ (* quot 8) (aref offsets (* 8 rem))))
)
)
)
)
(gen-page-numbers 253)
gives
;; The value 8 is not of type (UNSIGNED-BYTE 3)
;; [Condition of type TYPE-ERROR]
which is cryptic (at least).
I tried to press v at SLIME's debugger's prompt but only the whole function flashes in yellow.
How can I see the faulty line (in this case I've found it by trial and error).
Furthermore, is there any means to single step a program?
Many thanks for some hints and pointers,
Helmut

SBCL doesn't directly offer either, though CLtL2 and the Meta-object
Protocol offer a way to implement them yourself.
Also sprach Helmut Jarausch on 2015-03-16:
> in "Successful Lisp" chapter 22 David Lamkins talks about
>
> ADVISE lets you modify a function's behavior
> without changing the function
I've been doing this with generic functions and a general disregard to
the standard and SBCL's safety mechanisms. It's resulted in lots of
Help!. SBCL offers SB-MOP:FUNCALLABLE-STANDARD-CLASS if you'd like to
not use generic functions, though you'll have to dynamically change them
into this the first time you call ADVISE on the function.
(Of course, if the function in question is already a generic function,
that's best and is actually part of Common Lisp the Language 2nd
Edition. I take it you want to treat normal functions as generic
functions. Otherwise, you should definitely use generic functions to
begin with. Remember you can specify the generic function and method
metaclasses and method combination in the DEFGENERIC form.)
If you'd like to give function redefinition a shot, the relevant
conditions are PROGRAM-ERROR (changing functions into generic functions)
and SB-EXT:SYMBOL-PACKAGE-LOCKED-ERROR (for redefining stuff in
COMMON-LISP).
Be ready to restart SBCL a lot.

Hi,
in "Successful Lisp" chapter 22 David Lamkins talks about
ADVISE lets you modify a function's behavior
without changing the function
and
WATCH lets you open a window on interesting variables
Has SBCL something similar?
Many thanks for a hint,
Helmut

Nikodemus and Christophe,
Thanks so much. Very helpful!
Windows 8 is griping about renaming a file to ".sbclrc". It does not like the file not having a name prior to the dot. I'll see if I can rename it using the command line.
Regardless, sbcl is now working now and finding the init file with the file being named "sbclrc". I needed to also set the Start In folder in the Windows 8 program shortcut link.
-----Original Message-----
From: Nikodemus Siivola [mailto:nikodemus@...]
Sent: Monday, March 16, 2015 3:32 AM
To: Christophe Rhodes
Cc: Rodgers, Stu; sbcl-help@...
Subject: Re: [Sbcl-help] Print location where sbcl is looking for userinit file
You can also ask SBCL where it is looking for it:
http://sbcl.org/manual/index.html#index-_002auserinit_002dpathname_002dfunction_002a
Eg.
(funcall sb-ext:*userinit-pathname-function*)
on Windows 8 the result is likely something like
#P"C:/Users/yourname/AppData/Roaming/.sbclrc"
(And should you want to customize this, save a core with
*userinit-pathname-function* set to your liking.)
On 9 March 2015 at 17:59, Christophe Rhodes <csr21@...> wrote:
> "Rodgers, Stu" <s.rodgers@...> writes:
>
>> Is there a function within sbcl to list or print the locations that
>> sbcl is searching for the userinit file?
>>
>> I am using sbcl on Windows 8. Starting sbcl with the command line
>> option --userinit, sbcl gives an error that it cannot find the
>> userinit file.
>
> *with* the option --userinit, SBCL should look for it in the location
> that you specify -- so
>
> sbcl --userinit C:/Desktop/sbclrc
>
> should look for that file. The default location is called `.sbclrc',
> in the directory your system treats as your home (maybe the value of
> your USERPROFILE environment variable?)
>
>> At this point I have littered the userinit file (sbclrc) around in
>> several places without sbcl finding it.
>
> careful, the userinit file is called `.sbclrc' (with the leading dot).
>
> Best,
>
> Christophe
>
> ----------------------------------------------------------------------
> -------- Dive into the World of Parallel Programming The Go Parallel
> Website, sponsored by Intel and developed in partnership with Slashdot
> Media, is your hub for all things parallel software development, from
> weekly thought leadership blogs to news, videos, case studies,
> tutorials and more. Take a look and join the conversation now.
> http://goparallel.sourceforge.net/
> _______________________________________________
> Sbcl-help mailing list
> Sbcl-help@...
> https://lists.sourceforge.net/lists/listinfo/sbcl-help

You can also ask SBCL where it is looking for it:
http://sbcl.org/manual/index.html#index-_002auserinit_002dpathname_002dfunction_002a
Eg.
(funcall sb-ext:*userinit-pathname-function*)
on Windows 8 the result is likely something like
#P"C:/Users/yourname/AppData/Roaming/.sbclrc"
(And should you want to customize this, save a core with
*userinit-pathname-function* set to your liking.)
On 9 March 2015 at 17:59, Christophe Rhodes <csr21@...> wrote:
> "Rodgers, Stu" <s.rodgers@...> writes:
>
>> Is there a function within sbcl to list or print the locations that
>> sbcl is searching for the userinit file?
>>
>> I am using sbcl on Windows 8. Starting sbcl with the command line
>> option --userinit, sbcl gives an error that it cannot find the
>> userinit file.
>
> *with* the option --userinit, SBCL should look for it in the location
> that you specify -- so
>
> sbcl --userinit C:/Desktop/sbclrc
>
> should look for that file. The default location is called `.sbclrc', in
> the directory your system treats as your home (maybe the value of your
> USERPROFILE environment variable?)
>
>> At this point I have littered the userinit file (sbclrc) around in
>> several places without sbcl finding it.
>
> careful, the userinit file is called `.sbclrc' (with the leading dot).
>
> Best,
>
> Christophe
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Sbcl-help mailing list
> Sbcl-help@...
> https://lists.sourceforge.net/lists/listinfo/sbcl-help

> I would like allocate memory suitable to processing via SSE/AVX
> instructions. If there a way to request that data part of
> a vector or matrix is aligned on 16 byte or 32 byte boundary.
> One way to do this is to allocate foreign memory. However,
> I would like to keep lage part of computation on Lisp side
> so I prefer Lisp object which can be passed to normal Lisp
> functions.
The static-vectors library can almost do that: I just need to use
posix_memalign() to allocate memory. I'll try to implement it this
weekend.
--
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
http://common-lisp.net/project/iolib