Visual Studio Debugging program that you have the source code for - c++

I have an old program that started crashing recently, it only crashes on this particular pc running windows 7 x64 ultimate (I tried this program on another installation of Windows 7 x64 ultimate and there it works completly fine)
It crashes early due to acsess violation (c0000005) in msvcrt.dll
I have the source code for it: https://ftp.mozilla.org/pub/mozilla/releases/mozilla1.7.2/src/mozilla-source-1.7.2.tar.gz
and here is the binary I am testing against: https://ftp.mozilla.org/pub/mozilla/releases/mozilla1.7.2/mozilla-win32-1.7.2.zip
it crashes on from_strstr_to_strchr() function in msvcrt.dll
Visual Studio Debugger only shows me the dissasembly for msvcrt.dll and stacktrace starts there, it doesn't show me where firefox called this function and what data it passed to it...
I tried to add source code in solution->Common properties->Debug source files
but it still says Source code not uvailable (Source information is missing from the debug information for this module), I even tried to go to Options->Debugging and unchecked Require source code to be an exact match the original version, but visual studio still does not use the source code
I though ok, maybe its because I am trying to debug a release build, so I went and compiled firefox from source
this is the .mozconfig options I used
ac_add_options --disable-tests
ac_add_options --without-system-nspr
ac_add_options --without-system-zlib
ac_add_options --without-system-jpeg
ac_add_options --without-system-png
ac_add_options --without-system-mng
ac_add_options --enable-crypto
the problem is I cannot build firefox and debug it on the same machine (because on my build machine it works of course), and once I move it to my test machine it doesn't start because its missing msvcrtd.dll (and even if I provide it the dll from the internet or from my development machine it crashes (probably because DLL is for Visual C++ 6 and I have Visual C++ 2008 runtime installed on my test machine)
So how do I tell visual studio to debug an exe, provide it with the source code and let it show me on what function does the crash accour and what was the input to that function (I am suspecting its eather some file or registry entry that is somewhere on that pc that this old firefox is trying to read and failing), I even tried to uninstall and reinstall firefox (but sadly its installer never cleans everything up), even used Revo uninstaller to clean everything that it found, even trying to uninstall all the Visual C++ runtimes I found and reinstalled them again, but nothing...
Hope someone can help me because it drives me crazy (and yes, I need that version of firefox for a very old company application we are using....)
What is wierd the most is that firefox used to work a while ago, but then it just started to crash suddenly

Related

My program doesn't run on some PCs

I'm working in a project building an application with Computer Vision using C++, OpenCV and Visual Studio. I'm no expert in deploying programs to use them on other PCs.
I've made a program which I need to distribute to a certain amount of people and I can't make it work on all the computers I'd like to. The program was written using Visual Studio 2015, it's an MFC Project and the code is written in C++ since I'm using OpenCV.
When it was finished, I tried to run it on another computer and I realized that it won't open. I looked on the Internet and found out that I needed to statically link the libraries, so I did it. Also, when I was looking for information, I found that Visual Studio 2015 builds its projects so you can run the programs on machines with Win7 to Win10. When I learnt that, I tried to open it on PCs running Windows 7, 8, 8.1 and 10. I tested my program in like 20 computers, give or take.
The results? I couldn't make it work for Windows 7, the error ucrtbase.terminate api-ms-win-crt-runtime-l1-1-0.dll showed every time I tried to open it. It also didn't open in one machine with Windows 8 without showing any error message, but it DID open on most of the machines with Win 8.1 and Win 10. The thing is that "most"; there were some PCs (with Win 8.1 and 10) that I couldn't open my program on. I found that sometimes it would show up in the Task Manager for less than a second and then disappear. The most stressful thing is that it doesn't tell me what the problem is, it doesn't show any error message. It just won't open.
I tried using Dependency Walker (both on my PC and one of those that I couldn't run my program on) to see if there's something missing and I got a reeaaally long list of files that the system couldn't find, here's an example:
List 1/11. Something curious is that my program executes just well on my computer and on those I could open it, even though Dependency Walker (DW) tells me that there might be a problem with it. This indicates me that DW is not finding the exact error I'm having.
Another thing I've tried is to compare the things I have installed on my computer and install them on the one I want to execute my program on. I tried installing .NET Framework 4.6.1 just because VS 2015 says that my project was built using it (and I have it installed in my PC and that other one doesn't. Also I tried with .NET 4.6.1 SDK). Nothing changed.
Just look here:
https://msdn.microsoft.com/de-de/library/ms235299.aspx
The quick-and-dirty way would be to copy the DLLs from your redist directory. For my MS VS 2013 it is hidden under the VS installation directory in:
VC\redist\x86
or
VC\redist\x64
...
which depends on your application.

UWP/WinRT: App stopped working after November update

I have a Universal Windows Platform app that was working fine. My development machine is running Windows 10, and after the Windows 10 November Update (1511, build 10586), the development version built by Visual Studio has stopped working. I was actually running this day-to-day as a standalone app, and I noticed this problem when after the update the app started immediately closing after the splash screen.
I uninstalled the development version of my app and installed the store version, and that works fine, even though no code has changed between the two versions. I updated Visual Studio to Update 1, and it still doesn't work. I've fully uninstalled and reinstalled Visual Studio but that didn't help either. I've also tried changing the Project Properties to target platform version 10.0.10586.0 and rebuilding, but that also doesn't seem to help.
This occurs on both Release and Debug builds, and on both x86 and x64.
On launch, it gets as far as the splash screen before informing me that I've triggered a breakpoint. The breakpoint was not set by me, but rather is in KernelBase.dll, and no source is available.
If I hit Continue, then I get an Unhandled exception at 0x00007FFC4C431F08 (KernelBase.dll). The body of the error is:
0x00000004: The system cannot open the file (parameters: 0xFFFFFFFF80004005, 0x0000000000000005).
Hitting Continue again will get me into my code, which dies with:
Microsoft C++ exception: Platform::COMException ^ at memory location 0x000000C1517FAF50. HRESULT:0x802B000A The text associated with this error code could not be found.
Any ideas on what happened and how to correct?

0xc000007b error in Visual Studio project

I've created my C++ aplication that loads 2 DLLs: 1 wrriten in MASM assembler and the second written in C++. It uses Windows Forms' UI and works fine, but only on my computer.
On computers of all of my friends it causes 0xc000007b error that I'm unable to solve. I read everything I found about this error. Nothing helps.
I tried to do anything with manifests options in linker section, I tried to add lot of different DLLs to folder with project, I tried to use Debug and Release versions, I tried to change it to x64 version (without success).
I used dependency walker, it shows lot of DLLs missing (even though on my computer program works.) - I don't know what to do with this.
Do you have any idea? In my application I use only Windows Forms, fstream, msclr\marshal_cppstd.h and my DLLs.

VC C++ 2008 redistributable error

Okay so I have read a few responses about this topic and can't seem to find someone having the same issue.
Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one?
http://www.codeproject.com/Articles/43681/Side-by-Side-Configuration-Incorrect
background: I work on Fortran code that use a few c++ libs that I don't have access to the code of. These were apparently built using VS2008, and this error has only started to occur since my machine had to be rebooted and I asked IT not to install VS2008 in addition to VS2012. I know that installing VS2008 will fix the problem, but that is not a good soultion.
The error is: unable to start program 'C:\blah\blah\blah.exe'. This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors. Reinstalling the application may fix this problem. For more details, please see the application event log. The application event log tells me the same things listed in the first link posted.
Originally I was getting the problem so I looked up these articles and I went and installed the correct version of the VC C++ redist package (it is version 9.0.21022.8 for x86 source:the manifest file for the project). I originally installed the 64 bit, quickly determined I needed the 32 bit version and then installed that one.
I have the folders and files within for
C:\Windows\winsxs\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b59bae9d65014b98
C:\Windows\winsxs\x86_microsoft.vc90.mfcloc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b59bae9d65014b98
C:\Windows\winsxs\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.21022.8_none_b59bae9d65014b98
The related manifest files also seem to be there.
The program still doesn't run even though the files are there. What am I missing?

Remote debugging C++ on the Windows Server 2008 platform with VS2010; MSVCP100D.dll missing

I've written a quick C++ console app using VS2010. I'd like to run it via the remote debugger on the Windows Server 2008 platform, in order to determine why I can't enumerate the CLSID_AudioInputDeviceCategory on that OS.
The console app works on the XP and W7 platforms.
The remote debugger gives the following error when I first tried to run the console app:
The program can't start because MSVCP100D.dll is missing from your computer. Try reinstalling the program to fix the problem.
I did try just copying this DLL from my development machine to the target folder on the remote machine, but it returned an even more obscure message:
The application was unable to start correctly (0xc0000007b). Click OK to close the application.
I've tried installing the VS2010 C++ re-distributable on the target host. This has no effect. I'm out of ideas, does anyone have any suggestions?
Having spent some time on this problem, I've noticed that the Windows Audio service on server 2008 was disabled, but my query is more to do with getting remote debugging working on the server 2008 platform than solving my audio hardware enumeration problem.
Thanks to Errata, I had a look at
Project Properties -> Configuration Properties -> C++ -> Code Generation
I changed Runtime Library from Multi-threaded Debug DLL to Multi-threaded Debug (/MTd).
This allows remote debugging without having to rely on the correct debug DLLs residing on the remote machine.
I hope this helps someone out there!
I had this exact situation. I grabbed copies of MSVCP100D.dll and MSVCR100D.dll. However I grabbed them from system32 (the 32-bit version), which resulted in the 0xc0000007b error.
0xc0000007b apparently means invalid DLL, often architecture mismatch between program and DLL (i.e. x86 and x64). In my case I grabbed the wrong (32-bit) version of the DLL from my developement computer resulting in 0xc0000007b. After grabbing the file from SysWOW64, it worked.