I checked User Diagnostic Report. And I found the following lines:
Thread 7 Crashed:
0 com.apple.CoreFoundation 0x00007fff8fab52d5 __CFInitialize + 69
1 dyld 0x00007fff6f56d256
So I googled "CoreFoundation". It said that CoreFoundation must be loaded by the main thread, otherwise it would signal SIGTRAP. It's a rule of OS X.
See: Debugging a crash when a library is opened via dlopen on OSX
In bare SBCL, ql:quickload
is directly evaluated in the main thread. But under SLIME, forms are evaluated with a separated thread started by SWANK.
The solution is to evaluate (ql:quickload "clsql-postgresql")
in *inferior-lisp*
, instead of *slime-repl*
, when libpg is the first foreign library depending on CoreFoundation to be loaded.