JVM Crash due to `EXCEPTION_ACCESS_VIOLATION` in org.infinispan.util.concurrent.jdk8backported.LongAdder - jboss

This is happening on JBoss EAP 6.1, for single user it works fine, But as soon as 2 or 3 concurrent user start interacting with the application, JVM gets crashed.
The JVM is crashing with EXCEPTION_ACCESS_VIOLATION; the full trace is below:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x024c8266, pid=5136, tid=8736
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) Client VM (20.45-b01 mixed mode windows-x86 )
# Problematic frame:
# J org.infinispan.util.concurrent.jdk8backported.LongAdder.add(J)V
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x6602dc00): JavaThread "http-ds-7071bc90200f..corp.in/10.112.70.75:8080-6" daemon [_thread_in_Java, id=8736, stack(0x663a0000,0x663f0000)]
siginfo: ExceptionCode=0xc0000005, reading address 0x8ddb6987
Registers:
EAX=0x00000002, EBX=0xffffffff, ECX=0x00000001, EDX=0x0ddb6988
ESP=0x663ee3c0, EBP=0x663eea58, ESI=0x0ddb60a0, EDI=0xffffffff
EIP=0x024c8266, EFLAGS=0x00010293
Top of Stack: (sp=0x663ee3c0)
0x663ee3c0: 0ddb4830 00000000 663eea58 024d2b44
0x663ee3d0: 0ddb1610 0ddb1610 663eea58 024d7368
0x663ee3e0: 0ddb4830 00000000 0ddb1610 0ddb6be0
0x663ee3f0: 22239910 0ddb1610 2223aff0 22239910
0x663ee400: 0ddb60a0 2223c338 2127c660 24bb6ca8
0x663ee410: 24c1f6e0 0ddb6070 00000002 0ddb6988
0x663ee420: 4ac892b3 0ddb1610 663eea58 024d5bf4
0x663ee430: 00000000 00000000 663eea58 024c5a0c
Instructions: (pc=0x024c8266)
0x024c8246: 0c 00 00 00 b8 01 00 00 00 8b f7 e9 5b 00 00 00
0x024c8256: 8b bc 24 80 00 00 00 8b 9c 24 84 00 00 00 3b 02
0x024c8266: f2 0f 10 82 ff ff ff 7f 66 0f 7e c6 66 0f 73 d0
0x024c8276: 20 66 0f 7e c0 8b d6 8b c8 03 d7 13 cb 89 34 24
Register to memory mapping:
EAX=0x00000002 is an unknown value
EBX=0xffffffff is an unknown value
ECX=0x00000001 is an unknown value
EDX=
[error occurred during error reporting (printing register info), id 0xc0000005]
Stack: [0x663a0000,0x663f0000], sp=0x663ee3c0, free space=312k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J org.infinispan.util.concurrent.jdk8backported.LongAdder.add(J)V
j org.infinispan.CacheImpl.put(Ljava/lang/Object;Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;JLjava/util/concurrent/TimeUnit;Ljava/util/EnumSet;Ljava/lang/ClassLoader;)Ljava/lang/Object;+24
j org.infinispan.CacheImpl.put(Ljava/lang/Object;Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;+12
j org.infinispan.CacheSupport.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+17
j org.infinispan.AbstractDelegatingCache.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+6
j org.infinispan.spring.provider.SpringCache.put(Ljava/lang/Object;Ljava/lang/Object;)V+6
j com.hmtp.security.server.util.SessionTokenValidator.refreshAccessTime(Ljava/lang/String;)V+25
j com.hmtp.security.server.util.SessionTokenValidator.checkAndRenewToken([Ljava/lang/String;)Lorg/springframework/security/web/authentication/rememberme/PersistentRememberMeToken;+174
j com.hmtp.security.server.auth.MultiTenantRememberMeServices.processAutoLoginCookie([Ljava/lang/String;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/security/core/userdetails/UserDetails;+5
j org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices.autoLogin(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/security/core/Authentication;+64
j com.hmtp.common.security.server.BrownstoneRememberMeAuthenticationFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+20
J org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
J org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
J org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
J org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
J org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
J org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
J org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
j org.springframework.security.web.FilterChainProxy.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+40
j org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(Ljavax/servlet/Filter;Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+5
j org.springframework.web.filter.DelegatingFilterProxy.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+71
J org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
J org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V
j org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+200
j org.jboss.as.web.session.ClusteredSessionValve.handleRequest(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;Lorg/jboss/servlet/http/HttpEvent;Z)V+61
j org.jboss.as.web.session.ClusteredSessionValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+26
j org.jboss.as.web.session.JvmRouteValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+33
j org.jboss.as.web.session.LockingValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+43
j org.jboss.as.web.security.SecurityContextAssociationValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+402
J org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V
j org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
j org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+188
j org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)Lorg/apache/tomcat/util/net/JIoEndpoint$Handler$SocketState;+349
j org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Lorg/apache/tomcat/util/net/JIoEndpoint$Handler$SocketState;+65
j org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+128
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
V [jvm.dll+0xfb88b]
V [jvm.dll+0x18d551]
V [jvm.dll+0xfba31]
V [jvm.dll+0xfba8b]
V [jvm.dll+0xb5e89]
V [jvm.dll+0x119b74]
V [jvm.dll+0x14217c]
C [msvcr71.dll+0x9565] endthreadex+0xa0
C [kernel32.dll+0x4ee6c] BaseThreadInitThunk+0x12
C [ntdll.dll+0x6399b] RtlInitializeExceptionChain+0xef
C [ntdll.dll+0x6396e] RtlInitializeExceptionChain+0xc2
VM state:synchronizing (normal execution)
VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x00dd8360] Safepoint_lock - owner thread: 0x01a68c00
[0x00dd83c8] Threads_lock - owner thread: 0x01a68c00
Heap
def new generation total 400384K, used 175418K [0x03ae0000, 0x1ed50000, 0x1ed80000)
eden space 355904K, 47% used [0x03ae0000, 0x0df2c4f0, 0x19670000)
from space 44480K, 16% used [0x1c1e0000, 0x1c8e2540, 0x1ed50000)
to space 44480K, 0% used [0x19670000, 0x19670000, 0x1c1e0000)
tenured generation total 889536K, used 111605K [0x1ed80000, 0x55230000, 0x552e0000)
the space 889536K, 12% used [0x1ed80000, 0x25a7d7f0, 0x25a7d800, 0x55230000)
compacting perm gen total 102144K, used 102123K [0x552e0000, 0x5b6a0000, 0x652e0000)
the space 102144K, 99% used [0x552e0000, 0x5b69ad60, 0x5b69ae00, 0x5b6a0000)
No shared spaces configured.
Code Cache [0x01ae0000, 0x02cb8000, 0x03ae0000)
total_blobs=9369 nmethods=9146 adapters=163 free_code_cache=14876096 largest_free_block=384
VM Arguments:
jvm_args: -Dprogram.name=standalone.bat -Xms1303M -Xmx1303M -XX:MaxPermSize=256M -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n -Dorg.jboss.boot.log.file=C:\jboss-eap-6.1\standalone\log\server.log -Dlogging.configuration=file:C:\jboss-eap-6.1\standalone/configuration/logging.properties
java_command: C:\jboss-eap-6.1\jboss-modules.jar -mp C:\jboss-eap-6.1\modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=C:\jboss-eap-6.1
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_45
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.6.0_45\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\apache-maven-3.2.2\bin;C:\Program Files\TortoiseSVN\bin;D:\apache-ant-1.9.4\bin
USERNAME=neeraj.ar
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 Build 7601 Service Pack 1
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1
Memory: 4k page, physical 3338764k(929876k free), swap 15625020k(11901304k free)
vm_info: Java HotSpot(TM) Client VM (20.45-b01) for windows-x86 JRE (1.6.0_45-b06), built on Mar 26 2013 13:40:03 by "java_re" with MS VC++ 7.1 (VS2003)
time: Thu Jul 23 18:41:10 2015
elapsed time: 256 seconds

The crash happens in C1-compiled code on the instruction
f20f1082ffffff7f movsd xmm0, qword ptr [edx+0x7fffffff]
which represents a volatile long load that has not been patched.
I believe this is a JVM bug JDK-6965570 or its duplicate JDK-7004258.
It has been fixed a long ago in JDK 6u60, but you seem to use very old version of JDK.

Related

Sigar binary make JVM crash on Windows10 & jdk11

Hi i'm using sigar very usefully,
but some critical problem was occurred.
in Windows 10 & jdk11 sigar lib makes JVM crash(append logs below) at all method
but, It works fine when using jdk8 under same environment.
It seems to my sigar-amd64-winnt.dll isn't compatible with jdk11 on windows 10.
so i update my sigar binary to 1.6.4 download from https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/magelan/hyperic-sigar-1.6.4.zip
Unfortunately problem isn't resolved.
is any resolution about this problem?
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000010014ed4, pid=28016, tid=5076
#
# JRE version: Java(TM) SE Runtime Environment (11.0.6+8) (build 11.0.6+8-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.6+8-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [sigar-amd64-winnt.dll+0x14ed4]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
Command Line: org.ngrinder.NGrinderAgentStarter --mode=agent --command=run -o
Host: Intel(R) Core(TM) i7-7700 CPU # 3.60GHz, 8 cores, 15G, Windows 10 , 64 bit Build 17134 (10.0.17134.753)
Time: Thu Feb 13 18:15:10 2020 ¢¥eCN©öI¡¾©ö C¡ÍA¨ª¨öA elapsed time: 0 seconds (0d 0h 0m 0s)
--------------- T H R E A D ---------------
Current thread (0x00000219633f8800): JavaThread "main" [_thread_in_native, id=5076, stack(0x000000256b800000,0x000000256b900000)]
Stack: [0x000000256b800000,0x000000256b900000], sp=0x000000256b8fee50, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [sigar-amd64-winnt.dll+0x14ed4]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.hyperic.sigar.ProcState.gather(Lorg/hyperic/sigar/Sigar;J)V+0
j org.hyperic.sigar.ProcState.fetch(Lorg/hyperic/sigar/Sigar;J)Lorg/hyperic/sigar/ProcState;+11
j org.hyperic.sigar.Sigar.getProcState(J)Lorg/hyperic/sigar/ProcState;+2
j org.hyperic.sigar.Sigar.getProcState(Ljava/lang/String;)Lorg/hyperic/sigar/ProcState;+6
j org.ngrinder.NGrinderAgentStarter.checkDuplicatedRun(Ljava/lang/String;)V+26
j org.ngrinder.NGrinderAgentStarter.main([Ljava/lang/String;)V+227
v ~StubRoutines::call_stub
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000009811d78
Register to memory mapping:
RIP=0x0000000010014ed4 sigar-amd64-winnt.dll
RAX=0x0000000009811c40 is an unknown value
RBX={method} {0x000002197fe1ab58} 'gather' '(Lorg/hyperic/sigar/Sigar;J)V' in 'org/hyperic/sigar/ProcState'
RCX=0x00000219633f8b40 points into unknown readable memory: 90 5d 23 16 ff 7f 00 00
RDX=0x000000256b8ff0b0 is pointing into the stack for thread: 0x00000219633f8800
RSP=0x000000256b8fee50 is pointing into the stack for thread: 0x00000219633f8800
RBP=0x000000256b8ff080 is pointing into the stack for thread: 0x00000219633f8800
RSI=0x0000000000200021 is an unknown value
RDI=0x0000000000000268 is an unknown value
R8 =0x0000000000000032 is an unknown value
R9 =0x00000007107f73c0 is an oop: org.hyperic.sigar.Sigar
{0x00000007107f73c0} - klass: 'org/hyperic/sigar/Sigar'
R10=0x0000000000000010 is an unknown value
R11=0x00007fff162b0188 jvm.dll
R12=0x0 is NULL
R13=0x000002197fe1ab48 is pointing into metadata
R14=0x000000256b8ff0b8 is pointing into the stack for thread: 0x00000219633f8800
R15=0x00000219633f8800 is a thread
Registers:
RAX=0x0000000009811c40, RBX=0x000002197fe1ab50, RCX=0x00000219633f8b40, RDX=0x000000256b8ff0b0
RSP=0x000000256b8fee50, RBP=0x000000256b8ff080, RSI=0x0000000000200021, RDI=0x0000000000000268
R8 =0x0000000000000032, R9 =0x00000007107f73c0, R10=0x0000000000000010, R11=0x00007fff162b0188
R12=0x0000000000000000, R13=0x000002197fe1ab48, R14=0x000000256b8ff0b8, R15=0x00000219633f8800
RIP=0x0000000010014ed4, EFLAGS=0x0000000000010202
Top of Stack: (sp=0x000000256b8fee50)
0x000000256b8fee50: 00000219633f8b40 000000256b8ff0b0
0x000000256b8fee60: 00000219633f8800 0000000000000000
0x000000256b8fee70: 0000000009811c40 0000000000000000
0x000000256b8fee80: 000000256b8ff0b8 000000001002113b
0x000000256b8fee90: 00000219633f8b40 000000256b8ff0b0
0x000000256b8feea0: 0000000000200021 0000000000000268
0x000000256b8feeb0: 0000000000000000 0000000000000000
0x000000256b8feec0: 0000000000000000 0000000000000000
0x000000256b8feed0: 0000000000000000 000002190875c9b0
0x000000256b8feee0: 00007fff160ce510 000002190860a550
0x000000256b8feef0: 000000037f73c000 00007fff15f009e5
0x000000256b8fef00: 000002197fe1ab50 00000219633f8800
0x000000256b8fef10: 0000000100000004 00007fff00000003
0x000000256b8fef20: 00000219633f9160 0000002800000003
0x000000256b8fef30: 00000219633f8800 000000256b8ff0b8
0x000000256b8fef40: 000002197fe1ab48 00007fff159c880f
Instructions: (pc=0x0000000010014ed4)
0x0000000010014eb4: 7c 24 20 00 75 15 48 8d 15 df 58 04 00 48 8b 4c
0x0000000010014ec4: 24 40 e8 45 00 00 00 33 c0 eb 32 48 8b 44 24 20
0x0000000010014ed4: 83 b8 38 01 00 00 00 74 1f 48 8b 44 24 20 44 8b
0x0000000010014ee4: 80 38 01 00 00 48 8b 54 24 20 48 8b 4c 24 40 e8
.
.
. (skip)
.
.
Stack slot to memory mapping:
stack at sp + 0 slots: 0x00000219633f8b40 points into unknown readable memory: 90 5d 23 16 ff 7f 00 00
stack at sp + 1 slots: 0x000000256b8ff0b0 is pointing into the stack for thread: 0x00000219633f8800
stack at sp + 2 slots: 0x00000219633f8800 is a thread
stack at sp + 3 slots: 0x0 is NULL
stack at sp + 4 slots: 0x0000000009811c40 is an unknown value
stack at sp + 5 slots: 0x0 is NULL
stack at sp + 6 slots: 0x000000256b8ff0b8 is pointing into the stack for thread: 0x00000219633f8800
stack at sp + 7 slots: 0x000000001002113b sigar-amd64-winnt.dll
--------------- S Y S T E M ---------------
OS: Windows 10 , 64 bit Build 17134 (10.0.17134.753)
CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 158 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx, fma
Memory: 4k page, system-wide physical 16287M (6175M free)
TotalPageFile size 23455M (AvailPageFile size 6527M)
current process WorkingSet (physical memory assigned to process): 74M, peak: 74M
current process commit charge ("private bytes"): 355M, peak: 355M
vm_info: Java HotSpot(TM) 64-Bit Server VM (11.0.6+8-LTS) for windows-amd64 JRE (11.0.6+8-LTS), built on Dec 11 2019 09:17:57 by "mach5one" with MS VC++ 15.5 (VS2017)
END.

pkcs11-tool does not see card which is identified by pcsc

I am using a REINER SCT cyberJack RFID standard card reader and an estonian ID card.
pcsc_scan correctly identifies the card:
$ pcsc_scan
PC/SC device scanner
V 1.5.2 (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau#free.fr>
Using reader plug'n play mechanism
Scanning present readers...
0: REINER SCT cyberJack RFID standard (9084002233) 00 00
Wed Mar 13 14:02:39 2019
Reader 0: REINER SCT cyberJack RFID standard (9084002233) 00 00
Card state: Card inserted,
ATR: 3B DB 96 00 80 B1 FE 45 1F 83 00 12 23 3F 53 65 49 44 0F 90 00 F1
ATR: 3B DB 96 00 80 B1 FE 45 1F 83 00 12 23 3F 53 65 49 44 0F 90 00 F1
+ TS = 3B --> Direct Convention
+ T0 = DB, Y(1): 1101, K: 11 (historical bytes)
TA(1) = 96 --> Fi=512, Di=32, 16 cycles/ETU
250000 bits/s at 4 MHz, fMax for Fi = 5 MHz => 312500 bits/s
TC(1) = 00 --> Extra guard time: 0
TD(1) = 80 --> Y(i+1) = 1000, Protocol T = 0
-----
TD(2) = B1 --> Y(i+1) = 1011, Protocol T = 1
-----
TA(3) = FE --> IFSC: 254
TB(3) = 45 --> Block Waiting Integer: 4 - Character Waiting Integer: 5
TD(3) = 1F --> Y(i+1) = 0001, Protocol T = 15 - Global interface bytes following
-----
TA(4) = 83 --> Clock stop: state H - Class accepted by the card: (3G) A 5V B 3V
+ Historical bytes: 00 12 23 3F 53 65 49 44 0F 90 00
Category indicator byte: 00 (compact TLV data object)
Tag: 1, len: 2 (country code, ISO 3166-1)
Country code: 23 3F
Tag: 5, len: 3 (card issuer's data)
Card issuer data: 65 49 44
Mandatory status indicator (3 last bytes)
LCS (life card cycle): 0F (unknown)
SW: 9000 (Normal processing.)
+ TCK = F1 (correct checksum)
Possibly identified card (using /home/mag/.cache/smartcard_list.txt):
3B DB 96 00 80 B1 FE 45 1F 83 00 12 23 3F 53 65 49 44 0F 90 00 F1
Estonia ID-card (eID)
https://id.ee
however pkcs11-tool does not see the card:
$ pkcs11-tool --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so -L
Available slots:
Slot 0 (0x0): REINER SCT cyberJack RFID standard (9084002233) 00 00
(empty)
What can be the cause of the problem? What do I miss?
Apparently the toolchain of the estonian card is not compatible with pkcs-11. However the chrome-token-signing package contains the needed code at least for authentication to their service both for chromium and firefox, and the qdigidoc4 package contains a tool to create and check signed/encrypted documents.
Their repo is here:
deb https://installer.id.ee/media/ubuntu/ bionic main
Another issue I have encountered that my cert is said to be invalid. That was because the certificate won't get enabled right away when you receive your ID.

MongoDB crashes on Map/Reduce

I have been using MongoDB as my primary storage for 1.5Tb+ of data since last year. Everything was fine, but recently i decided to execute some map-reduce against 14 000 000 documents collection and my production instance got down.
Please take a look at details:
My config:
Ubuntu 12.04.5 LTS, MongoDB 2.6.4, LVM (2 HDD, 1.5TB+ free of 3TB+ total), 24GB RAM (almost all free)
Mongo config is default (except logpath and dbpath parameters)
Mongo log:
2014-08-28T07:33:41.147+0400 [DataFileSync] flushing mmaps took 16177ms for 777 files
2014-08-28T07:33:44.004+0400 [conn13] M/R: (1/3) Emit Progress: 9920300
2014-08-28T07:33:47.178+0400 [conn13] M/R: (1/3) Emit Progress: 9928100
2014-08-28T07:33:50.004+0400 [conn13] M/R: (1/3) Emit Progress: 9967800
2014-08-28T07:33:53.115+0400 [conn13] M/R: (1/3) Emit Progress: 10007800
2014-08-28T07:33:56.009+0400 [conn13] M/R: (1/3) Emit Progress: 10048800
2014-08-28T07:33:59.050+0400 [conn13] M/R: (1/3) Emit Progress: 10091200
2014-08-28T07:34:02.530+0400 [conn13] M/R: (1/3) Emit Progress: 10102300
2014-08-28T07:34:05.510+0400 [conn13] M/R: (1/3) Emit Progress: 10102400
2014-08-28T07:34:08.932+0400 [conn13] SEVERE: Invalid access at address: 0x7cc8b2fe70b4
2014-08-28T07:34:08.983+0400 [conn13] SEVERE: Got signal: 7 (Bus error).
Backtrace:0x11e6111 0x11e54ee 0x11e55df 0x7f5a7031ecb0 0xf29cad 0xf32f28 0xf32770 0x8b601f 0x8b693a 0x982885 0x988485 0x9966d8 0x9a3355 0xa2889a 0xa29ce2 0xa2bea6 0xd5dd6d 0xb9fe62 0xba1440 0x770aef
mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x11e6111]
mongod() [0x11e54ee]
mongod() [0x11e55df]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f5a7031ecb0]
mongod(_ZN5mongo16NamespaceDetails5allocEPNS_10CollectionERKNS_10StringDataEi+0x1bd) [0xf29cad]
mongod(_ZN5mongo19SimpleRecordStoreV111allocRecordEii+0x68) [0xf32f28]
mongod(_ZN5mongo17RecordStoreV1Base12insertRecordEPKcii+0x60) [0xf32770]
mongod(_ZN5mongo10Collection15_insertDocumentERKNS_7BSONObjEbPKNS_16PregeneratedKeysE+0x7f) [0x8b601f]
mongod(_ZN5mongo10Collection14insertDocumentERKNS_7BSONObjEbPKNS_16PregeneratedKeysE+0x22a) [0x8b693a]
mongod(_ZN5mongo2mr5State12_insertToIncERNS_7BSONObjE+0x85) [0x982885]
mongod(_ZN5mongo2mr5State14reduceInMemoryEv+0x175) [0x988485]
mongod(_ZN5mongo2mr5State35reduceAndSpillInMemoryStateIfNeededEv+0x148) [0x9966d8]
mongod(_ZN5mongo2mr16MapReduceCommand3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0xcc5) [0x9a3355]
mongod(_ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x3a) [0xa2889a]
mongod(_ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x1042) [0xa29ce2]
mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x6c6) [0xa2bea6]
mongod(_ZN5mongo11newRunQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x22ed) [0xd5dd6d]
mongod() [0xb9fe62]
mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x580) [0xba1440]
mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x9f) [0x770aef]
After my first run of that map-reduce, i made db.repairDatabase(), but after second attempt to map-reduce (after repairing) the same crash happened again. Now, i have no idea how to get my m/r done
Any ideas, folks?
Having issue investigated, i recently came up with a couple of things:
As it was suggested in comments, i took a look at mongo jira ticket SERVER-12849
and double checked my logs.
/var/log/syslog says:
kernel: [1349503.760215] ata6.00: exception Emask 0x0 SAct 0x3 SErr 0x0 action 0x0
Aug 28 08:18:41 overlord kernel: [1349503.760253] ata6.00: irq_stat 0x40000008
Aug 28 08:18:41 overlord kernel: [1349503.760281] ata6.00: failed command: READ FPDMA QUEUED
Aug 28 08:18:41 overlord kernel: [1349503.760318] ata6.00: cmd 60/08:00:10:48:92/00:00:84:00:00/40 tag 0 ncq 4096 in
Aug 28 08:18:41 overlord kernel: [1349503.760318] res 41/40:08:10:48:92/00:00:84:00:00/00 Emask 0x409 (media error)
Aug 28 08:18:41 overlord kernel: [1349503.760411] ata6.00: status: { DRDY ERR }
Aug 28 08:18:41 overlord kernel: [1349503.760437] ata6.00: error: { UNC }
Aug 28 08:18:41 overlord kernel: [1349503.788325] ata6.00: configured for UDMA/133
Aug 28 08:18:41 overlord kernel: [1349503.788340] sd 5:0:0:0: [sdb] Unhandled sense code
Aug 28 08:18:41 overlord kernel: [1349503.788343] sd 5:0:0:0: [sdb]
Aug 28 08:18:41 overlord kernel: [1349503.788345] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Aug 28 08:18:41 overlord kernel: [1349503.788348] sd 5:0:0:0: [sdb]
Aug 28 08:18:41 overlord kernel: [1349503.788350] Sense Key : Medium Error [current] [descriptor]
Aug 28 08:18:41 overlord kernel: [1349503.788353] Descriptor sense data with sense descriptors (in hex):
Aug 28 08:18:41 overlord kernel: [1349503.788355] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
Aug 28 08:18:41 overlord kernel: [1349503.788365] 84 92 48 10
Aug 28 08:18:41 overlord kernel: [1349503.788370] sd 5:0:0:0: [sdb]
Aug 28 08:18:41 overlord kernel: [1349503.788373] Add. Sense: Unrecovered read error - auto reallocate failed
Aug 28 08:18:41 overlord kernel: [1349503.788376] sd 5:0:0:0: [sdb] CDB:
Aug 28 08:18:41 overlord kernel: [1349503.788377] Read(10): 28 00 84 92 48 10 00 00 08 00
Aug 28 08:18:41 overlord kernel: [1349503.788387] end_request: I/O error, dev sdb, sector 2224179216
Aug 28 08:18:41 overlord kernel: [1349503.788434] ata6: EH complete
looks like /dev/sdb is culprit, let's check SMART status (as suggested in jira)
SMART Error Log Version: 1
ATA Error Count: 135 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 135 occurred at disk power-on lifetime: 11930 hours (497 days + 2 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: WP at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
61 00 08 ff ff ff 4f 00 49d+12:01:35.512 WRITE FPDMA QUEUED
60 00 08 ff ff ff 4f 00 49d+12:01:33.380 READ FPDMA QUEUED
ea 00 00 00 00 00 a0 00 49d+12:01:33.294 FLUSH CACHE EXT
61 00 00 ff ff ff 4f 00 49d+12:01:33.292 WRITE FPDMA QUEUED
ea 00 00 00 00 00 a0 00 49d+12:01:33.153 FLUSH CACHE EXT
Error 134 occurred at disk power-on lifetime: 11930 hours (497 days + 2 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: WP at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
61 00 08 ff ff ff 4f 00 49d+11:17:00.189 WRITE FPDMA QUEUED
61 00 10 ff ff ff 4f 00 49d+11:17:00.189 WRITE FPDMA QUEUED
61 00 28 ff ff ff 4f 00 49d+11:17:00.188 WRITE FPDMA QUEUED
61 00 08 ff ff ff 4f 00 49d+11:17:00.188 WRITE FPDMA QUEUED
61 00 08 ff ff ff 4f 00 49d+11:17:00.188 WRITE FPDMA QUEUED
Error 133 occurred at disk power-on lifetime: 11930 hours (497 days + 2 hours)
When the command that caused the error occurred, the device was active or idle.
so, as we can see there are errors on /dev/sdb, let's do the final check - copy entire data to another host and try to run original map-reduce script there.
Result is success.
So mongo is ok in my case. It seems (Bus Error) log entries in mongo log signal that it is time to check your hardware.

!mlocks hung interpretation help needed

i try to investigate a hung with windbg and want to know if my assumptions are right. If I call the command
!mlocks i got the following:
0:000> !mlocks
Examining SyncBlocks...
Scanning for ReaderWriterLock instances...
Scanning for holders of ReaderWriterLock locks...
Scanning for ReaderWriterLockSlim instances...
Scanning for holders of ReaderWriterLockSlim locks...
Examining CriticalSections...
ClrThread DbgThread OsThread LockType Lock LockLevel
--------------------------------------------------------------------------
0x640064 -1 0xffffffff RWLock 000000000339a338 Writer
0x6 7 0x1ea8 thinlock 000000000343ddd8 (recursion:0)
When executeing rwlocks i got the following:
0:000> !rwlock 000000000339a338
WriterThread: 0x640064 (DEAD) WriterLevel: 115 WaitingWriterCount: 0
WriterEvent: 0
WaitingWriterThreadIds: None
ReaderCount: 116
CurrentReaderThreadIds:
WaitingReaderCount: 576
ReaderEvent: 80400002
WaitingReaderThreadIds:
*This lock has 116 orphaned reader locks.
0:007> !rwlock
Address ReaderCount WaitingReaderCount WriterThread WaitingWriterCount
...
000000000339a338 116 576 0x640064 0
...
00000000053f0688 568 499 -- 6
...
i got this.
When I call
0:000> !dlk Examining SyncBlocks... Scanning for ReaderWriterLock instances... Scanning for holders of ReaderWriterLock locks... Scanning for ReaderWriterLockSlim instances...
Scanning for holders of ReaderWriterLockSlim locks...
Examining CriticalSections...
Scanning for threads waiting on SyncBlocks...
Scanning for threads waiting on ReaderWriterLock locks...
Scanning for threads waiting on ReaderWriterLocksSlim locks...
Scanning for threads waiting on CriticalSections...
No deadlocks detected.
then no deadlock will be detected.
I found this on Tess's blog
My question is if this threads have to do with my hunging application,
and what the scenario could be.
What does it mean that the thread is DEAD. Can a lock happen on a dead thread? Or do I have to find somewhere else root cause of my hunging application?
Please help me to interpret this output.
Regards,
Bernhard
Here is some addional info:
0:000> dc 000000000339a338
00000000`0339a338 f2073268 000007fe 00000000 80000000 h2..............
00000000`0339a348 f2066960 000007fe 00000010 00650047 `i..........G.e.
00000000`0339a358 00480074 0073006f 00410074 00640064 t.H.o.s.t.A.d.d.
00000000`0339a368 00650072 00730073 00730065 00000000 r.e.s.s.e.s.....
00000000`0339a378 00000000 00000000 00000000 00000000 ................
00000000`0339a388 f2066960 000007fe 0000001c 00650066 `i..........f.e.
00000000`0339a398 00300038 003a003a 00380034 00310038 8.0.:.:.4.8.8.1.
00000000`0339a3a8 0034003a 00660039 003a0063 00300039 :.4.9.f.c.:.9.0.
0:000> db 000000000339a338
00000000`0339a338 68 32 07 f2 fe 07 00 00-00 00 00 00 00 00 00 80 h2..............
00000000`0339a348 60 69 06 f2 fe 07 00 00-10 00 00 00 47 00 65 00 `i..........G.e.
00000000`0339a358 74 00 48 00 6f 00 73 00-74 00 41 00 64 00 64 00 t.H.o.s.t.A.d.d.
00000000`0339a368 72 00 65 00 73 00 73 00-65 00 73 00 00 00 00 00 r.e.s.s.e.s.....
00000000`0339a378 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000000`0339a388 60 69 06 f2 fe 07 00 00-1c 00 00 00 66 00 65 00 `i..........f.e.
00000000`0339a398 38 00 30 00 3a 00 3a 00-34 00 38 00 38 00 31 00 8.0.:.:.4.8.8.1.
00000000`0339a3a8 3a 00 34 00 39 00 66 00-63 00 3a 00 39 00 30 00 :.4.9.f.c.:.9.0.
0:000> !mdt 000000000339a338
Can't get name for module 000007ff0068c3c0. Error = 0x80070057.
Can't get name for module 000007ff00791908. Error = 0x80070057.
Can't get name for module 000007ff0068c3c0. Error = 0x80070057.
Can't get name for module 000007ff00791908. Error = 0x80070057.
000000000339a338 (System.Threading.ReaderWriterLock)
_hWriterEvent:8000000000000000 (System.IntPtr)
_hReaderEvent:000007fef2066960 (System.IntPtr)
_hObjectHandle:0065004700000010 (System.IntPtr)
_dwState:0x480074 (System.Int32)
_dwULockID:0x73006f (System.Int32)
_dwLLockID:0x410074 (System.Int32)
_dwWriterID:0x640064 (System.Int32)
_dwWriterSeqNum:0x650072 (System.Int32)
_wWriterLevel:0x0073 (System.Int16)
0:000> !mdt 000000000343ddd8
Can't get name for module 000007ff0068c3c0. Error = 0x80070057.
Can't get name for module 000007ff00791908. Error = 0x80070057.
000000000343ddd8 (System.Collections.Generic.LinkedList`1[[TAU.GuiAccess.PopupHandler.ClientInfo, TAU.GuiAccess.PopupHandler]])
head:000000000823e148 (System.Collections.Generic.LinkedListNode`1[[TAU.GuiAccess.PopupHandler.ClientInfo, TAU.GuiAccess.PopupHandler]])
count:0x1 (System.Int32)
version:0x3b (System.Int32)
_syncRoot:NULL (System.Object)
siInfo:NULL (System.Runtime.Serialization.SerializationInfo)
0:000> !do 000000000343ddd8
Name: System.Collections.Generic.LinkedList`1[[TAU.GuiAccess.PopupHandler.ClientInfo, TAU.GuiAccess.PopupHandler]]
MethodTable: 000007ff009ce218
EEClass: 000007ff009dda20
Size: 48(0x30) bytes
File: C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll
Fields:
MT Field Offset Type VT Attr Value Name
000007ff009ced28 4000586 8 ...ss.PopupHandler]] 0 instance 000000000823e148 head
000007fef206c848 4000587 20 System.Int32 1 instance 1 count
000007fef206c848 4000588 24 System.Int32 1 instance 59 version
000007fef2065ab8 4000589 10 System.Object 0 instance 0000000000000000 _syncRoot
000007fef208a1b8 400058a 18 ...SerializationInfo 0 instance 0000000000000000 siInfo
ThinLock owner 6 (0000000000000000), Recursive 0
The "DEAD" indication means that there is no corresponding OS thread. When a managed thread is created, a managed thread object is created and assigned a thread ID. On Windows, there is currently always a 1:1 mapping between managed and native threads, so there is also an OS thread ID assigned. When a thread terminates, the association between the managed thread object and the native thread is obviously broken. However, it takes a period of time before the managed thread object gets cleaned up. A thread in this state is listed by sosex as "DEAD" and is listed as XXXX in the !sos.threads output.
In this case, the CLR thread ID (00640064) looks suspicious. It looks curiously like Unicode text 'dd'. There may be corruption around the managed lock address. Look around with the debugger's 'dc' or 'db' commands to see if some text has overwritten the thread ID field.

How can I tell what Scala version a .class file was compiled with?

How can I tell what Scala version a .class file was compiled with?
I suppose the information is stored in the "pickled" part of the .class file, according to the 2008 "Reflecting Scala" rapport, from Yohann Coppel, under the supervision of Prof. Martin Odersky.
During the compilation process (represented on fig. 2), the Scala compiler generates two types of data.
The first one is some classic Java bytecode, which can be read and executed by a standard Java virtual machine.
The second one is what is called “Pickled data”, and represents the basic structure of the original source file.
This information is enclosed in a .class file.
The Java bytecode specification allows the compiler to “define and emit class files containing new attributes in the attributes tables of class file structures”. These attributes are silently ignored by JVMs if they do not recognize them.
The Scala compiler generates pickled data for about any data structure in a Scala program, called symbols in the pickler context.
Symbols are stored linearly with the format shown on Fig. 3.
The tag represents the type of data stored,
then the length gives the length of the following data block.
The data block can contain multiple information,
such as the name of a symbol.
ScalaSig = "ScalaSig" Version Symtab
Version = Major_Nat Minor_Nat <====
Symtab = numberOfEntries_Nat {Entry}
The ScalaSig attribute definition.
A more complete definition can be found in the scala.tools.nsc.symtab.PickleFormat source file (now scala.reflect.internal.pickling.PickleFormat).
You can also see how to read the Pickled data in scala.tools.nsc.util.ShowPickled.
This page shows a script (not tested) which will display the pickled data:
#!/bin/sh
#
# Shows the pickled scala data in a classfile.
if [ $# == 0 ] ; then
echo "Usage: $0 [--bare] [-cp classpath] <class*>"
exit 1
fi
TOOLSDIR=`dirname $0`
CPOF="$TOOLSDIR/cpof"
PACK="$TOOLSDIR/../build/pack/lib"
QUICK="$TOOLSDIR/../build/quick/classes"
STARR="$TOOLSDIR/../lib"
CP=""
if [ -f "${PACK}/scala-library.jar" ] ; then
CP=`${TOOLSDIR}/packcp`
elif [ -d "${QUICK}/library" ] ; then
CP=`${TOOLSDIR}/quickcp`
else
CP=`${TOOLSDIR}/starrcp`
fi
if [ "$1" == "-cp" ] ; then
shift
CP="${1}:${CP}"
shift
fi
java -cp "$CP" scala.tools.nsc.util.ShowPickled $*
You can see the Scala Major/Minor version in the class file if you use javap with the verbose option. For example, the following is shown for a file compiled using scala 2.8.0 final:
javap -private -verbose T
Compiled from "SomeTest.scala"
public interface T
SourceFile: "SomeTest.scala"
ScalaSig: length = 0x3
05 00 00
RuntimeVisibleAnnotations: length = 0xB
00 01 00 06 00 01 00 07 73 00 08
minor version: 0
major version: 49
Constant pool:
const #1 = Asciz SourceFile;
const #2 = Asciz SomeTest.scala;
const #3 = Asciz s;
const #4 = Asciz ()Ljava/lang/String;;
const #5 = Asciz ScalaSig;
//etc etc...
while the following is the output of a file compiled using scala 2.7.7:
javap -verbose T2
Compiled from "SomeTest2.scala"
public interface T2
SourceFile: "SomeTest2.scala"
ScalaSig: length = 0x87
04 01 1B 06 08 01 02 FFFFFF84 FFFFFF90 FFFFFF80 FFFFFF91 00 05 02 02 54
32 0A 01 03 01 07 3C 65 6D 70 74 79 3E 03 00 13
02 00 06 10 02 07 0C 0D 01 08 0A 02 09 0A 01 04
6C 61 6E 67 0A 01 0B 01 04 6A 61 76 61 09 02 0D
08 02 06 4F 62 6A 65 63 74 08 05 0F 00 FFFFFF86 00 10
01 01 73 15 01 11 10 02 12 18 0E 02 13 16 0D 01
14 0A 01 15 01 05 73 63 61 6C 61 09 02 17 14 01
06 50 72 65 64 65 66 09 02 19 1A 02 06 53 74 72
69 6E 67 0A 02 17 14
minor version: 0
major version: 49
Constant pool:
const #1 = Asciz SourceFile;
const #2 = Asciz SomeTest2.scala;
//etc etc...
The first two bytes of the ScalaSig constant entry should represent the scala Major/Minor version, I believe, which are defined in PickleFormat. The 2.7.7 version of PickleFormat can be found here, and shows that the major/minor version differs from the 2.8.0 version.
I checked the 2.7.1 version of this class as well, but here the Major/Minor version is the same as the 2.7.7 one, so you may not be able to distinguish between minor scala versions by using this method.
Most probably you could parse the .class file and read the version from an attribute attached from the scala compiler onto the class file.
To learn more about the existance of such an attribute you might start at the sources of the scala compiler ( http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala ).
To learn how to parse a .class file you might read in the spec ( http://jcp.org/aboutJava/communityprocess/final/jsr202/index.html ).
The example code I posted here ( Java Illegal class modifiers Exception code 0x209 ) might help at the implementation, too .
FWIW, Here's a version of VonC's script that sets the classpath to scala-library.jar and scala-compiler.jar
Tested under cygwin and linux, with scala 2.11.8 and 2.12.1,
Should work under OSX.
Doesn't seem to like --bare argument, however.
(requires scala to be in your PATH.)
#!/bin/bash
# Shows the pickled scala data in a classfile.
if [ $# == 0 ] ; then
echo "Usage: $0 [--bare] [-cp classpath] <class*>"
exit 1
fi
unset JAVA_TOOL_OPTIONS
[ -z "$SCALA_HOME" ] && SCALA_HOME=$(which scala | sed -e 's#/bin/scala##')
export OSTYPE=$(uname | tr '[A-Z]' '[a-z]' | sed -e 's#[_0-9].*##')
case $OSTYPE in
cygwin) SEP=";" ;;
*) SEP=":" ;;
esac
CP="${SCALA_HOME}/lib/scala-library.jar${SEP}${SCALA_HOME}/lib/scala-compiler.jar${SEP}${SCALA_HOME}/lib/scala-reflect.jar"
if [ "$1" == "-cp" ] ; then
shift
CP="${1}${SEP}${CP}"
shift
fi
java -cp "$CP" scala.tools.nsc.util.ShowPickled $*