Failed to load idd sample driver on windows 10 1809? - driver

I build microsoft iddsampledriver, set _NT_TARGET_VERSION to 10.0.14393, UMDF version to 2.19 and IddCx version to 1.0
When install the driver on windows 10 1809, but failed to load with error CM_PROB_FAILED_ADD.
I try to windbg and confirm that DllMain is called with true returned, then terminates:
0:008> bu iddsampledriver!DllMain
0:008> bu iddsampledriver!DriverEntry
0:008> g
UMDF: User-mode debugger found - breaking in.
(1a98.aa4): Break instruction exception - code 80000003 (first chance)
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\System32\KERNELBASE.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SYSTEM32\WUDFPlatform.dll -
KERNELBASE!DebugBreak+0x2:
00007ff8`389c2452 cc int 3
0:006> g
Breakpoint 0 hit
iddsampledriver!DllMain:
00007ff8`1d324b00 4c89442418 mov qword ptr [rsp+18h],r8 ss:00000018`19d7f350=0000e9f0772e30d7
0:009> g
ModLoad: 00007ff8`18720000 00007ff8`1890d000 C:\Windows\System32\dbghelp.dll
Breakpoint 0 hit
iddsampledriver!DllMain:
00007ff8`1d324b00 4c89442418 mov qword ptr [rsp+18h],r8 ss:00000018`19cff700=0000e9f077363527
0:008> g
Wudfx2000: FxDriverEntrydUm Enter PDRIVER_OBJECT_UM 0x000001C82F4C4540
ModLoad: 00007ff8`10e60000 00007ff8`10efc000 C:\Windows\System32\WUDFx02000.dll
Wudfx2000: FxDriverEntryUm: PDRIVER_OBJECT_UM 0x000001C82F4C4540 Successfully bound to version library
FxStubBindClasses: VersionBindClass WDF_CLASS_BIND_INFO 0x00007FF81D32F1F0, class IddCx, returned status 0x80070002
Breakpoint 0 hit
iddsampledriver!DllMain:
00007ff8`1d324b00 4c89442418 mov qword ptr [rsp+18h],r8 ss:00000018`19bfeca0=0000000000000000
0:006> g
ntdll!NtTerminateProcess+0x14:
00007ff8`3c820d74 c3 ret
0:000> g
^ No runnable debuggees error in 'g'
0:000> g
^ No runnable debuggees error in 'g'
After DllMain is called, FxStubBindClasses return 0x80070002 when bind class IddCx then terminates. It's confirmed that IddCx version is supported by win10 1809 of which os internal version is 17763. But why WDF failed to bind classes?

Related

wine fixme wait_for_withdrawn_state window

I am running a Windows execuable (.exe) using wine, in a docker container and I am dumping the graphical interface using xvfb-run. The setup is working but with some fixmes and some errors which I am trying to understand what do they mean.
The most common and fixme is:
002c:fixme:event:wait_for_withdrawn_state window 0x1004a/e00001 wait timed out
0024:fixme:event:wait_for_withdrawn_state window 0x10086/a00003 wait timed out
I found here that it means that:
Your application X Windows are possibly staying in a Withdrawn (aka limbo) state - because Wine isn't drawing to the correct X (Xvfb) Display.
However I do not understand what is this withdrawn state and why wine isn't drawing to the corrcect X. Furthermore the same fixme is present when running wine with xvfb locally without docker.
Thank you!
The whole log from the docker-xvfb-wine setup:
$ xvfb-run --server-num=99 wine my.exe (runs using a run.sh specified by the CMD clause in the dockerfile)
0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0048:err:ole:start_rpcss Failed to open RpcSs service
002c:fixme:event:wait_for_withdrawn_state window 0x1004a/e00001 wait timed out
wine: configuration in L"/root/.wine" has been updated.
0024:fixme:event:wait_for_withdrawn_state window 0x10086/a00003 wait timed out
0024:fixme:event:wait_for_withdrawn_state window 0x1007c/a00001 wait timed out
X connection to :99 broken (explicit kill or server shutdown).
The log from the xvfb-wine setup (without docker):
$ xvfb-run --server-num=99 wine my.exe
0034:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0034:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0048:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0048:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0050:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0050:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0024:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0024:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00cc:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00cc:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0024:fixme:font:freetype_set_outline_text_metrics failed to read full_nameW for font L"Ani"!
0024:fixme:event:wait_for_withdrawn_state window 0x20044/c00003 wait timed out
0024:fixme:event:wait_for_withdrawn_state window 0x1007a/c00001 wait timed out
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":99"
after 19 requests (19 known processed) with 0 events remaining.
You need to start a window manager, like bspwm.
Xvfb :99 &
export DISPLAY=:99
bspwm &
wine some.exe

JVM crash on Tesseract.getWords API invocation running with ubuntu docker image

I am trying to extract words from image using tess4j. When I invoke getWords API then JVM crashes in some case.
Following are the versions for relevant packages/software
Java version: 11
Tomcat version: 8.5
Relevant java dependencies
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tesseract-platform</artifactId>
<version>4.0.0-1.4.4</version>
</dependency>
Followings are my observation
If I run the same setup on my fedora (version 29) desktop it works fine.
If I run inside docker with the same setup but with the base image as ubuntu:18.04, then on extraction of words from image JVM crashes.
Please note that env TESSDATA_PREFIX is set appropriately. Also I tried by setting LC_ALL=C but no luck if I run with docker image.
Crash report from catalina.out
contains_unichar_id(unichar_id):Error:Assert failed:in file ../ccutil/unicharset.h, line 513
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f1fe7aa369b, pid=40, tid=89
#
# JRE version: Java(TM) SE Runtime Environment (11.0.2+9) (build 11.0.2+9-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.2+9-LTS, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libtesseract.so.4+0x25969b] ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x16b
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /app/identity-service/core.40)
#
# An error report file with more information is saved as:
# /app/identity-service/hs_err_pid40.log
#
# 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.
One of thread the had problem from thread dump
Current thread (0x00007f210015a800): JavaThread "fb5c080c-25bb-494a-8e6d-1df6df91c188" daemon [_thread_in_native, id=89, stack(0x00007f206e7d2000,0x00007f206e8d3000)]
Stack: [0x00007f206e7d2000,0x00007f206e8d3000], sp=0x00007f206e8cdbb0, free space=1006k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libtesseract.so.4+0x25969b] ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x16b
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.jna.Native.invokeInt(Lcom/sun/jna/Function;JI[Ljava/lang/Object;)I+0
j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;ZI)Ljava/lang/Object;+211
j com.sun.jna.Function.invoke(Ljava/lang/reflect/Method;[Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+271
j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
j com.sun.proxy.$Proxy25.TessBaseAPIRecognize(Lnet/sourceforge/tess4j/ITessAPI$TessBaseAPI;Lnet/sourceforge/tess4j/ITessAPI$ETEXT_DESC;)I+20
j net.sourceforge.tess4j.Tesseract.getWords(Ljava/awt/image/BufferedImage;I)Ljava/util/List;+31
Can you please help?
Update:
This turned out to be memory issue

busted No test files found matching Lua pattern: spec

my directory
the contents of the file 'hhh.lua' is the same as file 'btest_spec.lua' (see my directory)
when I run 'busted' (just use commond 'busted') ,it return an error:
0 successes / 0 failures / 1 error / 0 pending : 0.00003 seconds
Error → No test files found matching Lua pattern: _spec
when I run 'busted btest_spec.lua' , it success and return :
●●
2 successes / 0 failures / 0 errors / 0 pending : 0.003049 seconds
when I run 'busted *', it success and return :
●●●●
4 successes / 0 failures / 0 errors / 0 pending : 0.006815 seconds
so ,why busted fail to find file 'btest_spec.lua' when I run 'busted'?
I had the same error (macOS Sierra, fish shell) and solved it by running busted . instead of just busted. Note the period indicating busted should look in the current working directory.
This is due to a break in the dependency "penlight", which busted relies on.
See here - https://github.com/Olivine-Labs/busted/issues/528
The fixed version of penlight (1.4.1) is now on luarocks, which should fix your issue if you update busted.

Trace for function name from the output of cuda-memcheck

I'm running to cuda-memcheck to debug my code and the output is as follows
========= Program hit cudaErrorCudartUnloading (error 29) due to "driver shutting down" on CUDA API call to cudaFree.
========= Saved host backtrace up to driver entry point at error
========= Host Frame:/usr/lib/x86_64-linux-gnu/libcuda.so.1 [0x2e40d3]
========= Host Frame:./nmt [0x53526]
========= Host Frame:./nmt [0xfbd9]
terminate called after throwing an instance of '========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 [0x3c259]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 [0x3c2a5]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfc) [0x21ecc]
thrust::system::system_error'
========= Host Frame:./nmt [0x530a]
=========
what(): driver shutting down
========= Error: process didn't terminate successfully
========= Internal error (20)
========= No CUDA-MEMCHECK results found
Is it possible to tell from the line Host Frame:./nmt [0x53526] where is broken in the code? If so, how can I do that?
As #talonmies indicated (I suspect he will not mind if I post a CW answer), the cuda-memcheck tool provides additional stack back tracing capability, which can be enabled with the --show-backtrace switch added to the command line.
The back trace may consist of both host and device functions (i.e. host and device back traces.)
If the application has been also compiled with host debug symbol information (e.g. -g on linux) then cuda-memcheck can show function names for the host functions in the host backtrace.
Additional usage information is available in the documentation.
For me cuda-memcheck with different sub-tools such as memcheck, racecheck, initcheck and synccheck often produces host backtraces without the line numbers or even without the host functions mentioned. Searching on the internet only shows this question, but I already pass -g or even -g3 to the host compiler, and --show-backtrace flag to cuda-memcheck is said in the docs to be yes by default (passing it explicitly doesn't help). So I do the following with the backtrace:
Consider your compiled program is called a.out and you get a line in the host backtrace like Host Frame:./nmt [0x530a]. Then open your program in cuda-gdb with:
cuda-gdb a.out
Then, let your program load all the shared libraries (at least up to a point in main() function). Enter the following in cuda-gdb prompt:
b main
r
Then, look up the function name with:
info symbol 0x530a
Or look up the line number with:
info line *0x530a
Where 0x530a is the address cuda-memcheck printed for you. I guess NVIDIA could automate this easily (as well as demangling the host function names where they are printed).

StartService(), and 'sc start', return ERROR_FILE_NOT_FOUND

My remote Service works fine on my Server 2008, 32 bit, but when I try to run it on my Windows 7 machine StartService() fails with ERROR_FILE_NOT_FOUND.
OpenSCManager(), CreateService(), QueryServiceStatus() and OpenService() all return success, but StartService() fails.
I even compiled the Service from the SDK Samples\WinBase\Service and copied it to Windows\system32 directory on my Win 7 machine, and ran it with '-install'. When I tried to start it with 'SC start' it returns the same error.
Here is the info from SC:
C:\Windows\System32>sc query SimpleService
SERVICE_NAME: SimpleService
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 1077 (0x435)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\Windows\System32>sc qc SimpleService
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: SimpleService
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 3 DEMAND_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\Windows\System32\ServiceSvc.exe
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : Simple Service
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem
C:\Windows\System32>sc start SimpleService
[SC] StartService FAILED 2:
The system cannot find the file specified.
I even ran xCmd.exe on my Win 7 machine, it runs a similar type of remote Service, it gives virus warnings, but even that returns the same error.
I'm sure that if it was a permissions issue that it would probably return ERROR_ACCESS_DENIED.
I've searched all over the net and can't find anything on why it's returning that.
I'm pretty sure I found the problem.
I found code to detect if the app was running in WOW64
and it returned true, it was running on a 64 bit Windows 7 machine.
When it's running in WOW64 it goes to Windows\SysWOW64 not system32.
Once I copied the 32 bit Service .exe into Windows\SysWOW64
and ran it the Service started! :-)
Run the service executable from \windows\system32

Resources