Sysinternals ProcDump -e usage - sysinternals

I am rather new to using the procdump.exe utility and I am trying to find out why a process I am running is crashing without generating a crash dump or writing out an unhandled exception to the log. I am using the following command line
procdump.exe -e -t pid C:\DumpFiles\Process.dmp
As I am running this against the process that is having issues, I don't see any dump file being generated though I am seeing the following exception many times:
Exception: E0434352.CLR
According to one website I looked at, that particular exception get generated whenever there is an unhandled exception, which isn't particularly helpful to me. Also, I am not sure how true that information I got was. I was wondering if there was a way to get procdump to spit out a dump file when it encounters an exception like that so I can see what is going on.
Thanks in advance!

E0434352.CLR is an error code that represents .NET exceptions and it is used by the CLR, therefore I assume that your process is managed code. Adding the '-g' switch (Run as a native debugger in a managed process) will provide you the information you're looking for.

As #yonisha said, "E0434352.CLR" is a general message for all .NET Exceptions.
But, you can check specific .NET Exception if you add "1" value to "-e" option as follows,
procdump -e 1 -f "" [Your Process ID]
After applying that option, procdump will print E0434352.CLR as .NET Exception like this.
[14:54:53] Exception: E0434F4D.System.IO.DirectoryNotFoundException ("Could not find a part of the path 'c:\myfile\test.dat'.")
Once you could identified what kind of .NET Exception, you can dump it with these options.
procdump -ma -e 1 -f "DirectoryNotFoundException" [Your Process ID] c:\temp\test.dmp

Related

perf can't find ELF for unwinding when tracing app in docker

I am tracing an application running inside a docker container. To do so, I am attaching to it with the following command
perf record -o /tmp/perd.data --call-graph dwarf --pid <pid>
The tracing works fine, but when I try to get a report I get the following issue, it doesn't show any of my application functions, they are all unknown.
In have also tried hotspot, and I get the following error
PerfUnwind::MissingElfFile: Could not find ELF file for /workspace/build/release/bin/shared-libs/libdeLog.so. This can break stack unwinding and lead to missing symbols.
I think the issue is that, since the app is running in a container, the libraries are in a particular directory (/workspace/build/release/bin/shared-libs), and when I run perf report on the host, it can't find where the libraries are, since the library directory only exists on the container.
How can I fix that?

Docker - Handling multiple services in a single container

I would like to start two different services in my Docker container and exit the container as soon as one of them exits. I looked at supervisor, but I can't find how to get it to quit as soon as one of the managed applications exits. It tries to restart them up to three times, as is the standard setting and then just sits there doing nothing. Is supervisor able to do this or is there any other tool for this? A bonus would be if there also was a way to let both managed programs write to stdout, tagged with their application name, e.g.:
[Program 1] Some output
[Program 2] Some other output
[Program 1] Output again
Since you asked if there was another tool... we designed and wrote a powerful replacement for supervisord that is designed specifically for Docker. It automatically terminates when all applications quit, as well as has special service settings to control this behavior, plus will redirect stdout with tagged syslog-compatible output lines as well. It's open source, and being used in production.
Here is a quick start for Docker: http://garywiz.github.io/chaperone/guide/chap-docker-simple.html
There is also a complete set of tested base-images which are a good example at: https://github.com/garywiz/chaperone-docker, but these might be overkill and the earlier quickstart may do the trick.
I found solutions to both of my requirements by reading through the docs some more.
Exit supervisord on application exit
This can be achieved by using a custom eventlistener. I had to add the following segment into my supervisord configuration file:
[eventlistener:shutdownevent]
command=/shutdownhandler.sh
events=PROCESS_STATE_EXITED
supervisord will start the referenced script and upon the given event being triggered (PROCESS_STATE_EXITED is triggered after the exit of one of the managed programs and it not restarting automatically) will send a line containing data about the event on the scripts stdin.
The referenced shutdownhandler-script contains:
#!/bin/bash
while :
do
echo -en "READY\n"
read line
kill $(cat /supervisord.pid)
echo -en "RESULT 2\nOK"
done
The script has to indicate being ready by sending "READY\n" on its stdout, after which it may receive an event data line on its stdin. For my use case upon receival of a line (meaning one of the managed programs has exited), a SIGTERM is sent to the supervisord process being found by the pid it leaves in its pid file (situated in the root directory by default). For technical completeness, I also included a positive answer for the eventlistener, though that one should never matter.
Tagged output on stdout
I did this by simply starting a tail process in the background before starting supervisord, tailing the programs output log and piping the lines through ts (from the moreutils package) to prepend a tag to it. This way it shows up via docker logs with an easy way to see which program actually wrote the line.
tail -fn0 /var/log/supervisor/program1.log | ts '[Program 1]' &

VBS printer script executing error

I have some trouble executing/using vbs scripts linked to printers. They are located in %windir%/System32/Printing_Admin_Scripts
The objective is to plan a weekly print task to preserve ink cartridge
Looking at the scripts, everything was available for me to create this task
The main script to use is prnqctl.vbs
Before to create my task, I have tried to test the script and this is what I got (sorry for the french version, I will try to update the screenshot in english later):
There is obviously something wrong.
I have tried to google the error code, nothing conclusive.
I have tried to run my script in admin mode and also under admin session, same problem
I have made some research on CIMWin32, it seems to be a dll and I can find it in some locations of my filesystem
My OS is W8.1.
If anybody has a suggestion or solution, I'm interested in
==>cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnqctl.vbs -e
Unable to get printer instance. Error 0x80041002 Not found
Operation GetObject
Provider CIMWin32
Description
Win32 error code
The error culprit is clear: you should provide a valid -p argument. It's a mandatory parameter in case of -e operation:
==>cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnqctl.vbs -e -p "Fax"
Success Print Test Page Printer Fax
==>

What caused this unhelpful Powershell ISE error message?

I'm trying to use Powershell ISE as a console app with little success. Comskip is a command line tool and I'm having a AHK script executing the Comskip commercial stipping normally through cmd.exe. Works fine, but lately I started using Unicode characters (star-rating) in the filenames and as you all know these won't display especially good in the console.
Investigation led me to Powershell ISE which is supposed to support Unicode. Running Comskip from ISE proved to be quite challenging. It works fine if typing in everything manually, but the problem starts when calling it from an another script.
Now the problematic part is if using the code calling the ordinary Powershell console it all went fine. But the same code calling the ISE fails and I can't see why. Can any of you? The error message I get doesn't give any explicit clues on what went wrong. The error message only says:
Usage: powershell_ise.exe or powershell_ise.exe fileName.ps1
The AHK line calling the ISE looks like this:
latest_file := "C:\Program\Comskip\q.ts"
Run, PowerShell_ISE.exe "C:\Program\Comskip\comskip.exe" -t --videoredo "%latest_file%"
Now if using the Powershell console the same code executes alright:
latest_file := "C:\Program\Comskip\q.ts"
Run, PowerShell.exe "C:\Program\Comskip\comskip.exe" -t --videoredo "%latest_file%"
How come I get these anomalies?
PowerShell ISE does not have ability to run commands like powershell.exe has. Reason for that is simple: ISE was designed as an interactive environment where powershell.exe had been thought out as something both for interactive and "batch" operations, like the one you tried to complete.
The error you get is IMO descriptive enough: you can only run PowerShell_ISE (no paramters) or specify .ps1 file that ISE will open once it started. In v3 there are 2 new added ( -NoProfile and -MTA) but still - nobody designed it as batch processing tool.. sorry.

extracting error information from rails log files

i am developing on 5 different rails projects, plus also refactoring some (moving from older rails versions to 2.3) - what is the best way to extract the error information from the logfiles, so i can see all the depreciation warnings, runtime errors and so on, so i can work on improving the codebase?
are there any services or libraries out there you can recommend, that actually help with rails logfile parsing?
Read about grep linux command.
http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/
I don't know what error log format is in Rails, but I guest every row with warning or error contain "warning" or "error" word.
Then it would be like this:
grep -E "error|warning" logfile.txt
for bot error and warnings
grep "error" logfile.txt
for errors
grep "warning" logfile.txt
for warnings
and if you want to see new errors and warnings in real time, try this
tail -f logfile.txt | grep -E "error|warning"
tail -f logfile.txt | grep "error"
tail -f logfile.txt | grep "warning"
Hope I could help you ;) and I hope that I'm not wrong about logs format in Rails
I've found the request-log-analyzer project to be very useful.
You can certain grep the log to find errors and dump them out, but this does an excellent job of gathering all the information about the different actions and how long they take.
Here's some sample output.
This is the first thing I run when I get a call saying "my site is slow and I need help fixing it."
Hoptoad and/or Exceptional are great for ongoing errors, but they don't track log running requests. Something like New Relic is good for that.
I use hoptoadapp, http://www.hoptoadapp.com/pages/home there is a free flavor, it logs your error messages to their database, and they provide an easy to use interface. All you have to do is install this plugin: http://github.com/thoughtbot/hoptoad_notifier.
It won't help for past errors, but it is great for isolating problems with a currently running app.

Resources