Posts in category breakpad

New nightly build and initial tutorial on how to use crash reporting!

Hello everyone a new nightly build is out which has the first "feature complete" crash reporting concept. So please try it out and met me know how it goes.

I have started a tutorial on how to use both the crash reports but also how to use the new [check_nscp] command which checks the health of NSClient++.

doc/usage/nscp/crash

Michael Medin

Fixed crash: Thank you breakpad!

Got some 300 dumps or so submitted on xmas so I went through them and all were crashing on the same line! Which has been fixed in the latest nightly build. It seems there was an issue with the new PDH counters where I missed to initialize a variable to NULL.

Crash pad analysis was pretty straight forward. The dump looks like this:

...
6|0|CheckSystem.dll|memmove|F:\dd\vctools\crt_bld\SELF_64_AMD64\crt\src\AMD64\memcpy.asm|224|0x0
6|1|CheckSystem.dll|memcpy_s|f:\dd\vctools\crt_bld\self_64_amd64\crt\src\memcpy_s.c|67|0xa
6|2|CheckSystem.dll|std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::assign(std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > const &,unsigned __int64,unsigned __int64)|c:\program files (x86)\microsoft visual studio 8\vc\include\xstring|1049|0x2c
6|3|CheckSystem.dll|PDH::PDHCounter::getName()|c:\source\nscp\branches\stable\include\pdh\counters.hpp|75|0x26
6|4|CheckSystem.dll|PDHCollectors::RoundINTPDHBufferListenerImpl<__int64,PDHCollectors::PDHCounterNormalMutex>::get_name()|c:\source\nscp\branches\stable\include\pdh\collectors.hpp|321|0x4
6|5|CheckSystem.dll|PDHCollectors::RoundINTPDHBufferListenerImpl<__int64,PDHCollectors::PDHCounterNormalMutex>::getAvrage(unsigned int)|c:\source\nscp\branches\stable\include\pdh\collectors.hpp|298|0xf
6|6|ntdll.dll||||0x117287
6|7|CheckSystem.dll|wcstoxl|f:\dd\vctools\crt_bld\self_64_amd64\crt\src\wcstol.c|141|0x7
6|8|KERNELBASE.dll||||0x10ab
6|9|KERNELBASE.dll||||0x10ab
6|10|CheckSystem.dll|PDHCollector::getCPUAvrage(std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >)|c:\source\nscp\branches\stable\modules\checksystem\pdhcollector.cpp|269|0x1d
...

With the offensive line being: 6|3|CheckSystem.dll|PDH::PDHCounter::getName()|c:\source\nscp\branches\stable\include\pdh\counters.hpp|75|0x26

The problem (if we look at the code) was a bit perplexing actually:

		std::wstring get_name() const {
			if (parent_ != NULL)
				return parent_->getName();
			return _T("<UN ATTACHED>");
		}
...
		const std::wstring getName() const {
			return name_;
		}

This looks solid enough right? Whats even worse is that it seems to work fine on my box. So after digging around a bit I noticed this was NULL "after the second call" meaning something is fishy but with a check for NULL before the I was a bit puzzled until I noticed there was no default assignment for the parent_ pointer meaning in some rare cases when performance counters was not working properly we would not get a valid value which in conjunction with an problem in the counter would yield this error.

Anyways, to make a long story short: Thank you Google breakpad and whomever sent in the crash report'''

Tomorrow I will write up a quick tutorial/info page on how to enable crash report submissions and how you can help out the development by submitting (manually if you prefer) crash reports whenever you have a problem!

Michael Medin