cosmos72 / stmx Goto Github PK
View Code? Open in Web Editor NEWHigh performance Transactional Memory for Common Lisp
Home Page: http://stmx.org/
High performance Transactional Memory for Common Lisp
Home Page: http://stmx.org/
Hi Massimiliano,
following code throws errors in SBCL:
(in-package #:tm-test)
(defvar test-fifo (make-instance 'tfifo))
(defun loop1 ()
(take test-fifo)
(loop1))
(defun loop2 (n)
(put test-fifo n)
(loop2 (1+ n)))
(defun take-thread ()
(sb-thread:make-thread #'loop1 :name "BFS"))
(defun put-thread ()
(sb-thread:make-thread #'loop2 :name "BFS" :arguments '(1)))
There are two types of error messages popping up. The first is the most common one. The second one only showed up once:
I.)
The value NIL is not of type STMX::TLOG.
[Condition of type TYPE-ERROR]
Restarts:
0: [ABORT] Abort thread (#<THREAD "BFS" RUNNING {1003DF86E3}>)
Backtrace:
0: (STMX::%RUN-SW-ATOMIC #<CLOSURE (LAMBDA NIL :IN STMX.UTIL:TAKE) {1003FADB4B}>)
1: (TM-TEST::LOOP1)
2: ((FLET #:WITHOUT-INTERRUPTS-BODY-1226 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
3: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
4: ((FLET #:WITHOUT-INTERRUPTS-BODY-660 :IN SB-THREAD::CALL-WITH-MUTEX))
5: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFF50AEC9B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR..
6: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "BFS" RUNNING {1003DF86E3}> #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX #<SB-THREAD:MUTEX (fre..
7: ("foreign function: call_into_lisp")
8: ("foreign function: new_thread_trampoline")
II.)
BUG! Transaction 4892 called (retry), but no TVARs to wait for changes.
This is a bug either in the STMX library or in the application code.
Possible reason: some code analogous to (atomic (retry)) was executed.
Such code is not allowed, because at least one TVAR or one TOBJ slot
must be read before retrying an ATOMIC block.
[Condition of type SIMPLE-ERROR]
Restarts:
0: [ABORT] Abort thread (#<THREAD "BFS" RUNNING {10060F0BC3}>)
Backtrace:
0: (STMX::LISTEN-TVARS-OF #<STMX::TLOG v-2 {1002CB4E33}>)
1: (STMX::WAIT-TLOG #<STMX::TLOG v5306 {1002CB4E33}>)
2: (STMX::%RUN-SW-ATOMIC #<CLOSURE (LAMBDA NIL :IN TAKE) {1002DF1C0B}>)
3: (LOOP1)
4: ((FLET #:WITHOUT-INTERRUPTS-BODY-1226 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
5: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
6: ((FLET #:WITHOUT-INTERRUPTS-BODY-660 :IN SB-THREAD::CALL-WITH-MUTEX))
7: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFF61F6C9B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR..
8: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "BFS" RUNNING {10060F0BC3}> #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX #<SB-THREAD:MUTEX (fre..
9: ("foreign function: call_into_lisp")
10: ("foreign function: new_thread_trampoline")
Any idea what I'm doing wrong?
Kind regards,
Hans-J.
Hi.
Since stmx is in quicklisp it is being tested by cl-test-grid on various lisp and OSes.
Here is the library test results page: http://common-lisp.net/project/cl-test-grid/library/stmx.html. The tests status links like "(LOAD stmx FAIL)" or "(LOAD stmx OK)" refer to the test process output stored in file.
As you can see, in quicklisp 2013-07-22 it started to fail loading on CCL due to error:
No MAKE-LOAD-FORM method is defined for #S(STMX.LANG:ATOMIC-COUNTER :VERSION 0 :LOCK #<RECURSIVE-LOCK "ATOMIC-COUNTER" [ptr @ #x1AA1880] #x30200134A2FD>)
It seems that stmx.lang:*current-thread*
special variable is not rebound, breaking interop with lparallel.
Example:
(ql:quickload :stmx)
(ql:quickload :lparallel)
(setf lparallel:*kernel* (lparallel:make-kernel 4))
(lparallel:future
(stmx:atomic 1))
raises condition:
* Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "lparallel" RUNNING
{100434F813}>:
STMX internal error!
stmx:*current-thread* contains a stale value:
found #<SB-THREAD:THREAD "main thread" RUNNING {1004AB01F3}>
expecting #<SB-THREAD:THREAD "lparallel" RUNNING {100434F813}>
Typical cause is:
new threads were created with implementation-specific functions,
as for example (sb-thread:make-thread) or (mp:process-run-function),
that do not apply thread-local bindings stored in
bordeaux-threads:*default-special-bindings*
Solution:
use (bordeaux-threads:make-thread) instead.
the following fixes it:
(defmacro lpar-atomic (&body body)
`(let ((stmx.lang:*current-thread* (lparallel.thread-util:current-thread)))
(stmx:atomic ,@body)))
(lparallel:future
(lpar-atomic 1))
though i'm not sure it is a correct approach.
Accorging to sources, i seems that *current-thread*
gets bound just once to (bt:current-thread)
SBCL version: 2.1.9
lparallel and stmx are from quicklisp 2021-08-07
Schmidh reported two different errors in issue #7. The first has been fixed (and the issue closed), the second is analyzed here:
Hi Massimiliano,
following code throws errors in SBCL:
(in-package #:tm-test)
(defvar test-fifo (make-instance 'tfifo))
(defun loop1 ()
(take test-fifo)
(loop1))
(defun loop2 (n)
(put test-fifo n)
(loop2 (1+ n)))
(defun take-thread ()
(sb-thread:make-thread #'loop1 :name "BFS"))
(defun put-thread ()
(sb-thread:make-thread #'loop2 :name "BFS" :arguments '(1)))
There are two types of error messages popping up. The first is the most common one. The second one only showed up once:
I.) [omitted, see issue #7]
II.)
BUG! Transaction 4892 called (retry), but no TVARs to wait for changes.
This is a bug either in the STMX library or in the application code.
Possible reason: some code analogous to (atomic (retry)) was executed.
Such code is not allowed, because at least one TVAR or one TOBJ slot
must be read before retrying an ATOMIC block.
[Condition of type SIMPLE-ERROR]
Restarts:
0: [ABORT] Abort thread (#<THREAD "BFS" RUNNING {10060F0BC3}>)
Backtrace:
0: (STMX::LISTEN-TVARS-OF #<STMX::TLOG v-2 {1002CB4E33}>)
1: (STMX::WAIT-TLOG #<STMX::TLOG v5306 {1002CB4E33}>)
2: (STMX::%RUN-SW-ATOMIC #<CLOSURE (LAMBDA NIL :IN TAKE) {1002DF1C0B}>)
3: (LOOP1)
4: ((FLET #:WITHOUT-INTERRUPTS-BODY-1226 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
5: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
6: ((FLET #:WITHOUT-INTERRUPTS-BODY-660 :IN SB-THREAD::CALL-WITH-MUTEX))
7: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFF61F6C9B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR..
8: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "BFS" RUNNING {10060F0BC3}> #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX #<SB-THREAD:MUTEX (fre..
9: ("foreign function: call_into_lisp")
10: ("foreign function: new_thread_trampoline")
Any idea what I'm doing wrong?
Kind regards,
Hans-J.
Numerous instances during test of TVAR-ID against a NIL argument.
DESCRIPTION: STMX Test Fail
CL-USER 1 > (ql:quickload :stmx)
To load "stmx":
Load 1 ASDF system:
stmx
; Loading "stmx"
(:STMX)
CL-USER 2 > (ql:quickload :stmx.test)
To load "stmx.test":
Load 1 ASDF system:
stmx.test
; Loading "stmx.test"
(:STMX.TEST)
CL-USER 3 > (fiveam:run! 'stmx.test:suite)
NIL
(#<IT.BESE.FIVEAM::UNEXPECTED-TEST-FAILURE 4270160C23>
#<IT.BESE.FIVEAM::UNEXPECTED-TEST-FAILURE 4270160C53>
#<IT.BESE.FIVEAM::UNEXPECTED-TEST-FAILURE 402006086B>
#<IT.BESE.FIVEAM::UNEXPECTED-TEST-FAILURE 4020067C6B>
#<IT.BESE.FIVEAM::UNEXPECTED-TEST-FAILURE 402006DBEB>)
NIL
IMPACT: Broken
URGENCY: Next Release
PRODUCT CONFIGURATION:
LispWorks 7.1.2
Process name: /Applications/LispWorks 7.1 (64-bit)/LispWorks (64-bit).app/Contents/MacOS/lispworks-7-1-0-amd64-darwin
ID: 61768 Started at: 2020/11/24 6:02:08
Save history:
1: lispworks-7-1-0-0-amd64-darwin-release-base
Saved by martin as lispworks-7-1-0-0-amd64-darwin-release-base, at 17 May 2017 18:56
2: lispworks-7-1-0-0-amd64-darwin-release-cocoa-shaken
Saved by martin as lispworks-7-1-0-0-amd64-darwin-release-cocoa-shaken, at 17 May 2017 19:13
3: lispworks-7-1-0-0-amd64-darwin-release-cocoa-shaken
Saved by martin as lispworks-7-1-0-amd64-darwin, at 16 Oct 2017 14:33
LispWorks 7.1.0
Loaded Modules: "SDLE-STORE", "NREGEX", "CHARSETS", "c-arrays",
"mt-random", "IRONCLAD", "ILLOGICAL-PATHNAMES", "dynamic-complete",
"describe", "inspector-values", "comm", "ASDF", "asdf", "UIOP",
"uiop"
Public patches: PATCH-ITSELF 1.19, CAPI-COCOA 1.15, CAPI 1.15,
COCOA 1.1, COMPILER 1.9, EDITOR 1.8, FLI 1.7, FULL 1.8, MP 1.1,
OBJC 1.2, SYSTEM64 1.6, SYSTEM 1.29, DELIVERY 1.0, COMM 1.4,
KW-TOOLS 1.0, ORACLE 1.0, SQL 1.0, PROLOG 1.0, SQLITE 1.0,
FOREIGN-PREPROCESSOR 1.0
Private patches: OBJC-INTERN-METHOD-SIGNATURE, COMM-ASYNC-IPV6,
COMM-AIO-SSL-READ
Foreign modules:
#<FLI::INTERNAL-MODULE :LISP : exports = 0>
#<FLI::INTERNAL-MODULE :CALLBACKS : exports = 0>
#<FLI::EXTERNAL-MODULE :CARBON-CORE {/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/CarbonCore}: handle = #<Pointer: FLI::MACH-HEADER-POINTER = #x00007FFF2F21C000>; exports = 2>
#<FLI::EXTERNAL-MODULE COMM::CRYPTO-LIBRARY {/usr/lib/libcrypto.dylib}: handle = #<Pointer: FLI::MACH-HEADER-POINTER = #x00007FFF65AC6000>; exports = 12>
#<FLI::EXTERNAL-MODULE COMM::OPENSSL-LIBRARY {/usr/lib/libssl.dylib}: handle = #<Pointer: FLI::MACH-HEADER-POINTER = #x00007FFF6719A000>; exports = 11>
#<FLI::EXTERNAL-MODULE :FFTLIB {/usr/local/lib64/liblispfft.dylib}: handle = #<Pointer: FLI::MACH-HEADER-POINTER = #x00000001000C3000>; exports = 1>
#<FLI::EXTERNAL-MODULE :SIGLAB : handle = #x00000000; exports = 0>
#<FLI::EXTERNAL-MODULE #P"/usr/local/lib64/liblispburg.dylib" : handle = #x00000000; exports = 0>
#<FLI::EXTERNAL-MODULE #P"/usr/local/lib64/liblispnrutil.dylib" : handle = #x00000000; exports = 0>
#<FLI::EXTERNAL-MODULE #P"/usr/local/lib64/liblispplotterstuff.dylib" : handle = #x00000000; exports = 0>
#<FLI::EXTERNAL-MODULE "/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation" {/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation}: handle = #<Pointer: FLI::MACH-HEADER-POINTER = #x00007FFF3046A000>; exports = 0>
#<FLI::EXTERNAL-MODULE "/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa" {/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa}: handle = #<Pointer: FLI::MACH-HEADER-POINTER = #x00007FFF2CF0B000>; exports = 0>
#<FLI::EXTERNAL-MODULE :DARWIN-LW-OBJC {/private/var/tmp/lwtemp_Arroyo_6176800habiB.dylib}: handle = #<Pointer: FLI::MACH-HEADER-POINTER = #x00000001000CF000>; exports = 0>
Signal Handlers
2 SYSTEM::SIGINT-HANDLER
13 SYSTEM::THE-NULL-FUNCTION
20 SYSTEM::GET-CHILDREN-INF
23 SYSTEM::THE-NULL-FUNCTION
30 MP::CALL-BREAK-OF-MP
31 MP::PANIC
Added features: (:ASDF-UNICODE
:COM.SD
:COM.RAL
:LISPWORKS5+
:LISPWORKS6+
:LISPWORKS7+
:NON-BASE-CHARS-EXIST-P
:OS-UNIX
:OS-MACOSX
:ASDF
:ASDF2
:ASDF3
:ASDF3.1
:ASDF3.2
:ASDF3.3
:QUICKLISP
:LW-ADD-ONS
:CL-PPCRE
:CL-WHO
:THREAD-SUPPORT
:CLOSER-MOP
:BORDEAUX-THREADS
:IRONCLAD-ASSEMBLY
:BSD
:64-BIT
:CFFI
CFFI-FEATURES:DARWIN
CFFI-FEATURES:UNIX
CFFI-FEATURES:X86-64
:STMX
:5AM)
HOST CONFIGURATION:
Arroyo.local (x86 PENTIUM_3), Darwin 19.6.0
LWSerialNumber: LWPRO0710111701174719
Site: Unknown
Backtrace:
Generation 7: 34926024 (0x214EDC8)
Cons 4891872 (0x4AA4E0)
Non-Pointer 3362056 (0x334D08)
Other 8453104 (0x80FBF0)
Symbol 2985936 (0x2D8FD0)
Function 14805312 (0xE1E940)
Non-Pointer-Static 26528 (0x67A0)
Mixed-Static 400536 (0x61C98)
Weak 680 (0x2A8)
-- Segments:
Cons 40B0038800 - 40B04E5000
Non-Pointer 40C0000800 - 40C0338000
Other 40D0038800 - 40D084B000
Symbol 40E0038800 - 40E0312000
Function 40F0038800 - 40F0E5A000
Non-Pointer-Static 4080000800 - 408010F000
Mixed-Static 400004E800 - 40001BD000
Weak 4100038800 - 4100039000
================================
Generation 6: 0 (0x0)
Generation 5: 0 (0x0)
Generation 4: 0 (0x0)
Generation 3: 35623808 (0x21F9380)
Cons 8461456 (0x811C90)
Non-Pointer 7944536 (0x793958)
Other 9316360 (0x8E2808)
Symbol 1388304 (0x152F10)
Function 8513024 (0x81E600)
Weak 128 (0x80)
-- Segments:
Cons 4220018800 - 4221019000
Non-Pointer 41F0000800 - 41F07EF000
Other 4200018800 - 4200A98000
Symbol 4210018800 - 4210960000
Function 4230018800 - 4231019000
Weak 4240018800 - 4240059000
================================
Generation 2: 18909296 (0x1208870)
Cons 5321216 (0x513200)
Non-Pointer 1398896 (0x155870)
Other 6396304 (0x619990)
Symbol 27984 (0x6D50)
Function 2736056 (0x29BFB8)
Non-Pointer-Static 3028552 (0x2E3648)
Weak 288 (0x120)
-- Segments:
Cons 4250010800 - 4251011000
Non-Pointer 4260000800 - 4261001000
Other 4270010800 - 4271011000
Symbol 4280010800 - 4280811000
Function 4290010800 - 4290811000
Non-Pointer-Static 4040000800 - 4040335000
Weak 42A0010800 - 42A0051000
================================
Generation 1: 4193720 (0x3FFDB8)
Cons 866752 (0xD39C0)
Non-Pointer 439848 (0x6B628)
Other 2863888 (0x2BB310)
Symbol 5760 (0x1680)
Function 16832 (0x41C0)
Weak 640 (0x280)
-- Segments:
Cons 42B0008800 - 42B03F1000
Non-Pointer 42C0000800 - 42C0159000
Other 42D0008800 - 42D03F1000
Symbol 4070008800 - 407000A000
Function 42E0008800 - 42E003B000
Weak 42F0008800 - 42F0009000
================================
Generation 0: 4984944 (0x4C1070)
Cons 682112 (0xA6880)
Non-Pointer 3365584 (0x335AD0)
Other 908832 (0xDDE20)
Function 28416 (0x6F00)
-- Segments:
Cons 4010000800 - 401040B000
Non-Pointer 4030000800 - 4030478000
Other 4020000800 - 402040B000
Symbol 4140000800 - 4140101000
Function 4060000800 - 406011E000
Weak 4170000800 - 4170041000
================================
Total allocated 98637792 (0x5E117E0), total size 206098432 (0xC48D000)
the following error occurs
caught ERROR:
; READ error during COMPILE-FILE:
;
; Lock on package SB-VM violated when interning EMIT-SKIP while in package
; SB-X86-64-ASM.
as a workaround, it appears possible to define the function with #'sb-assem::%emit-skip as its value.
Lawyering aside, what's the intention?
If, as I assume, your intention is to have LGPL on all new or rewritten code, and BSD on the inherited code, it would be really nice if they were more clearly separated. (One licence per file would simplify things a lot.)
If the intention is to have everything under LGPL, then a single LICENSE or COPYING file which states that, and then includes text of the original licenses as would clarify things a lot. (Though BSD license used by Huan Ton-That does not permit relicencing, so to remove the BSD-style permissions from their code you'd need to get their permission if you don't have that already.)
I also find inclusion of COPYING.GPL in the tree confusing. Which parts are GPL and which are LGPL? I assume nothing is under GPL, but this is not clear, and really needs to be clarified.
Equaly confusing is that COPYING.BSD refers to Marco Baringer and not Hoan Ton-That. :) I assume this is just a snafu.
Anyways, VERY nice work overall! (Feel free to ignore this license nitpickery, just wanted to let you know that it's sufficiently confusing that I would need to clarification before using this for reals.)
stmx sometimes fails to compile on ECL
Here is the command which removes FASL files of stmx, and then runs ECL to ql:quickload stmx:
rm -rf ~/.cache/common-lisp/ecl-13.5.1-unknown-linux-i686/home/testgrid/quicklisp/dists/quicklisp/software/stmx-stable-5bb5051b-git/ && rlwrap ./lisps/ecl-bin-13.5.1/bin/ecl -eval '(ql:quickload :stmx)' -eval '(quit)'
;;; Loading "/home/testgrid/quicklisp/setup.lisp"
;;; Loading #P"/home/testgrid/lisps/ecl-bin-13.5.1/lib/ecl-13.5.1/cmp.fas"
;;; Loading #P"/home/testgrid/lisps/ecl-bin-13.5.1/lib/ecl-13.5.1/asdf.fas"
To load "stmx":
Load 1 ASDF system:
stmx
; Loading "stmx"
[package stmx.lang]..
;;; Error:
;;; in file thread.lisp, position 1836
;;; at (EVAL-WHEN (COMPILE-TOPLEVEL) ...)
;;; * The form (PROGN (DEFVAR *TESTED-JOIN-THREAD* NIL) (UNLESS *TESTED-JOIN-THREAD* (SETF *TESTED-JOIN-THREAD* T) (LET ((X (GENSYM))) (WHEN (EQ X (JOIN-THREAD (MAKE-THREAD (LAMBDA NIL X)))) (ADD-FEATURE 'BT.JOIN-THREAD-IS-SANE))))) was not evaluated successfully.
;;; Error detected:
;;; There is no support for this method on this implementation.An error occurred during initialization:
COMPILE-FILE-ERROR while compiling #<cl-source-file "stmx" "lang" "thread">.
This is ECL release 13.5.1 on linux.
I get this:
; caught ERROR:
; READ error during COMPILE-FILE: Lock on package SB-VM violated when interning OFFSET-NEXT while in package SB-TRANSACTION.
More info is here: http://report.quicklisp.org/2016-01-11/failure-report/stmx.html#stmx
Build log is here: http://report.quicklisp.org/2018-07-27/failure-report/stmx.html#stmx
I get this build failure today:
; caught ERROR:
; READ error during COMPILE-FILE: Symbol "DEFINE-ARG-TYPE" not found in the SB-DISASSEM package
Edited: Sorry, it only happened to SBCL 1.3.0.
Please find below the stack trace I got:
; Loading "stmx"
;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; Lock on package SB-VM violated when interning OFFSET-NEXT while in package
; SB-TRANSACTION.
; See also:
; The SBCL Manual, Node "Package Locks"
;
; (in form starting at line: 18, column: 0, position: 601)
debugger invoked on a UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread
#<THREAD "main thread" RUNNING {1002A4C6F3}>:
COMPILE-FILE-ERROR while
compiling #<CL-SOURCE-FILE "stmx" "sb-transaction" "x86-64-insts">
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RETRY ] Retry
compiling #<CL-SOURCE-FILE "stmx" "sb-transaction" "x86-64-insts">.
1: [ACCEPT ] Continue, treating
compiling #<CL-SOURCE-FILE "stmx" "sb-transaction" "x86-64-insts">
as having been successful.
2: Retry ASDF operation.
3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
configuration.
4: [ABORT ] Give up on "stmx"
5: Exit debugger, returning to top level.
(UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "stmx" "sb-transaction" "x86-64-insts">)))
0]
Any ideas how to fix it?
Ha-Duong
Which does not exist if I'm not mistaken :)
http://report.quicklisp.org/2020-09-28/failure-report/stmx.html#stmx has the log. I get this:
; READ error during COMPILE-FILE: Lock on package SB-VM violated when interning EAX-OFFSET while in package STMX.ASM.
Tried using map-ghash, surprised to see it actually wasn't implemented. Looks like do-ghash is what should be used instead?
The code already adds (:optimize-slot-access nil) to transactional classes, but when such a class is inherited from non-transactional class and overrides a slot to make it transactional, it needs to ensure that all accesses to this slot are not optimized.
For example, the class stmx.util:tmap overrides the slot root which is inherited from stmx.util:gmap via stmx.util:rbmap, and make it transactional. But when an object of class stmx.util:tmap is passed to the method stmx.util::gmap/rebalance-after-insert on stmx.util:rbmap, it may set the root slot, and this access is optimized, because it is on an instance stmx.util:rbmap, which allows optimizations. LispWorks optimizes slot-value and (setf slot-value) on the arguments of methods when the specializer class allows it (not documented properly). To prevent that, stmx.util:rbmap needs to have (:optimize-slot-access nil) too. In principle stmx.util:gmap needs it too, but there are no slot-value accesses to root in a method specilizes on stmx.util:gmap, so this does not causes problem.
To pass the tests, we (LispWorks ltd) also needed to add it to stmx.util:ghash-table. With these two fixes, all the tests in stmx.test work,but really all classes with slots that are overriden to transactional need to either have (:optimize-slot-access nil), or ensure that they don't use slot-value on any of these slots in any ofthe methods that specialize on them.
Dear Massimiliano Ghilardi,
My apologies for this improper issue. Please disregard if it is inappropriate. I just want to thank you for your hardwork in creating, actively developing, and maintaining this awesome project. I have used STMX in my recent projects with great success. I'd like to donate to the project as my expression of gratitude. Would you accept any form of donation?
Best regards,
Duong
stmx testsuite sometimes hangs on ECL, sometimes crashes with "out of memory" error.
http://common-lisp.net/project/cl-test-grid/library/stmx.html
Trying to use STMX version 0.9.4 with Clozure Common Lisp 1.9 (linux x64), while executing (ql:quickload "stmx") definining the transactional class
(transactional
(defclass tcell ()
((value :accessor value-of
:initarg :value
:initform empty-tcell))))
fails with:
Undefined function (SETF CCL:SLOT-DEFINITION-TYPE) called with arguments (T #<TRANSACTIONAL-EFFECTIVE-SLOT for instance slot VALUE #x19238EBE>) .
[Condition of type CCL::UNDEFINED-FUNCTION-CALL]
Restarts:
0: [CONTINUE] Retry applying (SETF CCL:SLOT-DEFINITION-TYPE) to (T #<TRANSACTIONAL-EFFECTIVE-SLOT for instance slot VALUE #x19238EBE>).
1: [USE-VALUE] Apply specified function to (T #<TRANSACTIONAL-EFFECTIVE-SLOT for instance slot VALUE #x19238EBE>) this time.
2: [STORE-VALUE] Specify a function to use as the definition of (SETF CCL:SLOT-DEFINITION-TYPE).
3: [RETRY] Retry SLIME REPL evaluation request.
4: [*ABORT] Return to SLIME's top level.
5: [ABORT-BREAK] Reset this thread
6: [ABORT] Kill this thread
Backtrace:
0: ((CCL:COMPUTE-EFFECTIVE-SLOT-DEFINITION (TRANSACTIONAL-CLASS T T)) #<TRANSACTIONAL-CLASS TCELL> VALUE (#<TRANSACTIONAL-DIRECT-SLOT for instance slot VALUE #x19190436>))
1: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD CCL:COMPUTE-EFFECTIVE-SLOT-DEFINITION (TRANSACTIONAL-CLASS T T)> ..) -43201916)
2: (NIL #<Unknown Arguments>)
3: (#<CCL::STANDARD-KERNEL-METHOD CCL:COMPUTE-SLOTS (CCL::SLOTS-CLASS)> #<TRANSACTIONAL-CLASS TCELL>)
4: (CCL::%CALL-NEXT-METHOD (NIL #<CCL::STANDARD-KERNEL-METHOD CCL:COMPUTE-SLOTS (CCL::SLOTS-CLASS)> . -43201872))
5: (#<CCL::STANDARD-KERNEL-METHOD CCL:COMPUTE-SLOTS :AROUND (CCL::STD-CLASS)> #<TRANSACTIONAL-CLASS TCELL>)
6: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<CCL::STANDARD-KERNEL-METHOD CCL:COMPUTE-SLOTS :AROUND (CCL::STD-CLASS)> #<CCL::STANDARD-KERNEL-METHOD CCL:COMPUTE-SLOTS (CCL::SLOTS-CLASS)>) -43201872)
7: (NIL #<Unknown Arguments>)
8: (CCL::UPDATE-CLASS #<TRANSACTIONAL-CLASS TCELL> T)
9: (CCL::UPDATE-CLASS #<TRANSACTIONAL-CLASS TCELL> NIL)
...
It usually only happens when tests are executed in a batch. Failure details:
key
(#S(HASH-TABLE :TEST EQUALP (2 . 1)) . #S(HASH-TABLE :TEST EQUALP (1 . 2)))
(#S(HASH-TABLE :TEST EQUALP (1 . 2)) . #S(HASH-TABLE :TEST EQUALP (2 . 1)))) has value 18 in GHASH-TABLE, but is missing from HASH-TABLE.
The broken link "dining philosophers" at
points to
https://github.com/cosmos72/stmx/blob/master/example/dining-philosophers-stmx.lisp
Same as (or similar to) #17 - with the latest SBCL git checkout, and the latest stmx checkout, I get a failure due to package locks on sb-vm.
It looks to me like (stmx.asm::compile-if-instruction-defined 'xbegin)
evaluates to (:OR)
and combined with #-
it tries to read the form that references sb-vm::emit-skip
.
Build log here: http://report.quicklisp.org/2020-02-24/failure-report/stmx.html#stmx
Hi.
When trying to compile STMX with SBCL 2.3.5 on GNU/Linux x86-64, I get the following error:
; compiling file "/gnu/store/ij4dkw97l4mmx873a9n7jv276x92z2hp-sbcl-stmx-2.0.5-2.f71e742/share/common-lisp/sbcl/stmx/asm/transaction.lisp" (written 01 JAN 1970 12:00:00 AM):
Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD tid=28 "main thread" RUNNING
{10013D8003}>:
#<SB-C:TN t1 :NORMAL> is not valid as the first result to VOP:
%XBEGIN
Primitive type: T
SC restrictions:
(SB-VM::UNSIGNED-REG)
The primitive type disallows these loadable SCs:
(SB-VM::UNSIGNED-REG)
Backtrace for: #<SB-THREAD:THREAD tid=28 "main thread" RUNNING {10013D8003}>
[...]
11: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "DEFUN TRANSACTION-BEGIN" {1007DBDC83}>)
[...]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.