In elfutils 0.124, libdwfl's compare_modules routine screws up for x86_64. The problem is that the kernel pseudo-module's address gets compared incorrectly to module addresses, and is consequently not correctly sorted in the dwfl->modules array. The following simpler implementation works and explains: static int compare_modules (const void *a, const void *b) { Dwfl_Module *const *p1 = a, *const *p2 = b; const Dwfl_Module *m1 = *p1, *m2 = *p2; if (m1 == NULL) return -1; if (m2 == NULL) return 1; // NB: Computing a signed difference between m1-> and m2-> is not // good enough, since the possible range of the difference exceeds // the representational limits of signed numbers of the same // bit-width. // // e.g: take 8-bit values. // m1=255 m2=0 => m1 larger, should return 1, but (signed char) (255-0) = -1 ! if (m1->low_addr < m2->low_addr) return -1; else if (m1->low_addr > m2->low_addr) return 1; else return 0; }
Applied upstream. Will be in 0.125.
Can you give a larger blurb to justify treating this as an exception to PM? Should this be tied to bug #215053?
Two fixes in elfutils-0.125, including this one, are necessary to resolve bug 215053. This one's urgency and impact should be considered the same as bug 215053, whatever that determination is. This elfutils issue does not have any significant impact outside its impact on systemtap.
0.125 went into RHEL5.