Red Hat Bugzilla – Bug 198225
64 bit bug in libdwfl/dwfl_module.c compare_modules()
Last modified: 2007-11-30 17:11:37 EST
Created attachment 132181 [details]
fix for bug
Description of problem:
In dwfl_module.c, compare_modules() has a 64 bit bug. The function returns the
result of subtracting two addresses, which can be 64 bits long, but
compare_modules returns an int because it is a comparison function for qsort.
Comparing a main program module with a low address with a shared library mapped
at a high address can return a wrong value.
Version-Release number of selected component (if applicable):
This came up in Frysk when trying to find the source line of an address in a
program. The search failed beacuse the modules weren't ordered properly.
See attachment for fix.
I applied the patch in a bit cleaned up way to the upstream code. It'll be
fixed in the next rawhide release.
This is fixed in 0.122.