I am trying find a problem with my program that is hooking into a game. This is
vc++. Basically I launch the program and then hook into it using SDL. When I run the code from VS2010, all works fine. But when I try to run from command prompt, my program can launch the game, but after that the game crashes immediately.
I was viewing windows event logs, and it appears that there is an access violation. 0xc000005
How can I log any further details about the program that crashes? I tried "procdump" but that is not useful as I cannot INDIRECTLY target the hooked game from console. Rather it can only target my application that hooks.
Anyway of getting detailed dumps is highly appreciated in this case.
Thanks!
You can perform postmortem debugging by using a combination of the WER registry keys/values to trap any dump that is produced. I’ve used this method to prevent the WER system from collecting the dump file (.dmp). I’ve also written about this in another similar post. To accomplish this, you will need to create a registry key under
Software\Microsoft\Windows\Windows Error Reporting
if one does not already exist. The key should be
LocalDumps\your application.exe
Once that’s done, modify these keys/values to meet your needs:
DumpCount, DumpFolder, DumpType
You’ll need Administrator rights to create and modify the keys, and, you should reset everything you’ve modified when you’re done debugging.
Related
We're trying to run a program at start with Ubuntu's Application Start-up command. We're successfully starting the camera and viewing the images. But the images are not saving to the folder we expect them to be saved too.
The program works flawlessly when started manually from the terminal. Saving into the appropriate folder.
Does anyone have any idea of how to get the images saved but when started from the Application Start-up command upon start-up?
Thanks.
You're not providing a whole lot of details, so my answer may be totally off. To me it sounds like you've created an app that takes a picture with the webcam and saves it to disk. Now you want the app run it when the user logs in, so you've added your app to the list of Startup Applications. The app starts, takes a picture, but can't write it do disk. If that's the case, I'd consider:
Try adding debug logging to your app, so you can see why it fails opening the file. What ever language this app is written in, if opening a file fails, the API will tell you. This information is vital. The easiest is to print to stdout and then, when starting the app, forward it to a log .e.g. /usr/local/bin/myapp &>> /tmp/myapp.log.
Try writing to a location like /tmp where permissions aren't that much of an issue.
Try adding a delay before starting the app, see this list of various approaches on how to do this, the most simple being using this a the command: sleep 10 ; /usr/local/bin/myapp &>> /tmp/myapp.log
If this is all rubbish you need to add more details in your question.
I have an issue when i execute my app.exe, there is an error which is revealed only in the ".exe", if i try todo the same thing when i use the sources, there is no problem, i think the problem is when there is a call of the update method from a datastore, it return -1 with generated .exe and 0 when i execute sources.
i have tried to refresh any library from my app, before building, but the issue remains, for information the app is using a DB2 DATABASE, and it is built and run in a windows7 environment.
The likely cause is that when you built the exe, the DataWindow object assigned to the DataStore wasn't included. You need to use a .pbr file in the Project object. Look in the help file under 'deploying your application'.
I have encountered this problem as well when I deployed strictly to a *.exe file. The problem went away when I deployed to a *.exe with a *.pbd. This is established on the "libraries" tab of your project by checking the pbd checkbox.
An 'exe' only deployment can't handle hard coded 'literal strings' in your code. Creating and deploying 'pbd' library will allow 'literal strings'.
I've been searching for a while and finding many old articles but also found one with a Regedit to enable the dumping of .dmp files, which isn't doing it.
Instructions I used are from Microsoft, Collecting User-Mode Dumps (MSDN)
According to Symantec no re-boot is required.
I created it for both:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\Windows Error Reporting\LocalDumps and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps.
All I get is a report.wer file. No dump. The event log is writing exceptions about every minute and about every 30 minutes the app pool dies, so I'm trying to get the details on where the problem is coming from.
Anyone know why those keys aren't working? Does the report.wer provide anything useful for me? One StackOverflow post said SOS extension and when I search for it Microsoft points me to download WinDbg which I already installed. A lot of instructions I find from 2008 and older seem out-dated.
Edit: I managed to get dump files by running the debugging tool on the server. But there's so much wrong information out there on how to get the actual code info that none of it is working.
I've tried adding the symbols path to my pdb files and I've tried
.loadby sos clr
.loadby sos
!CLRStack
!analyze -v
and all I get is wrong symbols.
WER won't catch crash dumps if there is no crash at all. You know that a process can exit normally, when you think it crashes.
If you do want to learn why a process exits (normally or abnormally), the most reliable way I can think of is to utilize Debug Diag (which is built specifically for IIS),
http://msdn.microsoft.com/en-us/library/ff420662.aspx
Note that you probably should use Debug Diag 2.0 at this moment, and must add Kernel32!ExitProcess and Kernel32!TerminateProcess as breakpoints.
I've setup the mcelog tool on my Linux server, and I'd like to verify that it's working properly but I'm not sure how to test it.
Does anyone know of any ways to generate or trigger an exception event so I confirm that the hardware errors are logged correctly.
mcelog includes a test suite with a tool called mce-inject, designed to do exactly this. The developer has a copy of the source on github. It seems to require Linux 2.6.31 or better.
I wrote a Windows Service using VS 2005 and C# on WinXP Pro SP3. It starts another program which runs to completion and then exits.
The service is installed using installutil and serviceInstaller. It is built release and put into the C:\Program Files\MyService directory. The serviceProcessInstaller Account is set to LocalSystem in it's Properties.
If I set the Log On to Local system I get an 'Access Denied' error (using a try-catch block), but if I set the Log On to my account with the correct password, it runs perfectly.
What am I doing wrong? Any suggestions will be very welcome.
It will be useful to know where the access denied error comes from. Since you say it is from a try/catch block, I assume it is your code that handles it. That would mean that your service is starting just fine, but has problems doing its job.
It could be environment related problem, since the environment for LocalSystem is different than your user account. Also, it could be that the program it starts is not executing properly and it is returning the error.
Without more info, it is just speculation. What is that other program doing? Where is the error occurring? Why don't you debug it and find which part returns the access denied error?
Agreed, it should be on SO. That aside, check your file/folder permission sand ensure System does in fact have the necessary rights. Do the same for the registry keys. The System event log should give you some clues.
Both answers: thanks for the help.
The error orrurs at the Process.Start() call.
The file and directory security shows Everyone has full access to the directories and the executable.
FOUND IT! I had added a user name and password to the ProcessStartInfo object, thinking that it would be useful when the target program tries to get to the database. Oops! When I took that stuff out, the target runs jult like it should.
Thanks again to all who replied. Mea Culpa!