U-SQL code behind breakpoints not hit - visual-studio-2017

I am just learning Azure data lake analytics and U-SQL. I have a simple script that runs and produces the expected output. However when I set a breakpoint in the code behind helper method it is never hit because no symbols have been loaded. I have looked at all the available Microsoft tutorials and none suggest that I must do anything to enable debugging, it should just work when I run.
I am running on Local.
I am using F5 to run in debug mode.
Script completes successfully.
Output confirms that helper method is executed
U-SQL
#searchlog =
EXTRACT UserId int,
Start DateTime,
Region string,
Query string,
Duration int,
Urls string,
ClickedUrls string
FROM "/SearchLog.tsv"
USING Extractors.Tsv();
#searchlog = SELECT
UserId,
DataLake.Helper.Test() AS Test,
Start,
Region,
Query,
Duration,
Urls,
ClickedUrls
FROM #searchlog;
OUTPUT #searchlog
TO "/SearchLog_output.tsv"
USING Outputters.Tsv();
Code Behind
namespace DataLake
{
public class Helper
{
public static string Test()
{
Console.WriteLine("Stop");
return "Test";
}
}
}
Output Window
'DebugHost.exe' (CLR v4.0.30319: DefaultDomain): Loaded.
'C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561
934e089\mscorlib.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DefaultDomain): Loaded
'C:\Users\ksmith\Documents\Visual Studio
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\DebugHost.exe'.
Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Users\ksmith\Documents\Visual Studio
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Cosmos
.ScopeStudio.BusinessObjects.Debugger.dll'. Cannot find or open the PDB
file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Users\ksmith\Documents\Visual Studio
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Cosmos
.ScopeStudio.BusinessObjects.Common.dll'. Cannot find or open the PDB file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Users\ksmith\Documents\Visual Studio
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Analytics
.LocalRun.dll'. Cannot find or open the PDB file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c56
1934e089\System.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Users\ksmith\Documents\Visual Studio
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\Microsoft.Cosmos.
ClientTools.Shared.dll'. Cannot find or open the PDB file.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__
b77a5c561934e089\System.Core.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b
77a5c561934e089\System.Xml.dll'. Symbols loaded.
'DebugHost.exe' (CLR v4.0.30319: DebugHost.exe): Loaded
'C:\Users\ksmith\Documents\Visual Studio
2017\Projects\USQLApplication1\DataLake\bin\LocalDebug\ScopeRuntime.exe'.
Cannot find or open the PDB file.
The program '[28036] DebugHost.exe' has exited with code 0 (0x0).
Can anyone shed some light on why the breakpoints are not hit?
Adding Debugger.Launch(); caused the Choose Just-In-Time Debugger window to appear. If I select one of the options I then get an instance of visual studio were the code behind break points are hit. The VS instance is called LocalVertexHost
JIT Debugger
Thanks

It is some issue that the extension of DataLake Analytics has for visual studio. I have had, and still having, this issue. Follow these steps and it can be ok for some runs, then repeat it again:
Clean all the projects you have: ADLA and ADLA Class library;
Make sure that the debug folders are empty on both projects;
Rebuild and Register to your local ADLA the Class Library with the code behind;
Rebuild the script you are trying to debug;
Make the ADLA project your startup project;
Submit the script to your local ADLA (makes sure that you have all the needed files in debug and that the script is assigned as the startup script);
After the submit is successful, put the brak point into the code behind;
Start debugging;
If the breakpoint is not hit yet, then try to delete everything from the local U-SQL temporary folder and repeat again all the steps.

This happenes in my environment me when I click the Submit button in Visual Studio instead of hitting F5 or clicking on start (with debugging). Thought I should share even though you mention already running with f5 because this was the only mention of this issue I could find. Maybe this will be helpful to others.
I think clicking submit runs the usql script in a separate process without the debugger attached.

Go to the Debug options in Visual Studio and ensure the following:
Uncheck "Enable Just My Code"
Check "Suppress JIT optimization on module load"

Related

visual studio 2019 project

Everytime I run debugger I receive this message in the output:
'Project1.exe' (Win32): Loaded 'C:\Users\123em\OneDrive\Project1.exe'. Symbols loaded.
'Project1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'.
'Project1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'.
'Project1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'.
The thread 0x23e1c has exited with code 0 (0x0).
The program '[139372] Project1.exe' has exited with code 0 (0x0).
How can I see the result of my project? I am building a code to rotate an array.
I don't know what kind of result you expect, so I listed two methods for your reference.
Set a breakpoint and add the variable you want to monitor in "Add item to watch", so that you can observe the value of the variable, and it needs to be used with F11, I suggest you refer to this document for this.
Right-click the breakpoint, then select Action, and enter your ideal output format. When executing the program, you can see the output you set in output.

NVidia NVML nvmlDeviceGetMemoryInfo() loads and unloads nvapi64.dll immediately

I use some NVIDIA Management Library features to produce metrics in my application.
Every 1 second I call nvmlDeviceGetMemoryInfo() in a thread, and after a few minutes, in the output of Visual Studio, I can read hundreds of :
'MyApp.exe' (Win32): Loaded 'C:\Windows\System32\nvapi64.dll'.
'MyApp.exe' (Win32): Unloaded 'C:\Windows\System32\nvapi64.dll'
...
'MyApp.exe' (Win32): Loaded 'C:\Windows\System32\nvapi64.dll'.
'MyApp.exe' (Win32): Unloaded 'C:\Windows\System32\nvapi64.dll'
'MyApp.exe' (Win32): Loaded 'C:\Windows\System32\nvapi64.dll'.
'MyApp.exe' (Win32): Unloaded 'C:\Windows\System32\nvapi64.dll'
...
Other functions from NVML like nvmlDeviceGetCount(), nvmlDeviceGetHandleByIndex(), nvmlDeviceGetClockInfo() or nvmlDeviceGetUtilizationRates() don't produce this ponctual loading/unloading of the nvapi64.dll.
Is it possible to avoid unloading this dll, to keep it available for my next call to nvmlDeviceGetMemoryInfo() ?
EDIT :
I call this function to retreive gpu memory statistics like that :
nvmlMemory_t memInfo;
if (nvmlDeviceGetMemoryInfo(device, &memInfo) == NVML_SUCCESS) {
this->gpuMemUsed = memInfo.used;
this->gpuMemTotal = memInfo.total;
}
I see these output line in Debug and Release, each time I call nvmlDeviceGetMemoryInfo() there is on couple of Loaded nvapi64.dll / Unloaded nvapi64.dll
NVML comes with Cuda V10.2 .
you can simply call LoadLibraryW(L"nvapi64.dll"); after this dll already will be not unloaded (RbMm)
This did the trick

cv::imread doesn't work using release x64 (c++, visual studio 2013)

I'm trying to use openCV in microsoft visual studio project. My code is the following one:
cv::Mat IRGB; IRGB = cv::imread("C:\\Pierre\\Prog\\Toolboxes\\LibIm\\Tests_unitaires_cpp\\ressources\\mandrill.jpg");
if (IRGB.data){
cv::Mat IGray;
cv::cvtColor(IRGB, IGray, cv::COLOR_BGR2GRAY);
cv::imshow("Image originale", IGray);
cv::waitKey();
}
else{
std::cout << "L'image n'a pas été chargée" << std::endl;
}
I have set up the include path:
properties-> C/C++ -> $(OPENCV)\include
And also, the lib path:
properties -> Linker -> $(OPENCV)\x64\vc12\lib
properties ->Input -> Additional dependencies -> {opencv_calib3d249.lib opencv_contrib249.lib
opencv_core249.lib, ... }
The compilation indicates 0 errors and 0 warnings but when I run the program imread doesn't work and the image is empty.
Hoewever the followings messages are present in the console :
'Project1.exe' (Win32): Loaded 'C:\Windows\System32\msvfw32.dll'. Cannot find or open the PDB file.
'Project1.exe' (Win32): Loaded 'C:\Windows\System32\avifil32.dll'. Cannot find or open the PDB file.
'Project1.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file.
...
When I set up the project in x86 and release mode everything work perfectly.
I have seen a lot of related topics but most often the author did a mistake linking debug, x64 version with release, x86 mode or vice versa.
If you have any ideas or solutions for my problem i would be grateful
Regards

Debug Crash in DLL

Trying to debug a crash in one of our DLL's. It is loaded into Server Manager and crashes when trying to configure Active Directory Certificate Services (the DLL is a registered provider). I know the crash is an access violation and I have the pdb file, just don't know how to go about debugging this. I've read pages such as this and this (didn't help). I tried to glean the info using windbg (using lm to get the loaded address, which appears to be 8000000:
"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\windbg.exe" -z myKSP.dll
Then
0:000> lm
start end module name
00000001`80000000 00000001`8005e000 ...
Then, since the Event Viewer tells me:
Exception code: 0xc0000005
Fault offset: 0x000000000002a601
I tried to view that:
0:000> ln 80000000+2a601
Browse module
Set bu breakpoint
Nothing is shown.
I have VS2015, so, I tried to attach to the serververmanager.exe process. Next, I tried loading symbols via Tools->Options->Debugging->Symbols and specifying the path, but, when I set a breakpoint, I always receive "no symbols have been loaded". In the previous symbol windows, I set the cache folder, which downloaded a bunch of stuff, but that did not seem to load anything.
Clearly, I'm not using the tools correctly. How do I debug a DLL, compiled in Release mode, PDB is available, that is loaded by the ServerManager.exe or whatever sub-process it might spawn)?
Start windbg, press Ctrl-D to open your dump file, then type the following. That should give you either a significant stack after one of the kp500, or at least will tell you whether the pdb file doesn't match the binary.
.symfix
.sympath+ <FOLDER_WITH_YOUR_PDB>
.reload
!sym noisy
.reload /v /f myKSP.dll
!sym quiet
kp500
.ecxr
kp500

The application was unable to start correctly (0*0150002) - OpenCv

I'm working on a project written in opencv (2.1) using cpp 2010. When I try to debug it I get the following error:
'FaceTracker.exe': Loaded 'C:\Users\hodhod\Documents\Jam3a\PROJECT-2012!!\FindSymetryInFaces\FaceTracker\FaceTracker\Debug\FaceTracker.exe', Symbols loaded.
'FaceTracker.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped).
'FaceTracker.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped).
'FaceTracker.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Symbols loaded (source information stripped).
'FaceTracker.exe': Loaded 'C:\OpenCV2.1\bin\cv210d.dll', Cannot find or open the PDB file
The program '[4556] FaceTracker.exe: Native' has exited with code -1072365566 (0xc0150002).
And shows me the following message:
The application was unable to start correctly (0*0150002). Click Ok to close the application.
How can I solve it?
(I solved it, check the comments.)
(Answered by the OP in the comments. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
I Solved It. I went to Project -> Proporties -> Linker-> Input -> Additional Dependencies And Changed it from :
cv210d.lib; cvaux210d.lib; cxcore210d.lib; highgui210d.lib; ml210d.lib;
to:
cv210.lib; cvaux210.lib; cxcore210.lib; highgui210.lib; ml210.lib; opencv_ffmpeg210.lib;