[armedbear-devel] The value :LONG is not of type (MEMBER NIL :BOOLEAN)

Chun Tian (binghe) binghe.lisp at gmail.com
Mon Mar 21 11:10:14 UTC 2011


Hi, Alessio

Thank you for pointing out this. You're right.  IF I temporary removed the LOGAND form and just return the inner ATOMIC-INCF form, then everything goes well, compilation can pass.

The next issue happens in a file which has some method definitions, ABCL report "Register 4 contains wrong type" when loading a just compiled .abcl file:

; Loading #P"/Users/binghe/.cache/common-lisp/abcl-0.26.0-dev-svn-13251-fasl37-macosx-java/Users/binghe/Lisp/cl-net-snmp/snmp/branches/6/snmp-get.abcl" ...

; Compilation unit finished
;   Caught 1 STYLE-WARNING condition

java.lang.VerifyError: (class: org/armedbear/lisp/ASDF_TMP_snmp_get_1, method: execute signature: (Lorg/armedbear/lisp/LispObject;Lorg/armedbear/lisp/LispObject;Lorg/armedbear/lisp/LispObject;Lorg/armedbear/lisp/LispObject;)Lorg/armedbear/lisp/LispObject;) Register 4 contains wrong type
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
	at java.lang.Class.getConstructor0(Class.java:2699)
	at java.lang.Class.newInstance0(Class.java:326)
	at java.lang.Class.newInstance(Class.java:308)
	at org.armedbear.lisp.FaslClassLoader.loadFunction(FaslClassLoader.java:111)
	at org.armedbear.lisp.FaslClassLoader$pf_get_fasl_function.execute(FaslClassLoader.java:149)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.Lisp.evalCall(Lisp.java:547)
	at org.armedbear.lisp.Lisp.eval(Lisp.java:505)
	at org.armedbear.lisp.Lisp.evalCall(Lisp.java:542)
	at org.armedbear.lisp.Lisp.eval(Lisp.java:505)
	at org.armedbear.lisp.Load.faslLoadStream(Load.java:608)
	at org.armedbear.lisp.Load$init_fasl.execute(Load.java:414)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.Lisp.evalCall(Lisp.java:547)
	at org.armedbear.lisp.Lisp.eval(Lisp.java:505)
	at org.armedbear.lisp.Load.loadStream(Load.java:575)
	at org.armedbear.lisp.Load.loadFileFromStream(Load.java:531)
	at org.armedbear.lisp.Load.load(Load.java:198)
	at org.armedbear.lisp.Load.load(Load.java:683)
	at org.armedbear.lisp.Load$_load.execute(Load.java:633)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:825)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:688)
	at org.armedbear.lisp.load_1.execute(load.lisp:33)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:101)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.Primitives$pf_apply.execute(Primitives.java:2799)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:801)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.map_1.execute(map.lisp:33)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:124)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:813)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:670)
	at org.armedbear.lisp.asdf_389.execute(asdf.lisp:1965)
	at org.armedbear.lisp.clos_308.execute(clos.lisp:1950)
	at org.armedbear.lisp.clos_287.execute(clos.lisp:1718)
	at org.armedbear.lisp.StandardGenericFunction.execute(StandardGenericFunction.java:138)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:801)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.asdf_391.execute(asdf.lisp:1972)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.clos_312.execute(clos.lisp:2064)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.asdf_394.execute(asdf.lisp:1975)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:92)
	at org.armedbear.lisp.asdf_396.execute(asdf.lisp:1975)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.Primitives$pf_apply.execute(Primitives.java:2802)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:801)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.asdf_393.execute(asdf.lisp:1975)
	at org.armedbear.lisp.clos_310.execute(clos.lisp:2059)
	at org.armedbear.lisp.clos_287.execute(clos.lisp:1718)
	at org.armedbear.lisp.StandardGenericFunction.execute(StandardGenericFunction.java:138)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:801)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.asdf_448.execute(asdf.lisp:2105)
	at org.armedbear.lisp.compiler_pass2_374.execute(compiler-pass2.lisp:7474)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:620)
	at org.armedbear.lisp.Java$pf_jrun_exception_protected.execute(Java.java:1228)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:790)
	at org.armedbear.lisp.compiler_pass2_370.execute(compiler-pass2.lisp:7474)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:101)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:790)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.asdf_447.execute(asdf.lisp:2105)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:112)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.Primitives$pf_apply.execute(Primitives.java:2802)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:801)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.asdf_446.execute(asdf.lisp:2105)
	at org.armedbear.lisp.clos_308.execute(clos.lisp:1950)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.clos_297.execute(clos.lisp:1884)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:801)
	at org.armedbear.lisp.clos_290.execute(clos.lisp:1718)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:112)
	at org.armedbear.lisp.StandardGenericFunction.execute(StandardGenericFunction.java:138)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:653)
	at org.armedbear.lisp.Lisp.funcall(Lisp.java:166)
	at org.armedbear.lisp.Primitives$pf_apply.execute(Primitives.java:2850)
	at org.armedbear.lisp.Primitive.execute(Primitive.java:148)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:825)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:688)
	at org.armedbear.lisp.asdf_462.execute(asdf.lisp:2171)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:101)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.Lisp.evalCall(Lisp.java:540)
	at org.armedbear.lisp.Lisp.eval(Lisp.java:505)
	at org.armedbear.lisp.Primitives$pf__eval.execute(Primitives.java:345)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.Lisp.evalCall(Lisp.java:540)
	at org.armedbear.lisp.Lisp.eval(Lisp.java:505)
	at org.armedbear.lisp.Lisp.progn(Lisp.java:674)
	at org.armedbear.lisp.Primitives$sf_block.execute(Primitives.java:3741)
	at org.armedbear.lisp.Lisp.eval(Lisp.java:495)
	at org.armedbear.lisp.Lisp.progn(Lisp.java:674)
	at org.armedbear.lisp.Closure.bindParametersAndExecute(Closure.java:451)
	at org.armedbear.lisp.Closure.execute(Closure.java:484)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.Lisp$1.execute(Lisp.java:276)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:790)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:636)
	at org.armedbear.lisp.top_level_50.execute(top-level.lisp:415)
	at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:92)
	at org.armedbear.lisp.Symbol.execute(Symbol.java:780)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:620)
	at org.armedbear.lisp.top_level_51.execute(top-level.lisp:423)
	at org.armedbear.lisp.LispThread.execute(LispThread.java:620)
	at org.armedbear.lisp.Interpreter.run(Interpreter.java:353)
	at org.armedbear.lisp.Main$1.run(Main.java:48)
	at java.lang.Thread.run(Thread.java:680)
#<THREAD "interpreter" {2FEE9422}>: Debugger invoked on condition of type ERROR
  Caught java.lang.VerifyError: (class: org/armedbear/lisp/ASDF_TMP_snmp_get_1, method: execute signature: (Lorg/armedbear/lisp/LispObject;Lorg/armedbear/lisp/LispObject;Lorg/armedbear/lisp/LispObject;Lorg/armedbear/lisp/LispObject;)Lorg/armedbear/lisp/LispObject;) Register 4 contains wrong type.
Restarts:
  0: TOP-LEVEL Return to top level.
[1] CL-USER(10): :bt 16

  0: (SYSTEM:BACKTRACE)
  1: (INVOKE-DEBUGGER #<ERROR {27E33378}>)
  2: org.armedbear.lisp.Lisp.error(Lisp.java:373)
  3: org.armedbear.lisp.Lisp$1.execute(Lisp.java:305)
  4: org.armedbear.lisp.Symbol.execute(Symbol.java:790)
  5: org.armedbear.lisp.LispThread.execute(LispThread.java:636)
  6: org.armedbear.lisp.top_level_50.execute(top-level.lisp:415)
  7: org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:92)
  8: org.armedbear.lisp.Symbol.execute(Symbol.java:780)
  9: org.armedbear.lisp.LispThread.execute(LispThread.java:620)
 10: org.armedbear.lisp.top_level_51.execute(top-level.lisp:423)
 11: org.armedbear.lisp.LispThread.execute(LispThread.java:620)
 12: org.armedbear.lisp.Interpreter.run(Interpreter.java:353)
 13: org.armedbear.lisp.Main$1.run(Main.java:48)
 14: java.lang.Thread.run(Thread.java:680)
 15: (APPLY
 #<FUNCTION {1785F0D}>
 (#<ASDF:COMPILE-OP NIL {5A84F3C}>
  #<ASDF:CL-SOURCE-FILE "snmp" "snmp-get">))

Do you have any idea about this? i.e. What's "Register 4"?

--binghe

在 2011-3-21,18:54, Alessio Stalla 写道:

> 2011/3/21 Chun Tian (binghe) <binghe.lisp at gmail.com>:
>> Hi, Mark
>> 
>> The problem definition in the pdu.lisp is this two:
>> 
>> #-portable-threads
>> (defmethod generate-request-id ((pdu common-pdu))
>>  (with-slots (request-id-counter) pdu
>>    (the (unsigned-byte 32)
>>         (logand (incf request-id-counter) #xffffffff))))
>> 
>> #+portable-threads
>> (defmethod generate-request-id ((pdu common-pdu))
>>  (with-slots (request-id-counter) pdu
>>    (the (unsigned-byte 32)
>>         (logand (portable-threads:atomic-incf request-id-counter) #xffffffff))))
>> 
>> The only difference between two versions, is the use of INCF being replaced to ATOMIC-INCF, which is a thread-safe version of INCF.
>> 
>> If I always use the first version in ABCL (there's another similar method in message.lisp), than ABCL can pass this, and directly goes to the second issue (it's definitely CLOS related, I think)...
>> 
>> I wrote some basic extension code for GBBopen's portable-threads.lisp to support threading in ABCL (no cond var), and the form
>> 
>>        (portable-threads:atomic-incf request-id-counter)
>> 
>> will be macro-expanded into
>> 
>>        (PORTABLE-THREADS:AS-ATOMIC-OPERATION (INCF REQUEST-ID-COUNTER 1))
>> 
>> then
>> 
>>        (PORTABLE-THREADS:WITH-LOCK-HELD (PORTABLE-THREADS::*ATOMIC-OPERATION-LOCK*) (INCF REQUEST-ID-COUNTER 1))
>> 
>> and then (simplified)
>> 
>>        (THREADS:WITH-MUTEX (PORTABLE-THREADS::*ATOMIC-OPERATION-LOCK*)
>>          (INCF REQUEST-ID-COUNTER 1))
>> 
>> Consider ATOMIC-INCF itself works just right. I think maybe ABCL compiler cannot handle a macro form inside method definition quite well, shouldn't be CLOS/MOP's fault.
> 
> I don't think this has anything to do with CLOS at all, it's probably
> some bug in the compilation of the logand form.





More information about the armedbear-devel mailing list