KVM QEMU Kernel Debugging

Sometimes it is unavoidable to single step through the kernel because the code flow is complicated and systemtap and other tools are not helpful. This comes true when a lot of code must be conditionally analysed, without any prior knowledge. KVM and GDB provides a nice combination for this. I use my standard qemu setup with two additional qemu flags: -s and -S. Both flags instrument qemu to start a qemu gdb server and to break at the beginning....

December 4, 2010 · 1 min · Hagen Paul Pfeifer

Implicit Type Conversions and Bitwise Shift Operators

A error source for ANSI C (ISO/IEC 9899:TC2; 6.3 Conversions) is the implicit type conversion mechanism. The following code fragment illustrates a bogus usage of the shift operation in realtion with the type of the operands: void bit\_mark(unsigned long \*seq\_bits, int32\_t n) { int32\_t word\_offset, word\_num; word\_num = n / sizeof(unsigned long) \* 8; word\_offset = n % sizeof(unsigned long) \* 8; seq\_bits[word\_num] |= 1 << word\_offset; } The error source is the type of “1” which is implicit casted to an integer (Section: 6....

December 2, 2010 · 2 min · Hagen Paul Pfeifer

Libhashish Release

New are pleased to announce realease version 1.1 of “libhashish”:http://libhashish.sf.net. Major features are, … no new features. The release includes bugfixes for (u)int{8,16,32}_t hash key collision, a memory leak fix for the collision array implementation - thanks to Emmanuel Roullit, CFLAGS adjustments from Florian Westpahl, and “Debian”:http://www.debian.org packageizing fixes from Michael Stapelberg.

December 2, 2010 · 1 min · Hagen Paul Pfeifer

Genetic Algorithm Search Algorithm for Complex Problems

Several month ago I spend some months to analyse the behaviour of Genetic Algorithms. The research focused on mutation, selection and crossover algorithms and their behaviour. Genetic Algorithms are probabilistic search heuristics that emulate the process of evolution. Problem domains for genetic algorithms are complex scheduling problems (e.g. flight scheduling at the airport), Protein structure prediction or academic problems like traveling salesman problem. Genetic algorithms are useful where other search algorithms collapse through an almost infinite solution space....

October 14, 2010 · 2 min · Hagen Paul Pfeifer

Advanced Encryption Standard Crypto Speed

Some time ago I benchmarked Rijndal at CPU Cycle Level. I held a small presentation where I presented the raw values. The presentation foils itself are a little bit sparse but the important value are cognizable.

October 14, 2010 · 1 min · Hagen Paul Pfeifer

A Group Mobility Model for MANETs Using Terrain Maps

Due to the lack of money some month ago - now sounds funny - I skipped a conference where I wanted to present an approach to model group mobility of nodes. The idea is to use a form of terrain map (normally used to generate landscape models) as a basis to emulate real world motion characteristics similar. The focus are groups and their motion characterstic within the group. The terrain map is interpreted as what I called penalty map: the object wish is to evade areas with higher penalties to move from start to end....

October 14, 2010 · 1 min · Hagen Paul Pfeifer

TCP Quick ACK versus Packet Overhead

Since several weeks I deal with TCP Quick ACK mechanism. TCP Quick ACK where introduced to bypass the disadvantages of delayed ACKs. If a flow is not interactive and send fully Maximum Segment Sized (MSS) packets from one endpoint to the other there is no real need to artificially delay any packets. In this situation the receiving host will never send any data and the TCP instance can instantly trigger an ACK packet....

October 2, 2010 · 2 min · Hagen Paul Pfeifer

Future Proof

Top IPv6 Working Group posting today regarding @/127@ anycast: > to future-proof their network. future-proof == adding crap we do not understand or need

August 25, 2010 · 1 min · Hagen Paul Pfeifer

Identify Minimum or Maximum of a Value

To identify the minimum or maximum of two values often a simple if else construct is used: if (a < b) min = a; else min = b; or more compact using the ternary operator: min = (a < b) ? a : b; The generated instructions for the first if/else construct and the ternary operator does not differs. At least if the compiler is instructed to optimize the code. If the code is not optimized the compiler generates a little bit awkward code with a branch for the former example....

August 19, 2010 · 2 min · Hagen Paul Pfeifer

Main Memory Corrupt

Since several days strange things happen: Delta compression using up to 2 threads. Compressing objects: 100% (8/8), done. error: inflate: data stream error (incorrect header check) error: corrupt loose object 'ebcab349c392aadd151101e6b2651ed451ff4bf7' fatal: object ebcab349c392aadd151101e6b2651ed451ff4bf7 is corrupted error: pack-objects died with strange error as well as mysterious compile errors and stuff like that. One similarity is a raised memory access pattern, … starting memtest to verify my assumption.

August 17, 2010 · 1 min · Hagen Paul Pfeifer