Fatal Error when calling showSaveDialog() and showOpenMultipleDialog() - javafx

The JVM is crashing when I run these two lines:
javafx.stage.FileChooser fileChooser = new FileChooser();
File targetFile = fileChooser.showSaveDialog( mainStage );
I am on Ubuntu 16.10, OpenJDK 8 64bit:
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.10.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
Kernel version:
Linux Joshua-PC 4.8.0-59-generic #64-Ubuntu SMP Thu Jun 29 19:38:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
I tried the solution outlined here with no success: https://stackoverflow.com/a/34612376/61248
Here is the top of the error log:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f8573f34e40, pid=19801, tid=0x00007f850d733700
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b11) (build 1.8.0_131-8u131-b11-0ubuntu1.16.10.2-b11)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libpthread.so.0+0x9e40] pthread_mutex_lock+0x0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# 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.
#
--------------- T H R E A D ---------------
Current thread (0x00007f856c325800): JavaThread "JavaFX Application Thread" [_thread_in_native, id=19824, stack(0x00007f850d633000,0x00007f850d734000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00000000006e6f84
Registers:
RAX=0x00007f8573f34e40, RBX=0x00007f856c2e1730, RCX=0x000000000000014c, RDX=0x00007f850d72b8b0
RSP=0x00007f850d72b828, RBP=0x00007f850d72b890, RSI=0x00007f850d72b8a0, RDI=0x00000000006e6f74
R8 =0x00007f850d72b890, R9 =0x00007f856c2919fd, R10=0x00007f854dd43387, R11=0x0000000000000065
R12=0x00007f850d72b88c, R13=0x0000000000000000, R14=0x00007f85007b27c8, R15=0x00007f850d72ce20
RIP=0x00007f8573f34e40, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007f850d72b828)
0x00007f850d72b828: 00007f854dcd8bda 00007f850d72b8a0
0x00007f850d72b838: 00007f850d72b8b0 00007f851358d510
0x00007f850d72b848: 00007f856c29c720 00007f8518f02cc1
0x00007f850d72b858: 7b2d1296d82fd300 00007f856c29c720
0x00007f850d72b868: 00007f8518f02cc1 00007f8518f04494
0x00007f850d72b878: 00007f854dcb4f56 0000000000000003
0x00007f850d72b888: 00007f850d72b930 00007f8500883400
0x00007f850d72b898: 0000000000004d70 0000014e0000014c
0x00007f850d72b8a8: 00007f8500000000 0000015700000156
0x00007f850d72b8b8: 00007f8500000000 0000000000000000
0x00007f850d72b8c8: 7b2d1296d82fd300 00007f8500882a50
0x00007f850d72b8d8: 00007f8500882a84 00007f856c29c720
0x00007f850d72b8e8: 00007f8518ebd79f 0000000000000000
0x00007f850d72b8f8: 00007f854c3e2078 00007f8500883400
0x00007f850d72b908: 7b2d1296d82fd300 00007f850d72b9ec
0x00007f850d72b918: 00007f8500883fa8 00007f850d72b980
0x00007f850d72b928: 00007f8500883fa8 0000000000000000
0x00007f850d72b938: 00007f85007b27c8 00007f850d72ce20
0x00007f850d72b948: 00007f8518ebfcc0 00007f8500883e80
0x00007f850d72b958: 00007f8518e91487 00007f85007b27c8
0x00007f850d72b968: 00007f850087d250 00007f850d72b9a0
0x00007f850d72b978: 00007f8518e4fd1f 00007f850d72ba00
0x00007f850d72b988: 00007f850d72b9f0 00007f850d72b9e0
0x00007f850d72b998: 00007f84c40127b0 00007f84c4012870
0x00007f850d72b9a8: 00007f854c3e3557 0000000000000000
0x00007f850d72b9b8: 0000000000000000 0000000100000001
0x00007f850d72b9c8: 0000000c0000000c 0000000000000000
0x00007f850d72b9d8: 7b2d1296d82fd300 00007f85007b2600
0x00007f850d72b9e8: 00007f850087d250 0000000000000006
0x00007f850d72b9f8: 00007f8518e52e93 0000000000000000
0x00007f850d72ba08: 000001cc0000000c 0000000000000001
0x00007f850d72ba18: 00000006d82fd300 000000004000000c
Instructions: (pc=0x00007f8573f34e40)
0x00007f8573f34e20: 89 0c 25 e0 02 00 00 64 48 c7 04 25 f0 02 00 00
0x00007f8573f34e30: 00 00 00 00 b8 82 00 00 00 e9 e0 f9 ff ff 66 90
0x00007f8573f34e40: 8b 57 10 89 d1 81 e1 7f 01 00 00 90 89 d0 83 e0
0x00007f8573f34e50: 7c 0f 85 99 00 00 00 48 83 ec 08 85 c9 49 89 f8
Register to memory mapping:
RAX=0x00007f8573f34e40: pthread_mutex_lock+0 in /lib/x86_64-linux-gnu/libpthread.so.0 at 0x00007f8573f2b000
RBX=0x00007f856c2e1730 is an unknown value
RCX=0x000000000000014c is an unknown value
RDX=0x00007f850d72b8b0 is pointing into the stack for thread: 0x00007f856c325800
RSP=0x00007f850d72b828 is pointing into the stack for thread: 0x00007f856c325800
RBP=0x00007f850d72b890 is pointing into the stack for thread: 0x00007f856c325800
RSI=0x00007f850d72b8a0 is pointing into the stack for thread: 0x00007f856c325800
RDI=0x00000000006e6f74 is an unknown value
R8 =0x00007f850d72b890 is pointing into the stack for thread: 0x00007f856c325800
R9 =0x00007f856c2919fd is an unknown value
R10=0x00007f854dd43387: <offset 0xb0387> in /usr/lib/x86_64-linux-gnu/libX11.so.6 at 0x00007f854dc93000
R11=0x0000000000000065 is an unknown value
R12=0x00007f850d72b88c is pointing into the stack for thread: 0x00007f856c325800
R13=0x0000000000000000 is an unknown value
R14=0x00007f85007b27c8 is an unknown value
R15=0x00007f850d72ce20 is pointing into the stack for thread: 0x00007f856c325800
Stack: [0x00007f850d633000,0x00007f850d734000], sp=0x00007f850d72b828, free space=994k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libpthread.so.0+0x9e40] pthread_mutex_lock+0x0
C 0x0000000000004d70
Full error log here: http://hypnosplayer.org/misc/save-as-error.log

This was being caused by the use of an external library JNativeHook for global hotkeys, particularly this line:
GlobalScreen.registerNativeHook();
and this line:
GlobalScreen.addNativeKeyListener( globalHotkeyListener );
I don't understand why this caused the problem, but removing both of these calls solves the issue. I suppose I'll have to look for a different global hotkey library.
I spoke with the library developer. He reviewed the crash and said it doesn't happen in the library direct, and he indicated that the problem may be with "xcb" and linux. He recommended using an earlier version of the library (v2.0.2 rather than v2.1.0) and that resolved the issue.

Is this reproducible?
The instruction stream looks like this:
0: 89 0c 25 e0 02 00 00 mov %ecx,0x2e0
7: 64 48 c7 04 25 f0 02 movq $0x0,%fs:0x2f0
e: 00 00 00 00 00 00
14: b8 82 00 00 00 mov $0x82,%eax
19: e9 e0 f9 ff ff jmpq 0xfffffffffffff9fe
1e: 66 90 xchg %ax,%ax
This is from the end of the __pthread_mutex_lock_full function in libpthread. The first instruction faults because it attempts to write to the absolute address 0x2e0, which is not mapped. This instruction is the tail of a proper instruction, which writes to the TCB via the %fs register override:
993a: 64 48 89 04 25 e0 02 mov %rax,%fs:0x2e0
9941: 00 00
It's not a simple stray function pointer call, either, because the JVM reports that the faulting instruction is at pthread_mutex_lock+0, i.e., the proper start of the function. So it looks like that the JVM/dynamic linker's view of libpthread are slightly off (shifted by 32 bytes, actually).
EDIT As this is perfectly reproducible, it is not a file rewrite of libpthread.so.0, as I originally suspected. It is likely some sort of memory corruption which flips a bit in a function pointer. If -Xcheck:jni does not provide any hints, this needs an extending debugging session with GDB to identify the root cause (running the JVM under valgrind probably has too many false positives).

Related

SkCanvas throws when drawing from a task

A call to draw picture from an awaited task, will crash my app.
A regular non awaited call will not crash but will not draw my svg.
public static Task DrawSVGOnCanvas(SKCanvas canvas, string assemblyName, string svgFileName, SKRect sizeRect, SKPaint paint)
{
return Task.Run(async () =>
{
try
{
Stream stream = await GetImageStream(svgFileName, assemblyName, null);
if (stream == null)
{
return;
}
stream.Position = 0;
SKSvg.SKSvg svg = new SKSvg.SKSvg();
svg.Load(stream);
SKMatrix scaleMatrix = GetScaleMatrix(svg.Picture, sizeRect);
canvas.DrawPicture(svg.Picture, ref scaleMatrix, paint);
}
catch (Exception ex)
{
_logService.HandleException(ex);
}
});
}
I was trying to call this async method so I could get the stream for the svg file without locking the ui thread.
Has anyone encountered this, or tried to implement something similiar using skiasharp for svg?
Update 1:
The stacktrace for the crash:
=================================================================
Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
No native Android stacktrace (see debuggerd output).
=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x8d04084e):0x8d04083e 10 98
00 78 00 28 13 d1 15 b0 bd e8 00 0f f0 bd ...x.(..........
0x8d04084e d9 f8 00 00 59 46 2a 46 43 46 d0 f8 c4 60 48 46 ....YF*FCF...`HF
0x8d04085e b0 47 0e 98 00 28 1e bf 10 98 00 78 00 28 eb d0 .G...(.....x.(..
0x8d04086e 8a f0 cf fb 03 68 10 ae 46 ce 5b 69 13 9d cd e9 .....h..F.[i....
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at SkiaSharp.SkiaApi:sk_canvas_draw_picture <0x00043>
at SkiaSharp.SKCanvas:DrawPicture <0x001fb>
at <>c__DisplayClass27_1:<DrawSVGOnCanvas>b__1 <0x000f3>
at RunnableImplementor:Run <0x000c3>
at Java.Lang.IRunnableInvoker:n_Run <0x000bf>
at Android.Runtime.DynamicMethodNameCounter:28 <0x000eb>
at Android.Runtime.DynamicMethodNameCounter:28 <0x000db>
=================================================================
06-08 16:54:05.532 F/libc ( 8842): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 8842 (UI)
If I am trying to await the call instead of letting it run unawaited I get the following:
=================================================================
Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
No native Android stacktrace (see debuggerd output).
=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x8d65084e):
0x8d65083e
10
98
00
78
00 28 13 d1
15 b0 bd e8 00 0f f0 bd ...x.(........
..
0x8d65084e d9 f8 00 00 59 46 2a 46 43 46 d0 f8 c4 60 48
46 ..
.
.YF*FCF...`HF
0x8d65085e b0 47 0e 98 00 28 1e bf 10 98 00 78 00 28 eb
d0 .G..
.(.....
x.(..
0x8d65086e 8a f0 cf fb 03 68 10 ae 46 ce 5b
69 13 9d cd e9 .....h..F.[i..
..
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at SkiaSharp.SkiaApi:sk_canvas_draw_picture <0x00043>
at SkiaSharp.SKCanvas:DrawPicture <0x001fb>
at <<DrawSVGOnCanvas>b__0>d:MoveNext <0x00823>
at MoveNextRunner:InvokeMoveNext <0x000d7>
at System.Threading.ExecutionContext:RunInternal <0x0040b>
at System.Threading.ExecutionContext:Run <0x00073>
at MoveNextRunner:Run <0x0018f>
at System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction <0x00183>
at System.Threading.Tasks.Task:FinishContinuations <0x0032b>
at System.Threading.Tasks.Task:FinishStageThree <0x00153>
at System.Threading.Tasks.Task`1:TrySetResult <0x0020f>
at System.Threading.Tasks.UnwrapPromise`1:TrySetFromTask <0x00553>
at System.Threading.Tasks.UnwrapPromise`1:InvokeCore <0x000db>
at System.Threading.Tasks.UnwrapPromise`1:Invoke <0x000e3>
at System.Threading.Tasks.Task:FinishContinuations <0x004c7>
at System.Threading.Tasks.Task:FinishStageThree <0x00153>
at System.Threading.Tasks.Task`1:TrySetResult <0x0020f>
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult <0x00223>
at <<GetImageStream>b__0>d:MoveNext <0x01637>
at MoveNextRunner:InvokeMoveNext <0x000d7>
at System.Threading.ExecutionContext:RunInternal <0x0040b>
at System.Threading.ExecutionContext:Run <0x00073>
at MoveNextRunner:Run <0x0018f>
at System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction <0x00183>
at System.Threading.Tasks.Task:FinishContinuations <0x0032b>
at System.Threading.Tasks.Task:FinishStageThree <0x00153>
at System.Threading.Tasks.Task`1:TrySetResult <0x0020f>
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult <0x00223>
at <GetObject>d__17`1:MoveNext <0x0077b>
at MoveNextRunner:InvokeMoveNext <0x000d7>
at System.Threading.ExecutionContext:RunInternal <0x0040b>
at System.Threading.ExecutionContext:Run <0x00073>
at MoveNextRunner:Run <0x0018f>
at System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction <0x00183>
at System.Threading.Tasks.Task:FinishContinuations <0x0032b>
at System.Threading.Tasks.Task:FinishStageThree <0x00153>
at System.Threading.Tasks.Task:FinishStageTwo <0x003bb>
at System.Threading.Tasks.Task:Finish <0x001c3>
at System.Threading.Tasks.Task:ExecuteWithThreadLocal <0x002cb>
at System.Threading.Tasks.Task:ExecuteEntry <0x001d7>
at System.Threading.Tasks.Task:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem <0x0005f>
at System.Threading.ThreadPoolWorkQueue:Dispatch <0x00507>
at System.Threading._ThreadPoolWaitCallback:PerformWaitCallback <0x0007f>
at <Module>:runtime_invoke_bool <0x000bb>
=================================================================
06-08 16:50:38.262 F/libc ( 8383): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 8439 (Thread Pool Wor)
This is most likely a result of drawing to the screen from a view, but in the background?
You cannot draw to the screen from a background task or even any task. The on-screen canvas most often only lives as long as the PaintSurface event is executing. This is because the OS is no longer doing the drawing and has moved on.
The paint events are always blocking. If you need to draw in the background, you must create a new surface and draw on that. Then you can draw that surface to the screen when it is done. To do this, trigger a refresh and then draw it.
You ssould never keep references to the surface or canvas that was provided by the view. This may be destroyed and recreated at any time.

JavaFx Scenebuilder.exe won't start and it looks like the included JVM won't run. How can I fix it?

Scenebuilder.exe will not start on my new PC either from IntelliJ, Windows explorer, or command line. It gives no errors and terminates instantly. On a hunch I tried running the included JVM in
C:\Program Files\SceneBuilder\runtime\bin
java --version
I get the log below and it shows an access exception that looks like a bug in the underlying JVM itself, not in the execution of the SceneBuilder code. I've been running JDK 11 on this AMD Ryzen just fine, and there are no DLLs sneaking in that do not belong there. I need help, thanks!
C:\Program Files\SceneBuilder\runtime\bin>java --version
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8e3bf8f29, pid=12296, tid=11532
#
# JRE version: (11.0.1+13) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, aot, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# V [jvm.dll+0x1e8f29]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Tim\AppData\Local\Temp\\hs_err_pid12296.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
C:\Program Files\SceneBuilder\runtime\bin>type C:\Users\Tim\AppData\Local\Temp\\hs_err_pid12296.log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8e3bf8f29, pid=12296, tid=11532
#
# JRE version: (11.0.1+13) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, aot, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# V [jvm.dll+0x1e8f29]
#
# 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
#
--------------- S U M M A R Y ------------
Command Line:
Host: AMD Ryzen 5 2600 Six-Core Processor , 12 cores, 15G, Windows 10 , 64 bit Build 18362 (10.0.18362.778)
Time: Sat Apr 25 09:02:07 2020 Eastern Daylight Time elapsed time: 0 seconds (0d 0h 0m 0s)
--------------- T H R E A D ---------------
Current thread (0x000002312e8c6000): JavaThread "Unknown thread" [_thread_in_vm, id=11532, stack(0x0000005029100000,0x0000005029200000)]
Stack: [0x0000005029100000,0x0000005029200000], sp=0x00000050291feee0, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x1e8f29]
V [jvm.dll+0x1e73d3]
V [jvm.dll+0x37524b]
V [jvm.dll+0x7394a9]
V [jvm.dll+0x3e467d]
V [jvm.dll+0x3e6951]
C [java.exe+0x3603]
C [java.exe+0x178dc]
C [KERNEL32.DLL+0x17bd4]
C [ntdll.dll+0x6ce51]
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000
Registers:
RAX=0x0000a780aacf8fcc, RBX=0x0000000000000000, RCX=0x0000000000000000, RDX=0x0000000000000006
RSP=0x00000050291feee0, RBP=0x0000000000000000, RSI=0x000002312e8c6000, RDI=0x0000000000000000
R8 =0x0000000000000006, R9 =0x0000000000000006, R10=0x0000000000000006, R11=0x00000050291fe750
R12=0x0000000000000000, R13=0x00007ff8e3ff6d90, R14=0x000002312c602d98, R15=0x00000050291ff938
RIP=0x00007ff8e3bf8f29, EFLAGS=0x0000000000010256
Top of Stack: (sp=0x00000050291feee0)
0x00000050291feee0: 000002312c60db10 00007ff94e71c6c0
0x00000050291feef0: 00000050291ff938 000002312c602d98
0x00000050291fef00: 0000000000000000 0000000000000400
0x00000050291fef10: 00006181910f784b 00007ff8e3ff6d90
0x00000050291fef20: 0000000000000000 00000050291ff938
0x00000050291fef30: 000002312c602d98 00007ff8e3ff6d90
0x00000050291fef40: 0000000000000000 00007ff92e470000
0x00000050291fef50: 00007ff8e4282558 0000000000000000
0x00000050291fef60: 00007ff8e3bf7277 00007ff94e6d1b1c
0x00000050291fef70: 0000000000000000 00007ff8e40745dd
0x00000050291fef80: 0000a780aacf8fcc 000002312c602d98
0x00000050291fef90: 00007ff800000000 00007ff8e3ff6d90
0x00000050291fefa0: 000002312e8c6000 00000050291ff0c0
0x00000050291fefb0: 0000000000000000 00007ff8e3bf73d3
0x00000050291fefc0: 00007ff92e450000 00007ff92e47d088
0x00000050291fefd0: 00000050291ff0c0 000002312e8c6000
Instructions: (pc=0x00007ff8e3bf8f29)
0x00007ff8e3bf8f09: b8 00 00 00 48 8b 05 bc 40 85 00 48 33 c4 48 89
0x00007ff8e3bf8f19: 84 24 a0 00 00 00 48 8b e9 48 83 cb ff 48 ff c3
0x00007ff8e3bf8f29: 80 3c 0b 00 75 f7 33 f6 c6 44 24 30 01 40 38 35
0x00007ff8e3bf8f39: c2 62 88 00 74 17 40 38 35 a3 c9 87 00 75 0e 33
--------------- P R O C E S S ---------------
Threads class SMR info:
_java_thread_list=0x000002312c602d50, length=0, elements={
}
Java Threads: ( => current thread )
Other Threads:
[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8e414e1fd]
VM state:not at safepoint (not fully initialized)
VM Mutex/Monitor currently owned by a thread: None
[error occurred during error reporting (printing compressed oops mode), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8e4163b67]
Deoptimization events (0 events):
No events
Classes redefined (0 events):
No events
Internal exceptions (0 events):
No events
Events (0 events):
No events
Dynamic libraries:
0x00007ff6af5a0000 - 0x00007ff6af5e7000 C:\Program Files\SceneBuilder\runtime\bin\java.exe
0x00007ff9512e0000 - 0x00007ff9514d0000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007ff950230000 - 0x00007ff9502e2000 C:\WINDOWS\System32\KERNEL32.DLL
0x00007ff94e6c0000 - 0x00007ff94e963000 C:\WINDOWS\System32\KERNELBASE.dll
0x00007ff94fb00000 - 0x00007ff94fba3000 C:\WINDOWS\System32\ADVAPI32.dll
0x00007ff9502f0000 - 0x00007ff95038e000 C:\WINDOWS\System32\msvcrt.dll
0x00007ff951200000 - 0x00007ff951297000 C:\WINDOWS\System32\sechost.dll
0x00007ff94f9e0000 - 0x00007ff94fb00000 C:\WINDOWS\System32\RPCRT4.dll
0x00007ff94f390000 - 0x00007ff94f524000 C:\WINDOWS\System32\USER32.dll
0x00007ff94f2e0000 - 0x00007ff94f301000 C:\WINDOWS\System32\win32u.dll
0x00007ff94f530000 - 0x00007ff94f556000 C:\WINDOWS\System32\GDI32.dll
0x00007ff94e520000 - 0x00007ff94e6b4000 C:\WINDOWS\System32\gdi32full.dll
0x00007ff94f240000 - 0x00007ff94f2de000 C:\WINDOWS\System32\msvcp_win.dll
0x00007ff94e270000 - 0x00007ff94e36a000 C:\WINDOWS\System32\ucrtbase.dll
0x00007ff942260000 - 0x00007ff9424e5000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.778_none_e6c6b761130d4fb8\COMCTL32.dll
0x00007ff947e60000 - 0x00007ff947e6a000 C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007ff94f640000 - 0x00007ff94f976000 C:\WINDOWS\System32\combase.dll
0x00007ff94e370000 - 0x00007ff94e3f0000 C:\WINDOWS\System32\bcryptPrimitives.dll
0x00007ff950df0000 - 0x00007ff950e1e000 C:\WINDOWS\System32\IMM32.DLL
0x00007ff94aa90000 - 0x00007ff94aaa6000 C:\Program Files\SceneBuilder\runtime\bin\vcruntime140.dll
0x00007ff932a30000 - 0x00007ff932ada000 C:\Program Files\SceneBuilder\runtime\bin\msvcp140.dll
0x00007ff8e3a10000 - 0x00007ff8e4552000 C:\Program Files\SceneBuilder\runtime\bin\server\jvm.dll
0x00007ff950220000 - 0x00007ff950228000 C:\WINDOWS\System32\PSAPI.DLL
0x00007ff94ae30000 - 0x00007ff94ae54000 C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007ff93c080000 - 0x00007ff93c089000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007ff950d80000 - 0x00007ff950def000 C:\WINDOWS\System32\WS2_32.dll
0x00007ff94ae00000 - 0x00007ff94ae2d000 C:\WINDOWS\SYSTEM32\WINMMBASE.dll
0x00007ff94e4d0000 - 0x00007ff94e51a000 C:\WINDOWS\System32\cfgmgr32.dll
0x00007ff94e250000 - 0x00007ff94e261000 C:\WINDOWS\System32\kernel.appcore.dll
0x00007ff94a980000 - 0x00007ff94a991000 C:\Program Files\SceneBuilder\runtime\bin\verify.dll
0x00007ff93d1a0000 - 0x00007ff93d394000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL
0x00007ff93cf30000 - 0x00007ff93cf5a000 C:\WINDOWS\SYSTEM32\dbgcore.DLL
0x00007ff92e470000 - 0x00007ff92e499000 C:\Program Files\SceneBuilder\runtime\bin\java.dll
0x00007ff92e450000 - 0x00007ff92e466000 C:\Program Files\SceneBuilder\runtime\bin\zip.dll
0x00007ff94aa80000 - 0x00007ff94aa8a000 C:\Program Files\SceneBuilder\runtime\bin\jimage.dll
dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\SceneBuilder\runtime\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.778_none_e6c6b761130d4fb8;C:\Program Files\SceneBuilder\runtime\bin\server
VM Arguments:
java_command: <unknown>
java_class_path (initial): <not set>
Launcher Type: SUN_STANDARD
[Global flags]
uint G1ConcRefinementThreads = 10 {product} {ergonomic}
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
size_t InitialHeapSize = 267632960 {product} {ergonomic}
size_t MaxHeapSize = 4282127360 {product} {ergonomic}
uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic}
bool SegmentedCodeCache = true {product} {ergonomic}
bool UseCompressedClassPointers = true {lp64_product} {ergonomic}
bool UseCompressedOops = true {lp64_product} {ergonomic}
bool UseG1GC = true {product} {ergonomic}
bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic}
Logging:
Log output configuration:
#0: stdout all=warning uptime,level,tags
#1: stderr all=off uptime,level,tags
Environment Variables:
JAVA_HOME=C:\Users\Tim\jdk-13.0.2
PATH=...
USERNAME=Tim
OS=Windows_NT
PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD
--------------- S Y S T E M ---------------
OS: Windows 10 , 64 bit Build 18362 (10.0.18362.778)
CPU:total 12 (initial active 12)
Memory: 4k page, system-wide physical 16335M (7401M free)
TotalPageFile size 38863M (AvailPageFile size 26823M)
current process WorkingSet (physical memory assigned to process): 8M, peak: 8M
current process commit charge ("private bytes"): 3M, peak: 3M
vm_info: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS) for windows-amd64 JRE (11.0.1+13-LTS), built on Oct 6 2018 13:20:16 by "mach5one" with MS VC++ 15.5 (VS2017)
END.

WebService over c#/https .net 4.6.1 fails on W7 but works in .net 3.5

I have an app connecting to an Azure AppServer thorugh WebServices (using SoapHttpClientProtocol).
It was working perfectly on .NET 3.5sp1, when i upgraded to .NET 4.6.1, it works ok on w10 boxes, but some w7 or w8 fail with:
The underlying connection was closed: An unexpected error occurred on a send
If I modify the constructor adding:
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3;
it does works. But i want to use Tls1.2, instead of Ssl3. if i use
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
(or the default) it gives the error on the w7 and w8 boxes.
This is the list of ciphers presented to the server on the w10 (it works):
CONNECT spac-test.cloudapp.net:443 HTTP/1.1 Host:
spac-test.cloudapp.net Connection: Keep-Alive
A SSLv3-compatible ClientHello handshake was found. Fiddler extracted
the parameters below.
Version: 3.3 (TLS/1.2) Random: 58 17 93 A5 5C 57 36 C2 97 69 48 B2 92
5C 93 44 86 1A 87 99 19 53 4D 04 C4 CB EE C0 87 70 30 67 "Time":
1/10/2058 1:26:48 AM SessionID: empty Extensions:
server_name xxx.cloudapp.net
elliptic_curves unknown [0x1D),
secp256r1 [0x17], secp384r1 [0x18] ec_point_formats uncompressed
[0x0]
signature_algs sha256_rsa, sha384_rsa, sha1_rsa, sha256_ecdsa,
sha384_ecdsa, sha1_ecdsa, sha1_dsa, sha512_rsa, sha512_ecdsa
SessionTicket empty
extended_master_secret empty
renegotiation_info 00
Ciphers:
[C02C] TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
[C02B] TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
[C030] TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
[C02F] TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
[009F] TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
[009E] TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
[C024] TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
[C023] TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
[C028] TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
[C027] TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
[C00A] TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
[C009] TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
[C014] TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA
[C013] TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA
[0039] TLS_DHE_RSA_WITH_AES_256_SHA
[0033] TLS_DHE_RSA_WITH_AES_128_SHA
[009D] TLS_RSA_WITH_AES_256_GCM_SHA384
[009C] TLS_RSA_WITH_AES_128_GCM_SHA256
[003D] TLS_RSA_WITH_AES_256_CBC_SHA256
[003C] TLS_RSA_WITH_AES_128_CBC_SHA256 [0035] TLS_RSA_AES_256_SHA
[002F] TLS_RSA_AES_128_SHA [000A] SSL_RSA_WITH_3DES_EDE_SHA
[006A] TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
[0040] TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
[0038] TLS_DHE_DSS_WITH_AES_256_SHA
[0032] TLS_DHE_DSS_WITH_AES_128_SHA
[0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA
Compression: [00] NO_COMPRESSION
... and here is what is being presented on the PC which DOES NOT WORK:
A SSLv3-compatible ClientHello handshake was found. Fiddler extracted
the parameters below.
Version: 3.3 (TLS/1.2) Random: 58 17 97 37 8C 71 81 A2 0F 25 5F BE 3F
D1 37 8D B8 4C 4F D3 58 BF A5 C6 EB DE E7 C3 6B 74 5D 86 "Time":>
Ciphers:
22/07/1999 9:06:32 SessionID: empty Extensions:
renegotiation_info 00
server_name xxxx.cloudapp.net
elliptic_curves secp256r1 [0x17], secp384r1 [0x18]
ec_point_formats uncompressed [0x0]
signature_algs sha256_rsa,
sha384_rsa, sha1_rsa, sha256_ecdsa, sha384_ecdsa, sha1_ecdsa, sha1_dsa
[003C] TLS_RSA_WITH_AES_128_CBC_SHA256
[002F] TLS_RSA_AES_128_SHA [003D] TLS_RSA_WITH_AES_256_CBC_SHA256
[0035] TLS_RSA_AES_256_SHA [0005] SSL_RSA_WITH_RC4_128_SHA
[000A] SSL_RSA_WITH_3DES_EDE_SHA
[C027] TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
[C013] TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA
[C014] TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA
[C02B] TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
[C023] TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
[C02C] TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
[C024] TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
[C009] TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
[C00A] TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
[0040] TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
[0032] TLS_DHE_DSS_WITH_AES_128_SHA
[006A] TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
[0038] TLS_DHE_DSS_WITH_AES_256_SHA
[0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA [0004] SSL_RSA_WITH_RC4_128_MD5
Compression: [00] NO_COMPRESSION
I suppose has something to do with the ciphers been negotiated, but will like to make w7 use tls1.2 (I check options in IE show "use Tls1.2", also instaled the registry settings to enable tls 1.2 in w7 :
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client]
"DisabledByDefault"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server]
"DisabledByDefault"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"DisabledByDefault"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
"DisabledByDefault"=dword:00000000
any suggestions?
thanks

Getting an error while trying to send SS command using USAT application

I'm trying to have a USIM perform call forwarding (a.k.a call redirection) using the proactive command SEND SS (TS 31.111 sections: 6.4.11, 8.14, etc.). Unfortunately I keep getting an error from the network which I can't understand.
I'm trying the following sequence:
ME->USIM: 8012000018 (FETCH from the ME toward UICC)
USIM->ME: 12 (procedure byte)
USIM->ME: D01681030411008202818305000909FFAA120A25556777B49000
D0 (proactive command) 16 (length)
81 (command details) 03 (length) 04 (command number) 11 (SEND SS) 00 (RFU)
82 (device identities) 02 (length) 81 (UICC) 83 (network)
05 (alpha identifier) 00 (length)
909FFAA120A25556777B4 (SS String = **21*0525576774#)
9000 (OK)
ME->USIM: 801400000D (Terminal response of size 0x0D)
USIM->ME: 14 (procedure byte)
ME->USIM: 81030411000202828103023424
81 (command details) 03 (length) 04 (command number) 11 (SEND SS) 00 (RFU)
02 (device identities) 02 (length) 82 (ME) 81 (UICC)
03 (Result) 02 (length) 34 (SS Return Error) 24 (???)
I can't figure out what '24' means.
Just to make sure I'm using a correct SS string, I activated CALL CONTROL on the USIM and dialed **21*0525576774# in the keypad. The result was as follows:
ME->UICC: 80C200001C (Envelope of length 0x1C)
UICC->ME: C2 (procedure byte)
ME->UICC: D41A020282810909FFAA120A25556777B4130924F51027D078CF0013
D4 (envelope) 1A (length)
02 (device identities) 02 (length) 82 (ME) 81 (UICC)
09 (send ss) 09 (length) FFAA120A25556777B4 (SS string)
13 (location information) 09 (length) 24F51027D078CF0013 (not relevant)
USIM->ME: 9000 (OK)
As you can see, the SS string is identical. When the ME sends it it seems to work (call forwarding is activated) yet when I try to send it from the UICC to the network I get the error '3424'.
I've searched through the specs (TS 31.111, TS 22.030 and even TS 24.080) but didn't find even the tiniest lead as to what I'm doing wrong.
Any help will be appreciated :)
Cheers,
Nir.
I think the problem occurs due to timer management(Action in contradiction with the current timer state) becouse
0x34-> Means SS Return Error
0x24-> Means Action in contradiction with the current timer state.

UDP packet does not arrive

I'm not sure if this is the right place to ask this question. If not, i will remove it...
Anyway, i have made driver for enc28j60 for LPC1788 and I'm trying to send UDP message to it from iOS. Sending fails.
Communication starts by iOS sending the ARP request. On LPC i make response and send it to iOS MAC address. I have read RFC for ARP and created packet by the specification, but for some reason i dont see the response in network sniffer.
That would for sure indicate that my response routine does not work, if there was not this case when i send udp message from OSX (nc -u xxx.xxx.xxx.xxx port) that comes correctly to LPC.
The difference that i observed is that OSX sends the request which is 42bytes long and gets 60bytes long response with last 18bytes of 0's (padding bytes), and iOS sends the 60byte long request with last 4bytes as 90 eb 58 96.
I tried to respond with all padding zeros, and with copying those 4 bytes, but neither approach worked.
OSX ARP(req, res) and UDP package is visible in sniffer.
iOS ARP req is visible in sniffer and nothing else.
Any idea ?
EDIT:
IOS code:
CFSocketRef sock = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0, NULL, NULL);
if ( sock == NULL) {
NSLog(#"CfSocketCreate Failed");
}else{
struct sockaddr_in remoteAddress;
memset(&remoteAddress, 0, sizeof(remoteAddress));
remoteAddress.sin_family = AF_INET;
remoteAddress.sin_len = sizeof(remoteAddress);
remoteAddress.sin_port = htons(1200);
remoteAddress.sin_addr.s_addr = inet_addr("192.168.5.8");
char data[] = "test";
NSData *message_data = [NSData dataWithBytes:&data length:4];
NSData* remoteAddressData = [NSData dataWithBytes:&remoteAddress length:sizeof(remoteAddress)];
CFSocketError er = CFSocketSendData(sock, (__bridge CFDataRef)(remoteAddressData), (__bridge CFDataRef)message_data, 0);
}
LPC code:
void make_arp_response (uint8_t *buffer)
{
uint16_t pos = sizeof (ethernet.source)+sizeof (ethernet.dest);
uint8_t type[2];
type[0] = ARP_TYPE>>8;
type[1] = (uint8_t)ARP_TYPE;
memcpy (buffer+pos, &type, sizeof (ethernet.type)); pos = sizeof(ethernet); //set ethernet type
arp.hwType = ((0x01)<<8);
memcpy (buffer+pos, &arp.hwType, sizeof (arp.hwType)); pos += sizeof(arp.hwType);
arp.protocol[0] = 0x08;
arp.protocol[1] = 0x00;
memcpy (buffer+pos, &arp.protocol, sizeof (arp.protocol)); pos += sizeof(arp.protocol);
memcpy (buffer+pos, &arp.macLen, sizeof (arp.macLen)); pos += sizeof(arp.macLen);
memcpy (buffer+pos, &arp.ipLen, sizeof (arp.ipLen)); pos += sizeof(arp.ipLen);
arp.opCode = (0x02) << 8;
memcpy (buffer+pos, &arp.opCode, sizeof (arp.opCode)); pos += sizeof(arp.opCode);
memcpy (buffer+pos, &macaddr, sizeof (arp.sourceMac)); pos += sizeof(arp.sourceMac);
memcpy (buffer+pos, &arp.destIP, sizeof (arp.sourceIp)); pos += sizeof(arp.sourceIp);
memcpy (buffer+pos, &arp.sourceMac, sizeof (arp.destMac)); pos += sizeof(arp.destMac);
memcpy (buffer+pos, &arp.sourceIp, sizeof (arp.destIP));
enc28j60_PacketSend(sizeof (ethernet)+sizeof (arp),buf);
}
UPDATE:
It seems that this is not just an iOS problem, but problem with Wifi clients. I have tried to send UDP from windows laptop over wifi and it also sends the ARP request but response and UDP packet got lost somehow. It seems that my ruter have some problems with my LPC :)
I have also tried to connect Arduino to the same enc28j60 board instead of LPC, and UDP communication works.
Library for arduino is found somewhere on the NET. ARP response in arduino code looks the same to me.
UPDATE 2:
Arp request:
ff ff ff ff ff ff 85 29 fb 0d c2 71 08 06 00 01
08 00 06 04 00 01 85 29 fb 0d c2 71 c0 a8 05 28
00 00 00 00 00 00 c0 a8 05 08 00 00 00 00 00 00
00 00 00 00 00 00 00 00 25 a9 c3
Arp response:
85 29 fb 0d c2 71 7b c3 53 a6 9c 55 08 06 00 01
08 00 06 04 00 02 7b c3 53 a6 9c 55 c0 a8 05 08
85 29 fb 0d c2 71 c0 a8 05 28
This response is dumped from LPC just after sending it on wire. I didnt saw it in sniffer.

Resources