Tracing memory-leaks* under Windows

Written by  on March 2, 2018

For a long time I am searching for a useable profiler for windows,
which does not only track the time (like VerySleepy) but memory-usage.
I was used to Instruments under OSX and – boy – I was surprised there
is nothing comparable under Windows.
Visual Studio newer than 2013 is not useable – I know there are profilers integrated.
Dr. Memory crashes at start.
AppVerifier does not work (crash).
http://wiki.qt.io/Profiling_and_Memory_Checking_Tools has some more
hints, but let me present the two tools which finally gave me some
insight:


MTuner (https://github.com/milostosic/MTuner) from Milos Tosic (2017)


Pro: works out of the box without any reconfiguration of the app;
captures data which can be evaluated later; fancy looking; actively
maintained at github (answers error-reports fast); does not need much
explanation
Con: crashes currently while evaluating the bigger traces (400 MiByte+)


And then one Microsoft tool: UMDH

Con: much trouble to acquire and getting it to work (long explanation)
Pro: but the diff of the allocations as stacktraces can be helpful

0. install windows SDK
1. set the gflags correctly: means allow stacktraces for the process
2. capture two snapshots of current image of the process
C:\Program Files (x86)\Windows Kits\10\Debuggers\x86>umdh.exe -p:8480
-f:c:\alloc0.txt
and some moments/actions later
C:\Program Files (x86)\Windows Kits\10\Debuggers\x86>umdh.exe -p:8480
-f:c:\alloc1.txt
3. compare and get starting line 300-400 some descending view of the
biggest allocation-changes:
C:\Program Files (x86)\Windows Kits\10\Debuggers\x86>umdh.exe -d
c:\alloc0.txt c:\alloc1.txt > c:\alloc_diff10o1.txt

at *: I know, sometimes it is not a leak, but “by design” πŸ˜‰

“un-optimize” a VisualStudio-solution

Written by  on March 2, 2018

By default after generating the solution from mpc-files for each vcxproj the optimization-level is set to maximum (O2), which can lead to trouble while debugging. Variables not “visible”, content of containers not readable, .. and then you can stop debugging, reset manually the optimization, restart and go to the breakpoint/crash. Which is a total waste of time.
I’ve also found no way to convince the mpc-buildsystem of building un-optimized.

Ok, then we build us a sed-oneliner which replaces in all project-files the line about optimization and run it under cygwin:

backup your Raspberry Pi-sd card

Written by  on February 28, 2018

Newer versions (8.24+) of coreutils dd have also a progress-option, but not the one bundled with the current distribution ..
add param: “status=progress”

Learning how to solder – a hot iron

Written by  on February 28, 2018

Bought myself a soldering iron and a small kit for practising purposes: 28 led, 9 resistors, 2 capacitors and 2 transistors waited to be soldered. And hey, the result is more than I had hoped for :’) It’s never too late to learn new skills! #growyourownhappiness
This is/was part of my 2018-campaign to acquire more experiences with discrete electronics. Software is nice, but we need something which moves and blinks (to impress people).

dumpDiver: analyze quickly Windows crash-dumps

Written by  on February 20, 2018

I had the task to analyze a bigger collection of crashdumps. Loading the file everytime to VisualStudio, start debugging, , look at the callstack, copy-paste it for first data-collection … BORING.
So, I thought if there are tools, which can extract the information (yes, the cdb for Windows) and put it to a file with the same name-prefix. Et voila: dumpDiver was born.
A small helper-batch-file which does the above-mentioned stuff. So that you can lean back and watch your computer grind at 100% workload πŸ™‚

ps. Yes, I know, it is slightly wrong. dumpster-diver would be correct.

banner generator: figlet (online)

Written by  on February 11, 2018

Ok, most of the times your classes and functions shall be commented.
So, let us decorate a bit: your wish shall be my command πŸ˜‰
I had just remembered the good old toolkit to generate banners!

url: http://patorjk.com/software/taag/

20 min-project of today: creepy squirrel

Written by  on December 1, 2017

Had in mind to play around with the “make LED shine directly via PIN”-feature of the Calliope Mini. Worked, nice πŸ™‚
Actually for both β€œeyes” it is randomnly picked if they shall light up (and down) separately, but the GIF can can last just 3 seconds.

I need a new mp3-player: why not buy again a (used) Sansa Clip+ and Rockbox it?

Written by  on November 18, 2017

Guide is still valid.
Downloading the firmware-binary and running the Rockbox-installer (now at version 3.14) under Linux was not a problem.

Five minutes later I got a “new” working player. Still prefer it to the (smart-)phone while doing fitness.

applied science ;3

Written by  on October 28, 2017

The surface-temperature of an average ~furry lazybutt~ housecat is 24Β°C πŸ˜€

For this important experiment you need: a Calliope Mini, a computer science-degree and too much free time ;’)
Just kidding, the code is quite simple:

proper rename-scheme for digiKam

Written by  on October 28, 2017

The Olympus-cam has no nice way to set an immediate scheme for the filename, so I transfer the files to the PC and fire up digiKam:

Fun fact: since it is based on KDE –> Qt, it also uses the same formatting for DateTime like Qt. Horay πŸ™‚

Addendum: to fix the annoying “no klauncher found”-message and the invisible thumbnails after some certain apt-get-upgrades, just run

again.