Source code Analysis $ g++ –version g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0 $ g++ main.cpp -g $ gdb a.out (gdb) b 6
Continue readingCategory: Debugging & Memory
Layout of std::unordered_set (libstdc++)
Layout The meta element on the stack consumes 7 words (56 Byte on x64, 28 Byte on x86). Each node
Continue readingLayout of std:deque (libstdc++)
Layout The meta element on the stack consumes 10 words (80 Byte on x64, 40 Byte on x86). Each chunk
Continue readingAdding dependencies to coredump (GDB)
Let’s assume you have a coredump to analyze, and the shared libs are at another location. Command Description info sharedlibrary
Continue readingAnalyse reproducable stability issues
The following list contains a few ways to find the root cause for a stability issue. Rebuild with debug symbols
Continue readingEasy coredump example (Apport, GDB)
Setup apport Source code Coredump analysis Issue: player hasn’t been initialized before calling play().
Continue readingvtable – a way to realise polymorphism (C++)
Currently most C++ compilers use vtables to realise polymorphism. The object (obj @ 0x614c20) contains a pointer to the vtable
Continue readingCustom allocator to track std::vector
Source code Debugging Result As soon as the std::vector runs out of memory its default allocator (std::allocator<T>) allocates a new
Continue readingGarbage collection (Basics)
A garbage collector is a hidden background tool that cleans unused application memory automatically. It’s necessary for languages which aren’t
Continue readingLayout of std::shared_ptr (libstdc++)
Source code Debugging Visual result |———————-| | shared_ptr sPtr1 | |———————-| |Pointer to the Object |—|——-> Object | | |
Continue reading