Bug 198225 - 64 bit bug in libdwfl/dwfl_module.c compare_modules()
64 bit bug in libdwfl/dwfl_module.c compare_modules()
Product: Fedora
Classification: Fedora
Component: elfutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Depends On:
  Show dependency treegraph
Reported: 2006-07-10 11:09 EDT by Tim Moore
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 0.122-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-08 20:14:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
fix for bug (723 bytes, patch)
2006-07-10 11:09 EDT, Tim Moore
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 2896 None None None Never

  None (edit)
Description Tim Moore 2006-07-10 11:09:49 EDT
Created attachment 132181 [details]
fix for bug
Comment 1 Tim Moore 2006-07-10 11:09:49 EDT
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):

How reproducible:
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.

Additional info:

See attachment for fix.
Comment 2 Ulrich Drepper 2006-07-11 18:23:45 EDT
I applied the patch in a bit cleaned up way to the upstream code.  It'll be
fixed in the next rawhide release.
Comment 3 Roland McGrath 2006-08-08 20:14:55 EDT
This is fixed in 0.122.

Note You need to log in before you can comment on or make changes to this bug.