Bug 198225 - 64 bit bug in libdwfl/dwfl_module.c compare_modules()
Summary: 64 bit bug in libdwfl/dwfl_module.c compare_modules()
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: elfutils
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Roland McGrath
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-10 15:09 UTC by Tim Moore
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 0.122-3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-09 00:14:55 UTC
Type: ---
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Sourceware 2896 0 None None None Never

Description Tim Moore 2006-07-10 15:09:49 UTC
Created attachment 132181 [details]
fix for bug

Comment 1 Tim Moore 2006-07-10 15:09:49 UTC
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):
elf-0.120

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 22:23:45 UTC
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-09 00:14:55 UTC
This is fixed in 0.122.


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