Get D3D debug information? - windows-10

during initialisation of my D3D stuff, I call the following function:
hr = D3D11CreateDevice(nullptr,gDriverTypes[DriverTypeIndex],nullptr,
#ifdef _DEBUG
D3D11_CREATE_DEVICE_DEBUG,
#else
0,
#endif
gFeatureLevels,gNumFeatureLevels,D3D11_SDK_VERSION,&lDevice,&lFeatureLevel,&lImmediateContext);
In debug build, to get additional information about possible D3D errors, I set the flag D3D11_CREATE_DEVICE_DEBUG. Without any further actions this lets my application terminate immediately.
So according to Use D3D11 debug layer with VS2013 on Windows 10 I tried to install the required D3D-debug stuff by calling
Dism /online /add-capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0
within a admin-console on latest windows 10. Unfortunately this fails with
Deployment Image Servicing and Management tool
Version: 10.0.18362.1316
Image Version: 10.0.18363.1316
[==========================100.0%==========================]
Error: 0x8024500c
DISM failed. No operation was performed.
The log file is also not very helpful, it contains loads of error messages and error codes one can't understand easily.
So...are there alternative ways to get the D3D debug stuff that is required to work with D3D11_CREATE_DEVICE_DEBUG enabled?
Thanks :-)

For Windows 10, support for the Direct3D 11 and Direct3D 12 "Debug Device" is only available with the "Graphics Tools" Windows optional feature enabled.
The HRESULT of 0x8024500c indicates you have some problem with Windows Update on your system. It's WU_E_REDIRECTOR_CONNECT_POLICY.
Most likely your PC is on a corporate network using WSUS. You need to ask the IT admins to allow this Windows optional feature.

Related

Attaching MSVC 2012 profiler hangs the application

I have a C++ application (it's built using Qt 5.8 library and works with PostgreSQL 9.5 database in case it's relevant). The application is build by MSVC 2012 compiler, is 64-bit application and both debug and release versions run normally on their own and under cdb debugger.
When I try to profile the running application by Visual Studio instrument (Analyze -> Profiler -> Attach), it seemingly hangs as soon as it tries to do something meaningful: simply resizing a window or clicking on checkboxes works, but any attempt to compute new values and write them to database never succeeds, as if control flow didn't return from some call.
When I stop the profiling, Studio marks as a "hot path" sequence of calls RtlWalkFrameChain->RtlpWalkFrameChain->RtlpLookupFunctionEntryForStackWalks->RtlLookupFunctionTable->RtlAcquireSRWLockShared.
RtlpWalkFrameChain has the biggest "exclusive samples" count.
Trying to filter data to exclude initial several seconds of run (until the apparent freeze) results in "No Call Tree Data Is Available" message.
I didn't manage to find any article or post with a similar problem.
The project is build in Qt Creator (I don't have a project file Studio would understand, so I can't run "normal" performance analysis).
OS is Windows 7, exact version of Visual Studio is 11.0.61219.00 Update 5.
Any idea on the subject would be welcome.
Upd: When I try to profile the application with Luke Stackwalker profiler, it aborts with the message ERROR: StackWalk64-Endless-Callstack!. The only relevant comment about the message I found is this Stackoverflow question. When I run application under cdb debugger and then try to profile it with Luke Stackwalker, the error message is the same, but subsequent pause in the debugger shows the proper (or at least believable) stack for all threads. For the working thread debugger points to a line of code inside system library and doesn't advance no matter what I do (once again, without profiling attempts the application runs normally, debugger or not).

Error running app on Windows Phone 8.1 emulator - A dependent dll was not found

I have universal project targeting Windows Store 8.1 and Windows Phone 8.1 platform.
The windows one works fine but I having trouble running the WP one on an emulator. I get the error message saying:
Microsoft Visual Studio Unable to activate Windows Store app
'numbers-here!App'. The Kiss.WindowsPhone.exe process started, but the
activation request failed with error 'Msg in polish that the app did
not start'.
If this was Windows I would check System Event Log and see the logs just before the error what DLL the system was trying to load and that helped a lot when I was debugging similar problem with Windows Store project, here I have no clue on how to check what exactly was being loaded.
The worst part is that I created package (appx) and checked the dll's being packed with exe, it seems that it includes dependencies that the app explicility uses yet something is still missing and this might be some 'hidden' dependency of one of the other dlls.
Any ideas how to debug such issues with emulator?
For me it was due to having WIC code in my App and/or calling CoCreateInstance in a windows phone environment ( on PC it works flawlessly though )
I ran into the same problem on Windows 10. Turns out, that there is no Kernel32.dll on Windows 10 phone!
Instead you need to link against OneCore.lib which provides the entire Win32 API subset that is supported in UWP. This "umbrella library" will load the correct dlls at runtime.
See also:
https://msdn.microsoft.com/en-us/library/windows/desktop/mt683763(v=vs.85).aspx

JavaFX crashes X Server

Background/Context:
I'm currently developing a touch screen application which is aimed to run on Linux. As a development framework I chose JavaFX (jdk1.7.0_10) due to its rapid prototyping easiness. I'm using Arch Linux (kernel 3.6.10-1-ARCH) distribution and since JavaFX needs a head-full environment to run, I installed Xorg on top of the base configuration. Even thought I'm able to run my JavaFX application, I have some issues with popup windows that are being displayed in my application.
When trying to display those popup windows, sometimes they don't respond as expected or event worse, they crash my application. The error I get is the following:
The program 'java' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
(Details: serial 51101 error_code 9 request_code 62 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
By the way, when running the same application on Windows (my development machine), everything works fine.
I also tried to run a composite manager ('xcompmgr') since i was also getting some warnings like
Can't create transparent stage, because your screen doesn't support alpha channel. You need to enable XComposite extension.
but it didn't helped.
Question:
Am i missing some files or configurations in order to run smoothly JavaFX in Linux, or has any one encountered the same challenge? Since my main concern is performance (due to limited hardware specs), I don't want to install a full featured Linux distribution. I only need to run my JavaFX application.
Try running JavaFX in software rendering mode: java -Dprism.order=j2d -jar your.jar
Also note that your platforms seems to be not included into list of supported ones: http://www.oracle.com/technetwork/java/javafx/downloads/supportedconfigurations-1506746.html

Debugger.Launch() on windows service in Windows 8

After I installed Windows 8 perfectly legit statement like this doesn't work anymore:
#if DEBUG
Debugger.Launch();
#endif
Service starts ignoring that thing.
Yes, I am building the project in a debug mode.
if I change that to a Debugger.Break() - the service just fails, and still there's no dialog for attaching a debugger.
The secret lies in changing the registry key for the Visual Studio JIT debugger via the following:
reg add "HKCR\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}" /v AppIDFlags /t REG_DWORD /d 8 /f
Before making this change the value on my machine was 0x28. The above changes it to 0x8. In essence it removes the 0x20 flag.
If you search the Microsoft include files (WTypesbase.h) then you find the following:
#define APPIDREGFLAGS_IUSERVER_ACTIVATE_IN_CLIENT_SESSION_ONLY 0x20
Once you make this change then the JIT debugging window is displayed again. I believe that all of this relates to various session 0 security changes made by Microsoft.
Sourced from this post:
http://forums.arcgis.com/threads/69842-Debugging-your-SOE-on-Windows-8
Debugger.Launch would launch an application with a visual GUI. By default services do not interact with a desktop and thus anything they do cannot be "seen".
Support for interacting with the desktop has slowly been removed from Windows services ("Interact with the desktop" option has been removed from some Server versions for example). I would imagine they've continued this trend.
Windows Services by nature are not GUI applications, they can run before and after a user logs into a desktop and thus cannot show a GUI all the time. It's not generally a good idea to depend on an ability to have a GUI in a Service.
If what you want to do is debug a service, I suggest running it as a regular application so that you can do things like Launch and Debug. Shameless plug: you can see Developing Windows Services in Visual Studio for a way to write a service that supports that.
Is this a Windows Store app or a desktop app?
Try right-clicking on your project (the C# executable project if that's what you have) and selecting "Properties". Then in the left sidebar of options, click "Debug". In the "Start Action" section, check the box for "Do not launch, but debug my code when it starts".
Now you can hit F5 and run Visual Studio with breakpoints in your code, and it will sit and wait for you to fire up the process. Then run your application (outside of Visual Studio), and Visual Studio will attach the debugger.

wxWidgets wxWinCE suspend-resume crash (VC++)

I have an issue with a few Windows CE 5.0 devices which are crashing virtually as soon as they resume from standby (suspend). I have condensed the issue down to about 15 lines of C++ to simply get wxWidgets to display a message box, and the problem will hit if I:
Start the app
Suspend the device (by this I mean pressing the red power button briefly)
Resume the device
Pressing the OK button in the message box title.
BOOM
This problem manifested itself in many other ways before I condensed it down - on loading a bitmap, on scanning a barcode, all once it has been suspended, then resumed.
I am using the following:
Windows CE 5.0 Professional (Motorola MC3090 device)
(also WM 6.5 (MC55), CE 6.0 (MC3190))
Visual Studio 2005 SP2
wxWidgets 2.8.10
Microsoft Windows CE 5.0 Standard SDK
The actual error that is displayed is sporadic and wide ranging, but mostly an access violation, typically near the start address of a function call (discovered this by suspending the device, resuming then attaching VS debugger on the device). Having done extensive homework on this, I've read some suggestions it may be some kind of heap corruption occurring. As long as the app doesn't suspend, it always works correctly across all correct combinations of SDKs and devices.
I have also tried the following SDKs:
MS Pocket PC 2003 SDK
Symbol Platform SDK for MC3000c50a
Symbol Platform SDK for MC3000c50b
Windows Mobile 5.0 SDK
Windows Mobile 6.0 SDK
I have tested the following devices:
MC3090 (Windows CE 5.0) - Same Problem
MC55 (Windows Mobile 6.5) - Same Problem
MC3190 (Windows CE 6.0) - Problem does not occur on this device with StandardSDK build
I have played excessively with the setup of wxWidgets, always making sure that I link the app with the correct corresponding SDK.
Here is the code that causes this problem:
#include "wx/wxprec.h"
class Application : public wxApp {
public:
virtual bool OnInit();
};
bool Application::OnInit() {
wxMessageBox(L"Test");
return true;
}
IMPLEMENT_APP(Application)
Anyone with some advice out there, I would be eternally grateful! Please also let me know if I have left out any important details.
Are you running the application from an SD card? The MC3090, at least, and I think also the MC55, conform by default to the Windows CE standard for add-on buses (defined originally for PCMCIA cards): that when you suspend and resume the device, all buses are reset. This causes the card to momentarily disappear, and all handles to files opened on the card to be invalidated. This is actually so that the device can deal with the user changing the card while the device is suspended.
Windows CE is a demand-paged operating system. Your program is not all loaded into RAM when started: instead, pages are only loaded from the executable and DLLs as they are referenced by the program. Any read-only or unmodified pages can be discarded by the OS at any time, because it can re-read them from the original program file (this is why your program file can't be overwritten if the program is running). If the handle to the EXE or DLL is invalidated, and you reference a page that hasn't been loaded (or has been discarded), the OS page fault handler can't read the page and it generates an Access Violation exception.
For the MC3090, you can configure the SD card driver not to 'remove' the card on resuming from sleep. See Symbol's KB article MC30xx CE5.0 - Application aborting randomly when using SD Card for details. I can't find details of how to do this on the MC55. On the MC70, there was an 'SDSwitch' applet in the System control panel, whose main function was to switch between memory card and SDIO mode, but which also had a checkbox to control this option. Some other devices have had a 'sealed SD slot' CAB file in the \Windows folder - I seem to recall this on the MC65 or ES400.

Resources